You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Strictly speaking this isn't part of the OSM XML format, but it is part of Overpass output, a massive tool in the OSM world. And it massively simplifies working with OSM data.
Sometimes you don't actually care about the HD geometry in OSM, you just want the centroid. Overpass supports outputting the center of an object with out center;. eg:
(
node(id:1);
way(id:1324215931);
relation(id:12357726);
);
out center;
Outputs:
<?xml version="1.0" encoding="UTF-8"?>
<osmversion="0.6"generator="Overpass API 0.7.62.5 1bd436f1">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<metaosm_base="2025-02-26T09:51:01Z"/>
<nodeid="1"lat="42.7957187"lon="13.5690032">
<tagk="communication:microwave"v="yes"/>
<tagk="communication:radio"v="fm"/>
<tagk="description"v="Radio Subasio"/>
<tagk="frequency"v="105.5 MHz"/>
<tagk="man_made"v="mast"/>
<tagk="name"v="Monte Piselli - San Giacomo"/>
<tagk="note"v="This is the very first node on OpenStreetMap."/>
<tagk="tower:construction"v="lattice"/>
<tagk="tower:type"v="communication"/>
</node>
<wayid="1324215931">
<centerlat="33.1643506"lon="-95.2185702"/>
<ndref="12253775940"/>
<ndref="12253775939"/>
<ndref="12253775938"/>
<ndref="12253775935"/>
<ndref="12253775937"/>
<ndref="12253775936"/>
<ndref="12253775940"/>
<tagk="brand"v="Love's"/>
<tagk="brand:wikidata"v="Q1872496"/>
<tagk="hgv"v="yes"/>
<tagk="highway"v="services"/>
<tagk="name"v="Love's Travel Stop"/>
<tagk="website"v="https://www.loves.com/locations/279"/>
</way>
<relationid="12357726">
<centerlat="49.0068815"lon="8.4023387"/>
<membertype="way"ref="910369169"role="outer"/>
<membertype="way"ref="910369181"role="outer"/>
<tagk="amenity"v="fast_food"/>
<tagk="cuisine"v="pizza"/>
<tagk="level"v="1"/>
<tagk="name"v="La Pizza"/>
<tagk="toilets:wheelchair"v="yes"/>
<tagk="type"v="multipolygon"/>
<tagk="wheelchair"v="yes"/>
<tagk="wheelchair:description"v="Toiletten im Einkaufszentrum, Schlüssel nötig, gibt es für die, die (noch) keinen selbst haben, gegen Pfand bei der Information (Erdgeschoss)."/>
</relation>
</osm>
Notice the members and nodes aren't included, with only this file, it's not possible to build the OSM geometry. However instead we get center, where supported this means we don't have to mess around with multiple layers and multiple files.
I would like it if the OSM driver could read center.
Additional context
No response
The text was updated successfully, but these errors were encountered:
It seems to be possible to export GeoJSON from the site https://overpass-turbo.eu/ and GDAL can naturally read it. If I understand it right overpass-turbo does not support natively GeoJSON output but some external library is used.
It may be best to read the "no hurry" to mean that it will not happen within the regular GDAL maintenance work. Pull Requests and contracted development could be an option, but myself I would consider integrating osmtogeojson into your workflow https://tyrasd.github.io/[osmtogeojson](https://tyrasd.github.io/osmtogeojson/)/. It seems to work fine.
Feature description
Strictly speaking this isn't part of the OSM XML format, but it is part of Overpass output, a massive tool in the OSM world. And it massively simplifies working with OSM data.
Sometimes you don't actually care about the HD geometry in OSM, you just want the centroid. Overpass supports outputting the center of an object with
out center;
. eg:Outputs:
Notice the members and nodes aren't included, with only this file, it's not possible to build the OSM geometry. However instead we get
center
, where supported this means we don't have to mess around with multiple layers and multiple files.I would like it if the OSM driver could read
center
.Additional context
No response
The text was updated successfully, but these errors were encountered: