mpas_tools.mesh.creation.signed_distance.signed_distance_from_geojson¶
-
mpas_tools.mesh.creation.signed_distance.
signed_distance_from_geojson
(fc, lon_grd, lat_grd, earth_radius, max_length=None, epsilon=1e-10)[source]¶ Get the distance for each point on a lon/lat grid from the closest point on the boundary of the geojson regions.
- 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
earth_radius (float) – Earth radius in meters
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.
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
signed_distance (numpy.ndarray) – A 2D field of distances (negative inside the region, positive outside) to the shape boundary