mpas_tools.mesh.creation.signed_distance.mask_from_geojson¶
-
mpas_tools.mesh.creation.signed_distance.
mask_from_geojson
(fc, lon_grd, lat_grd, max_length=None, shapes=None, epsilon=1e-10)[source]¶ Make a rasterized mask on a lon/lat grid from shapes (geojson multipolygon data).
- Parameters
fc (geometrics_features.FeatureCollection) – The regions to be rasterized
lon_grd (numpy.ndarray) – A 1D array of longitude values
lat_grd (numpy.ndarray) – A 1D array of latitude values
max_length (float, optional) – The maximum distance (in degrees) between points on the boundary of the geojson region. If the boundary is too coarse, it will be subdivided.
shapes (list of shapely.geometry, optional) – A list of shapes that have already been extracted from fc and possibly subdivided
epsilon (float, optional) – A small amount to expand each shape by to make sure lon/lat points on the domain boundary are within shapes that touch the domain boundary.
- Returns
mask (numpy.ndarray) – A 2D mask with the shapes rasterized (0.0 outside, 1.0 inside)