-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Center attribute missing on OSM entities #3
Comments
Interesting, thanks for bringing this up. I'm not sure about a good way of handling this. |
@sebkur I was already able to mimic such behaviour by creating derived classes of the handlers and such from the OSM4J library... I will probably fork this project, implement this functionality and then create a pull request to add it into the main repo. I need this functionality for something that I am working on (which works closely with OSM and Overpass). |
my only worry is that this is a bit non-standard, i.e. the center element is not really an OSM api but something overpass-specific. If there should be more of those, it could clutter the API a bit. But not sure this is a concern we should be worried about. Does overpass also support this center element for relations? does it also support other non-standard extensions of the data types? |
OK, I just checked, the |
Sorry for the delayed response; Yes it is present on any type of OSM element and represents the interior point coordinates of that element. |
The "center" attribute that sometime is received from an Overpass response is missing in the implementation of the osm4j parsers (especially XML parser).
The center attribute belongs to ways/relations and looks something like this:
<center lat="46.2965728" lon="8.7908617"/>
Example of a whole tag (including center attribute):
<way id="458341945" version="2" timestamp="2021-04-26T18:48:09Z" changeset="103656292" uid="74900" user="FischersFritz"> <center lat="46.2965728" lon="8.7908617"/> <nd ref="4543689513"/> <nd ref="8669512158"/> <nd ref="8669512156"/> <nd ref="8669512155"/> <nd ref="8669512157"/> <nd ref="4543689514"/> <nd ref="8669512151"/> <nd ref="8669512149"/> <nd ref="8669512148"/> <nd ref="8669512150"/> <nd ref="4543689515"/> <nd ref="8669512146"/> <nd ref="8669512145"/> <nd ref="8669512144"/> <nd ref="8669512147"/> <nd ref="4543689516"/> <nd ref="8669512154"/> <nd ref="8669512153"/> <nd ref="8669512152"/> <nd ref="8669512159"/> <nd ref="4543689513"/> <tag k="building" v="yes"/> <tag k="castle_type" v="palace"/> <tag k="historic" v="castle"/> <tag k="name" v="Castello Marcacci"/> </way>
The text was updated successfully, but these errors were encountered: