Skip to content
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

Could we get (perhaps computed) center coordinates for all elements? #70

Open
mcepl opened this issue Nov 18, 2022 · 1 comment
Open

Comments

@mcepl
Copy link

mcepl commented Nov 18, 2022

For example:

from OSMPythonTools.api import Api
api = Api()
way = api.query('relation/3629242')
way.centerLat()
way.centerLon()

I understand that it is probably not trivial and some computation would have to be done in the background, but either remove those methods when they cannot be filled with some meaningful data or compute the result?

@mcepl
Copy link
Author

mcepl commented Dec 7, 2022

The same in more detailed example:

import urllib.parse
from OSMPythonTools.api import Api

orig_url = "https://www.openstreetmap.org/way/30722274#map=14/49.2925/38.1815"
parsed_url = urllib.parse.urlparse(orig_url)

api = Api()
way = api.query(parsed_url.path)
print(way.centerLon(), way.centerLat())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant