Closed johnclary closed 5 years ago
Thanks @johnclary! I made a few minor tweaks to the import statements and removed the dependency from setup.py
for completeness... does this look good to you?
@thekaveman looks great.
TBH I haven't tested to_feature()
as it's called in provider.py
. The tuple/list conversion may be unnecessary (though it does make the feature objects feel more like a geoJSON)
I tested it with:
from mds.json import parse_boundary, to_feature
url = "https://opendata.arcgis.com/datasets/63595d717c494165b3c6b3b85c2463ae_0.geojson"
boundary = parse_boundary(url)
feature = to_feature(boundary)
That URL is a multipolygon of neighborhoods in Santa Monica, parse_boundary
melds into a single Polygon
. Seems to work.
@johnclary are you no longer interested in having this merged? I still think it's worthwhile, if you don't mind me taking the changes.
@thekaveman go for it. did not mean to close this.
@johnclary if you'd like to resubmit I'll merge it in ASAP. If you'd rather not deal with, no problem I'll get it in.
Fixes #47.
I considering using geomet, which has robust functionality for WKT to geoJSON conversion. But our need here is so simple that I think we can get by with this solution:
shapely.geomtery.mapping
to convert shapely geometry object to geojson-like dictThe updated
to_feature()
method will handle shapleyPoint
andPolygon
classes. Multipolygon will break it.