Overpass-API icon indicating copy to clipboard operation
Overpass-API copied to clipboard

adiff created behavior changed in 0.7.55

Open mmd-osm opened this issue 7 years ago • 1 comments

As @nrenner pointed out in #162, adiff behavior changed between 0.7.54 and 0.7.55. In 0.7.54, non existing elements in the "since" version triggered a <create> element, while 0.7.55 produces a <modify> element along with some bogus "old" version data (lacking tags, etc.).

Was this change deliberate or is this some kind of bug?

Query

[bbox:48.9900248,2.3607126,48.9900248,2.3607126]
[adiff:"2019-01-01T22:48:51Z","2019-01-01T22:48:52Z"];
node[cuisine];
out meta geom;

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>

mmd-osm avatar Jan 03 '19 15:01 mmd-osm

Well, this is for the adiff intentional: The result tells you that the object existed before but would not have been a result of the query. This is symmtrical to the situation in the delete case.

The rationale is to avoid that an object can be returned as "created" multiple times - if it stopped to match a query and then later again matched that query.

Of course, it is worth a discussion what a more comprehensive lifecycle should look like. For the moment being I would classify this as "task" and keep it open to figure out what consumers really need.

drolbr avatar Mar 21 '19 17:03 drolbr