-
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
Is it possible to search objects in a changeset ? #162
Comments
First of all: filtering on or querying of changesets is not possible at this time. Maybe you should check out achavi, which works with a combination of OSM main db and overpass: Example: http://nrenner.github.io/achavi/?changeset=27183569 Step 1: Request Changeset metadata http://www.openstreetmap.org/api/0.6/changeset/27183569 Result: <?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="OpenStreetMap server" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
<changeset id="27183569" user="FahRadler" uid="344561" created_at="2014-12-02T16:36:28Z" closed_at="2014-12-02T17:40:02Z" open="false" min_lat="49.2351097" min_lon="6.7306185" max_lat="49.2734277" max_lon="6.7979623" comments_count="0">
<tag k="source" v="Bing"/>
<tag k="created_by" v="JOSM/1.5 (7643 de)"/>
<tag k="comment" v="Addition from Bing / Fieldwork"/>
</changeset>
</osm> Step 2: Use changeset metadata to request changes in bbox in this timeframe bbox -> 6.7306185,49.2351097,6.7979623,49.2734277 I believe this is not 100% accurate if some other user happens to do some changes in the same timeframe/bbox, as overpass will only return the last change in that timeframe. Maybe @nrenner can comment on this? In addition to that, @drolbr is also working on tool support in this area iirc, but this is not yet (officially) available. |
Thanks 😄
But technically it is possible with date settings ? So maybe Roland could implement search by chanegeset in the future ?
|
The problem with date is, that a changeset usually covers a timeframe of several seconds to hours with a number of changes (could be up to 2000 iirc). Date however looks at a point in time only. Details for a single changeset are already provided by the main api: example http://www.openstreetmap.org/api/0.6/changeset/27183569/download (takes a while to load). I still don't know what your use case is, could you elaborate a bit more, giving some more concrete examples? |
Step 3 in achavi is to filter the result by the changeset id, including referenced objects.
You're right, this does not really work when an object is modified by multiple changesets in the same timeframe/bbox. Don't know how often this actually occurs and what to do about it. |
I have made a changeset that was reversed. I would like to get the iDs of theses objects to build some queries : how many objects by country with tags xx=yy, and so on… I could do that with JOSM (with the reverse changeset plugin) but I prefer to make a query with Overpass turbo (see map and see datas in XML without the risk to alter them). |
Would be possible to filter objects by changeset id? Similar to user or type filter:
This data is available for overpass, returns with objects. Related to #189. |
There is now the evaluator changeset that solves part of the problem. |
It seems as if the changeset evaluator won’t return deleted objects in the adiff case. |
I think such metadata filters (like also user/uid) don't make sense with adiff (when applied at both timestamps). The whole diff doesn't work with <action type="modify">
<old>
<node id="1695993595" version="1" timestamp="2012-03-29T10:41:41Z" changeset="11135386" uid="641152" user="Gui!"/>
</old>
<new>
<node id="1695993595" lat="48.9900248" lon="2.3607126" version="2" timestamp="2019-01-01T22:48:52Z" changeset="65944681" uid="6590084" user="jean-normandie">
<tag k="amenity" v="restaurant"/>
<tag k="cuisine" v="italian"/>
<tag k="name" v="Pizza Hut"/>
</node>
</new>
</action> Actually, I thought action type create would be returned when the query doesn't match at the start timestamp. Has this changed or am I confusing things? |
Very good point. I think I was tricked by the NB: I had to change (if:changeset() == ...) to a tag query, as the query wouldn't run on 0.7.54 otherwise. Query
0.7.54: (//dev.overpass-api.de/api_drolbr/)<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Overpass API 0.7.54.13 ff15392f">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<meta osm_base="2019-01-03T15:02:02Z"/>
<bounds minlat="48.9900248" minlon="2.3607126" maxlat="48.9900248" maxlon="2.3607126"/>
<action type="create">
<node id="1695993595" lat="48.9900248" lon="2.3607126" version="2" timestamp="2019-01-01T22:48:52Z" changeset="65944681" uid="6590084" user="jean-normandie">
<tag k="amenity" v="restaurant"/>
<tag k="cuisine" v="italian"/>
<tag k="name" v="Pizza Hut"/>
</node>
</action>
</osm> 0.7.55: (//lz4.overpass-api.de/api/)<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Overpass API 0.7.55.5 2ca3f387">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<meta osm_base="2019-01-03T15:07:02Z"/>
<bounds minlat="48.9900248" minlon="2.3607126" maxlat="48.9900248" maxlon="2.3607126"/>
<action type="modify">
<old>
<node id="1695993595" version="1" timestamp="2012-03-29T10:41:41Z" changeset="11135386" uid="641152" user="Gui!"/>
</old>
<new>
<node id="1695993595" lat="48.9900248" lon="2.3607126" version="2" timestamp="2019-01-01T22:48:52Z" changeset="65944681" uid="6590084" user="jean-normandie">
<tag k="amenity" v="restaurant"/>
<tag k="cuisine" v="italian"/>
<tag k="name" v="Pizza Hut"/>
</node>
</new>
</action>
</osm>
|
I would like to search all or some object in a changeset.
Is it possible with Overpass ?
The text was updated successfully, but these errors were encountered: