-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for geojson.io #78
Comments
p.s. I just realized that this issue actually touches any case where the users providers
Imo the API should return a 400 if it receives an malformed geojson but (from what I can tell) it seems to be returning a 200. sat-search/satsearch/search.py Line 83 in d81e477
|
Thanks for the issue @samsammurphy . Yes, there should at least be a better error message if the geometry is ill-formed. But I also agree a FeatureCollection should also be supported, but I'm not sure how the best way is to do it. Should it use the first feature? Should it combine all the geometries together as a list of MultiPolygons (or MultiPoint or MultiLineString), in which case it should find any Items that intersect with any of the Features. To make it general, I'd say that all Features should be appended to each other, although the common use case is for a single Feature I think. |
Good point @matthewhanson, I agree, appending Features together (if there are more than one) actually seems to be a better way to go. |
I was inspired by this medium post and excited to produce a beautiful search calendar..
sat-search search --intersects aoi.geojson --datetime 2018-01-01/2018-03-30 -p "eo:cloud_cover<10" --save aoi-results.geojson --print-cal
Obviously, I need my very own geojson file to run this search. My intuition tells me that "geojson.io is a safe way to produce valid geojson, that will work for sure"
However, I got this surprising error message
I looked into the dictionary from the offending line
sat-search/satsearch/search.py
Line 75 in d81e477
using this code
which told me that
This provided me the clue I needed! The server was expecting a feature or geometry.
However, geojson.io saves to FeatureCollection. I manually extracted my single feature from the FeatureCollection and all worked out just fine.
One way to provide better integration with geojson.io output might be to check for FeatureCollections with a single features in them and let that slide (i.e. silently extract the feature) but return an error message if a user passes a FeatureCollection with multiple features in it.
The text was updated successfully, but these errors were encountered: