pyinterp.geometry.geographic.algorithms.to_geojson

Contents

pyinterp.geometry.geographic.algorithms.to_geojson#

pyinterp.geometry.geographic.algorithms.to_geojson(geometry: pyinterp.core.geometry.geographic.Point) → str#
pyinterp.geometry.geographic.algorithms.to_geojson(geometry: pyinterp.core.geometry.geographic.LineString) → str
pyinterp.geometry.geographic.algorithms.to_geojson(geometry: pyinterp.core.geometry.geographic.Ring) → str
pyinterp.geometry.geographic.algorithms.to_geojson(geometry: pyinterp.core.geometry.geographic.Polygon) → str
pyinterp.geometry.geographic.algorithms.to_geojson(geometry: pyinterp.core.geometry.geographic.MultiPoint) → str
pyinterp.geometry.geographic.algorithms.to_geojson(geometry: pyinterp.core.geometry.geographic.MultiLineString) → str
pyinterp.geometry.geographic.algorithms.to_geojson(geometry: pyinterp.core.geometry.geographic.MultiPolygon) → str

Converts a geometry to GeoJSON representation.

GeoJSON is a format for encoding geographic data structures using JSON. This function converts Boost.Geometry objects to their GeoJSON equivalent.

Parameters:

geometry – The geometry to convert.

Returns:

A JSON string representing the geometry in GeoJSON format.

Examples

>>> point = Point(1.0, 2.0)
>>> geojson = to_geojson(point)
>>> # Returns '{"type":"Point","coordinates":[1.0,2.0]}'