xugrid.Ugrid2d.set_node_coords#
- Ugrid2d.set_node_coords(node_x: str, node_y: str, obj: DataArray | Dataset, is_projected: bool = True, crs: Any = None)#
Given names of x and y coordinates of the nodes of an object, set them as the coordinates in the grid.
- Parameters:
node_x (str) – Name of the x coordinate of the nodes in the object.
node_y (str) – Name of the y coordinate of the nodes in the object.
obj (xr.DataArray, xr.Dataset)
is_projected (bool, optional) – Whether node_x and node_y are longitude and latitude or projected x and y coordinates. Used to write the appropriate standard_name in the coordinate attributes. If crs is provided, its value will take priority.
crs (Any, optional) – Coordinate Reference System of the geometry objects. Can be anything accepted by
pyproj.CRS.from_user_input(), such as an authority string (eg “EPSG:4326”) or a WKT string.