NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #3367 most downloaded on PyPI
Pydantic data models for the GeoJSON spec.
Last release 13 days ago
21 Sep 2026
Ships fairly regularly
a new release about every 4 months
Nearly every release is documented
notes for 31 of 32 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
33 releases · first in 2020
One column per quarter.
Fix validation of numeric feature identifiers by @bensynapse in #205
Full Changelog: 2.1.2...2.2.0
fix: typo in _lines_wkt_coordinates function by @vincentsarago in #199
Full Changelog: 2.1.1...2.1.2
_lines_wtk_coordinates to _lines_wkt_coordinatesci: add Dependabot for GitHub Actions version updates by @lhoupert in #180
Full Changelog: 2.1.0...2.1.1
add create class method to construct object without type attribute by @vincentsarago in #175
create class method to construct object without type attribute by @vincentsarago in #175Full Changelog: 2.0.0...2.1.0
add .create() method to Geometry objects to create them without type key
from geojson_pydantic import Point
Point.create(coordinates=(0,0))
>> Point(bbox=None, type='Point', coordinates=Position2D(longitude=0.0, latitude=0.0))
add python 3.14 support
remove conflicting iter len getitem methods by @vincentsarago in #173
Full Changelog: 1.2.0...2.0.0
remove custom __iter__, __getitem__ and __len__ methods from GeometryCollection class breaking change
from geojson_pydantic.geometries import GeometryCollection, Point, MultiPoint
geoms = GeometryCollection(
type="GeometryCollection",
geometries=[
Point(type="Point", coordinates=(102.0, 0.5)),
MultiPoint(type="MultiPoint", coordinates=[(100.0, 0.0), (101.0, 1.0)]),
],
)
########
# Before
for geom in geom: # __iter__
pass
assert len(geoms) == 2 # __len__
_ = geoms[0] # __getitem__
#####
# Now
for geom in geom.iter(): # __iter__
pass
assert geoms.length == 2 # __len__
_ = geoms.geometries[0] # __getitem__
remove custom __iter__, __getitem__ and __len__ methods from FeatureCollection class breaking change
from geojson_pydantic import FeatureCollection, Feature, Point
fc = FeatureCollection(
type="FeatureCollection",
features=[
Feature(
type="Feature",
geometry=Point(type="Point", coordinates=(102.0, 0.5)),
properties={"name": "point1"},
),
Feature(
type="Feature",
geometry=Point(type="Point", coordinates=(102.0, 1.5)),
properties={"name": "point2"},
),
],
)
########
# Before
for feat in fc: # __iter__
pass
assert len(fc) == 2 # __len__
_ = fc[0] # __getitem__
#####
# Now
for feat in fc.iter(): # __iter__
pass
assert fc.length == 2 # __len__
_ = fe.features[0] # __getitem__
make sure GeometryCollection are homogeneous for Z coordinates
from geojson_pydantic.geometries import Point, LineString, GeometryCollection
# Before
GeometryCollection(
type="GeometryCollection",
geometries=[
Point(type="Point", coordinates=[0, 0]), # 2D point
LineString(
type="LineString", coordinates=[(0.0, 0.0, 0.0), (1.0, 1.0, 1.0)] # 3D LineString
),
],
)
>>> GeometryCollection(bbox=None, type='GeometryCollection', geometries=[Point(bbox=None, type='Point', coordinates=Position3D(longitude=0.0, latitude=0.0, altitude=0.0)), LineString(bbox=None, type='LineString', coordinates=[Position3D(longitude=0.0, latitude=0.0, altitude=0.0), Position3D(longitude=1.0, latitude=1.0, altitude=1.0)])])
# Now
GeometryCollection(
type="GeometryCollection",
geometries=[
Point(type="Point", coordinates=[0, 0]), # 2D point
LineString(
type="LineString", coordinates=[(0.0, 0.0, 0.0), (1.0, 1.0, 1.0)] # 3D LineString
),
],
)
>>> ValidationError: 1 validation error for GeometryCollection
geometries
Value error, GeometryCollection cannot have mixed Z dimensionality. [type=value_error, input_value=[Point(bbox=None, type='P...de=1.0, altitude=1.0)])], input_type=list]
For further information visit https://errors.pydantic.dev/2.11/v/value_error
* drop python 3.8 support * add python 3.13 support
Bump version: 1.1.1 → 1.1.2
Bump version: 1.1.1 → 1.1.2
bbox validation and allow antimeridian crossing bboxesBump version: 1.1.0 → 1.1.1
Bump version: 1.1.0 → 1.1.1
flit-core for packaging build backendBump version: 1.0.2 → 1.1.0
Bump version: 1.0.2 → 1.1.0
Bump version: 1.0.1 → 1.0.2
Bump version: 1.0.1 → 1.0.2
Model serialization when using include/exclude (ref: https://github.com/developmentseed/geojson-pydantic/pull/148)
reduce validation error message verbosity when discriminating Geometry types
GeometryCollection warningsupdate pydantic requirement to ~=2.0
update pydantic FeatureCollection generic model to allow named features in the generated schemas.
# before
FeatureCollection[Geometry, Properties]
# now
FeatureCollection[Feature[Geometry, Properties]]
raise ValueError in geometries.parse_geometry_obj instead of ValidationError
# before
parse_geometry_obj({"type": "This type", "obviously": "doesn't exist"})
>> ValidationError
# now
parse_geometry_obj({"type": "This type", "obviously": "doesn't exist"})
>> ValueError("Unknown type: This type")
update JSON serializer to exclude null bbox and id
# before
Point(type="Point", coordinates=[0, 0]).json()
>> '{"type":"Point","coordinates":[0.0,0.0],"bbox":null}'
# now
Point(type="Point", coordinates=[0, 0]).model_dump_json()
>> '{"type":"Point","coordinates":[0.0,0.0]}'
delete geojson_pydantic.geo_interface.GeoInterfaceMixin and replaced by geojson_pydantic.base._GeoJsonBase class
delete geojson_pydantic.types.validate_bbox
Nothing published for this version
limit pydantic requirement to ~=1.0
~=1.0Additional bbox validation (author @eseglem, https://github.com/developmentseed/geojson-pydantic/pull/122)
Fix issue with null bbox validation (author @bmschmidt, https://github.com/developmentseed/geojson-pydantic/pull/119)
No change since 0.6.0a0
No change since 0.6.0a0
Validate order of bounding box values. (author @moradology, https://github.com/developmentseed/geojson-pydantic/pull/114)
Validate order of bounding box values. (author @moradology, https://github.com/developmentseed/geojson-pydantic/pull/114)
Enforce required keys and avoid defaults. This aim to follow the geojson specification to the letter.
# Before
Feature(geometry=Point(coordinates=(0, 0)))
# Now
Feature(
type="Feature",
geometry=Point(type="Point", coordinates=(0, 0)),
properties=None,
)
Add has_z function to Geometries (author @eseglem, https://github.com/developmentseed/geojson-pydantic/pull/103)
Add optional bbox to geometries. (author @eseglem, https://github.com/developmentseed/geojson-pydantic/pull/108)
Add support for nested GeometryCollection and a corresponding warning. (author @eseglem, https://github.com/developmentseed/geojson-pydantic/pull/111)
__geo_interface__ to be a Mixin which returns self.dict (author @eseglem, https://github.com/developmentseed/geojson-pydantic/pull/105)Type a mandatory key for objects (author @vincentsarago, https://github.com/developmentseed/geojson-pydantic/pull/94)LinearRing Model (author @eseglem, https://github.com/developmentseed/geojson-pydantic/pull/106)Derive WKT type from Geometry's type instead of class name (author @eseglem, https://github.com/developmentseed/geojson-pydantic/pull/81)
NumType with float throughout (author @eseglem, https://github.com/developmentseed/geojson-pydantic/pull/83)__geo_interface__ definition to not use pydantic BaseModel.dict() method and better match the specificationvalidate classmethods used to implicitly load json strings (author @eseglem, https://github.com/developmentseed/geojson-pydantic/pull/88)The bbox key should not be in a __geo_interface__ object if the bbox is None (author @yellowcap, https://github.com/developmentseed/geojson-pydantic/p
__geo_interface__ object if the bbox is None (author @yellowcap, https://github.com/developmentseed/geojson-pydantic/pull/77)GeometryCollection as optional input to geometry field in Feature (author @davidraleigh, https://github.com/developmentseed/geojson-pydantic/pull/72)
GeometryCollection as optional input to geometry field in Feature (author @davidraleigh, https://github.com/developmentseed/geojson-pydantic/pull/72)Geometry and GeometryCollection validation from dict or string (author @Vikka, https://github.com/developmentseed/geojson-pydantic/pull/69)
Geometry and GeometryCollection validation from dict or string (author @Vikka, https://github.com/developmentseed/geojson-pydantic/pull/69)
Point.validate('{"coordinates": [1.0, 2.0], "type": "Point"}')
>> Point(coordinates=(1.0, 2.0), type='Point')
Feature and FeatureCollection validation from dict or string
FeatureCollection.validate('{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"coordinates": [1.0, 2.0], "type": "Point"}}]}')
>> FeatureCollection(type='FeatureCollection', features=[Feature(type='Feature', geometry=Point(coordinates=(1.0, 2.0), type='Point'), properties=None, id=None, bbox=None)], bbox=None)
.wkt property for Geometry object ```python from geojson_pydantic.geometries import Point
.wkt property for Geometry object
from geojson_pydantic.geometries import Point
Point(coordinates=(1, 2)).wkt
>> 'POINT (1.0 2.0)'
.exterior and .interiors properties for geojson_pydantic.geometries.Polygon object.
from geojson_pydantic.geometries import Polygon
polygon = Polygon(
coordinates=[
[(0, 0), (0, 10), (10, 10), (10, 0), (0, 0)],
[(2, 2), (2, 4), (4, 4), (4, 2), (2, 2)],
]
)
polygon.exterior
>> [(0.0, 0.0), (0.0, 10.0), (10.0, 10.0), (10.0, 0.0), (0.0, 0.0)]
list(polygon.interiors)
>> [[(2.0, 2.0), (2.0, 4.0), (4.0, 4.0), (4.0, 2.0), (2.0, 2.0)]]
__geo_interface__ to geojson_pydantic.geometries.GeometryCollection object
__geo_interface__ to geojson_pydantic.feature.Feature and geojson_pydantic.feature.FeatureCollection object
geojson_pydantic.__all__ to declaring public objects (author @farridav, https://github.com/developmentseed/geojson-pydantic/pull/52)
pyproject.tomlgeojson_pydantic.version to geojson_pydantic.__version__Fix optional geometry and bbox fields on Feature; allowing users to pass in None or even omit either field (author @moradology, https://github.com/dev
Feature; allowing users to pass in None or even omit either field (author @moradology, https://github.com/developmentseed/geojson-pydantic/pull/56)Polygon.from_bounds to respect geojson specification and return counterclockwise linear ring (author @jmfee-usgs, https://github.com/developmentseed/geojson-pydantic/pull/49)Follow geojson specification and make feature geometry optional (author @yellowcap, https://github.com/developmentseed/geojson-pydantic/pull/47) ```py
from geojson_pydantic import Feature
# Before
feature = Feature(type="Feature", geometry=None, properties={})
>> ValidationError: 1 validation error for Feature
geometry none is not an allowed value (type=type_error.none.not_allowed)
# Now
feature = Feature(type="Feature", geometry=None, properties={})
assert feature.geometry is None
fix parse_geometry_obj potential bug (author @geospatial-jeff, https://github.com/developmentseed/geojson-pydantic/pull/45)
parse_geometry_obj potential bug (author @geospatial-jeff, https://github.com/developmentseed/geojson-pydantic/pull/45)Polygon.from_bounds class method to create a Polygon geometry from a bounding box. ```python from geojson_pydantic import Polygon print(Polygon.from_b
Polygon.from_bounds class method to create a Polygon geometry from a bounding box.from geojson_pydantic import Polygon
print(Polygon.from_bounds((1, 2, 3, 4)).dict(exclude_none=True))
>> {'coordinates': [[(1.0, 2.0), (1.0, 4.0), (3.0, 4.0), (3.0, 2.0), (1.0, 2.0)]], 'type': 'Polygon'}
Feature and FeatureCollection model generics to support custom geometry and/or properties validation (author @iwpnd, https://github.com/developmentsee
Feature and FeatureCollection model generics to support custom geometry and/or properties validation (author @iwpnd, https://github.com/developmentseed/geojson-pydantic/pull/29)
from pydantic import BaseModel
from geojson_pydantic.features import Feature
from geojson_pydantic.geometries import Polygon
class MyFeatureProperties(BaseModel):
name: str
value: int
feature = Feature[Polygon, MyFeatureProperties](
**{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[13.38272, 52.46385],
[13.42786, 52.46385],
[13.42786, 52.48445],
[13.38272, 52.48445],
[13.38272, 52.46385],
]
],
},
"properties": {"name": "test", "value": 1},
}
)
Top level export (https://github.com/developmentseed/geojson-pydantic/pull/34)
# before
from geojson_pydantic.features import Feature, FeatureCollection
from geojson_pydantic.geometries import Polygon
# now
from geojson_pydantic import Feature, Polygon
utils.py to types.pyCoordinate type in geojson_pydantic.features (replaced by Position)incorrect version number set in __init__.py
__init__.pyAdded parse_geometry_obj function
parse_geometry_obj function (#9)Although the type file was added in 0.2.0 it wasn't included in the distributed package. Use this version 0.2.1 for type annotations.
Although the type file was added in 0.2.0 it wasn't included in the distributed package. Use this version 0.2.1 for type annotations.
Added documentation on locally running tests
[unreleased]: https://github.com/developmentseed/geojson-pydantic/compare/2.2.0...HEAD [2.2.0]: https://github.com/developmentseed/geojson-pydantic/co
Your coding agent can read these notes before it upgrades. Set up the MCP server →