jazzband / geojson

Python bindings and utilities for GeoJSON
https://pypi.python.org/pypi/geojson/
BSD 3-Clause "New" or "Revised" License
908 stars 120 forks source link

Allow constructing objects like Feature(feature) #55

Closed hyperknot closed 6 years ago

hyperknot commented 9 years ago

In Python most object support creating a new object from an old one, (AFAIK by doing a copy operation), by constructing it in the form of:

a = dict(...)
b = dict(a)

In geojson it is not supported. If I try to do:

f = Feature(...)
f2 = Feature(f)

It creates a broken object like:

{"geometry": null, "id": {"geometry": null, "properties": {}, "type": "Feature"}, "properties": {}, "type": "Feature"}

This would be especially important as geojson is inheriting from dict, so ideally it should behave in a similar way.

JesseWeinstein commented 7 years ago

Attempting to address this in PR #104

frewsxcv commented 6 years ago

completed in https://github.com/frewsxcv/python-geojson/pull/104. will release a new version shortly