-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Behavior of "out geom" #106
Comments
This example seems to run fine. Make sure you have the latest version of the module. Just a few pointers if I may:
|
But sorry, it runs fine but has duplicate geometry: Geometry I
Geometry II
|
That is because you use
gets you
I updated the code in the repl as well. |
Does it work for you now @uswoods ? |
Actually I would like to use the output for calculating the area of the way:
But this doesn't work due to the FeatureCollection. Do you any trick for unwinding this in python? |
import overpass
from shapely.geometry import shape, Polygon
api = overpass.API()
query = 'way(45667934);'
result = api.get(query, verbosity='geom')
linestring = shape(result.features[0].geometry)
poly = Polygon(linestring)
print(poly.area) |
Thanks for the solution. But there is something weird: According to JOSMs measurement plugin BASF Antwerp has a size of 606 hectares. Shapely gives 609 after projecting. |
@mvexel When I query for a multipolygon, the output FeatureCollection is empty:
|
Relations are not supported in |
@mvexel I've now patched my local overpass version that relations do indeed work thanks to @t-g-williams work. The polygon itself could be read by Shapely, but it's complaining due to the FeatureCollection. How can I remove the FeatureCollection from the GeoJSON's "DOM tree"? (Where should I better ask this question? On StackOverflow it was deleted) |
When I don't use out geom I'm getting an error (see below), but when I use it, the json output is duplicated. Am I utilizing the option in a wrong matter?
Error:
The text was updated successfully, but these errors were encountered: