pyinterp.geometry.cartesian.algorithms.to_geojson

Contents

pyinterp.geometry.cartesian.algorithms.to_geojson#

pyinterp.geometry.cartesian.algorithms.to_geojson(geometry: pyinterp.core.geometry.cartesian.Point) → str#
pyinterp.geometry.cartesian.algorithms.to_geojson(geometry: pyinterp.core.geometry.cartesian.LineString) → str
pyinterp.geometry.cartesian.algorithms.to_geojson(geometry: pyinterp.core.geometry.cartesian.Ring) → str
pyinterp.geometry.cartesian.algorithms.to_geojson(geometry: pyinterp.core.geometry.cartesian.Polygon) → str
pyinterp.geometry.cartesian.algorithms.to_geojson(geometry: pyinterp.core.geometry.cartesian.MultiPoint) → str
pyinterp.geometry.cartesian.algorithms.to_geojson(geometry: pyinterp.core.geometry.cartesian.MultiLineString) → str
pyinterp.geometry.cartesian.algorithms.to_geojson(geometry: pyinterp.core.geometry.cartesian.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]}'