All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Fix
Polygon.from_bounds
to respect geojson specification and return counterclockwise linear ring (author @jmfee-usgs, developmentseed#49)
- Follow geojson specification and make feature geometry optional (author @yellowcap, developmentseed#47)
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, developmentseed#45) - improve type definition (and validation) for geometry coordinate arrays (author @geospatial-jeff, developmentseed#44)
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'}
- Added validation for Polygons with zero size.
-
Feature
andFeatureCollection
model generics to support custom geometry and/or properties validation (author @iwpnd, developmentseed#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 (developmentseed#34)
# before from geojson_pydantic.features import Feature, FeatureCollection from geojson_pydantic.geometries import Polygon # now from geojson_pydantic import Feature, Polygon
- Drop python 3.6 support
- Renamed
utils.py
totypes.py
- Removed
Coordinate
type ingeojson_pydantic.features
(replaced byPosition
)
- incorrect version number set in
__init__.py
- Made collections iterable (#12)
- Added
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.
- Correct package type information files
- Added documentation on locally running tests (#3)
- Publish type information (#6)
- Removed geojson dependency (#4)
- Include MultiPoint as a valid geometry for a Feature (#1)
- Initial Release