Skip to content

Description:

  • Implements all the GeoJSON Objects described in The GeoJSON Format Specification.

Resources:

Create geoJSON object from Point

from geojson import Point
Point((-115.81, 37.24))

Create geoJSON object from Polygon

from geojson import Polygon
# No hole within polygon
no_hole = Polygon([[(2.38, 57.322), (-120.43, 19.15), (23.194, -20.28), (2.38, 57.322)]]) # doctest: +ELLIPSIS
# Polygon with hole
hole = Polygon([
[(2.38, 57.322), (-120.43, 19.15), (23.194, -20.28), (2.38, 57.322)],
[(-5.21, 23.51), (15.21, -10.81), (-20.51, 1.51), (-5.21, 23.51)]
]) # doctest: +ELLIPSIS
print(no_hole)
print(hole)

ganymede is made by Eugo