Skip to content

Commit

Permalink
Add function for the transformation of a crs for ugrid
Browse files Browse the repository at this point in the history
  • Loading branch information
priscavdsluis committed Feb 20, 2024
1 parent 33502fa commit 8a33648
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions netcdf_to_gltf_converter/netcdf/ugrid/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,17 @@ def node_coordinates(self) -> np.ndarray:
np.ndarray: An ndarray of floats with shape (n, 2). Each row represents one node and contains the x- and y-coordinate.
"""
return self._ugrid2d.node_coordinates

def transform_coordinate_system(self, source_crs: int, target_crs: int):
"""Transform the coordinates to another coordinate system.
Args:
source_crs (int): EPSG from the source coordinate system.
target_crs (int): EPSG from the target coordinate system.
"""
self._ugrid2d.set_crs(epsg=source_crs)
self._ugrid2d = self._ugrid2d.to_crs(epsg=target_crs)

@property
def fill_value(self) -> int:
"""Get the fill value.
Expand Down

0 comments on commit 8a33648

Please sign in to comment.