Skip to main content

read_land_polygons

Function read_land_polygons 

Source
pub fn read_land_polygons(
    path: &Path,
    bbox: Option<&Bbox>,
    emit: impl FnMut(InputFeature),
) -> Result<u64, GeolithError>
Expand description

Stream land polygons from a shapefile through emit.

Expects land-polygons-split-3857 in EPSG:3857 projection. Coordinates are reprojected to WGS84 before emission. When bbox is provided, shapes whose EPSG:3857 bbox reprojects to a region outside the WGS84 bbox are skipped without decoding โ€” a large speedup for small bbox builds against global shapefiles.

ยงErrors

GeolithError::Shapefile when the shapefile cannot be opened or a shape cannot be read.