xugrid.Ugrid1d.from_meshkernel#

classmethod Ugrid1d.from_meshkernel(mesh, name: str = 'network1d', projected: bool = True, crs: Any = None)[source]#

Create a 1D UGRID topology from a MeshKernel Mesh1d object.

Parameters:
  • mesh (MeshKernel.Mesh2d) –

  • name (str) – Mesh name. Defaults to “network1d”.

  • projected (bool) – 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.

  • 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.

Returns:

grid

Return type:

Ugrid1d