mocnik-science / osm-python-tools

A library to access OpenStreetMap related services
GNU General Public License v3.0
441 stars 48 forks source link

Missing recently edited ways in results #33

Closed masfaraud closed 3 years ago

masfaraud commented 3 years ago

Doing:

query = overpassQueryBuilder(area=3600007407, elementType='way',    selector='"railway"="rail"', out='body')
a=overpass.query(query)

len(a.ways())
Out[30]: 751

len(a.elements())
Out[28]: 751

but doing on http://overpass-api.de/query_form.html way(area:3600007407)[railway=rail]; out count;

<count id="0">
    <tag k="nodes" v="0"/>
    <tag k="ways" v="764"/>
    <tag k="relations" v="0"/>
    <tag k="areas" v="0"/>
    <tag k="total" v="764"/>
  </count>

overpy also gives 764 elements.

It seems that missing ways were recently modified like 852538015: https://www.openstreetmap.org/way/852538015 edited 3 month ago

Do you have any idea ?

masfaraud commented 3 years ago

Making the query without double quotes works.

query = overpassQueryBuilder(area=3600007407, elementType='way',    selector='railway=rail', out='body')
mocnik-science commented 3 years ago

Yes, feel free to provide it without double quotes. This syntax is defined by the Overpass language. The overpassQueryBuilder actually assembles a command in the Overpass language, which is then submitted to the Overpass server. The Overpass language seems to specify that tags can be provided without double quotes. If you think this issue is solved, feel free to close it. Thanks!

masfaraud commented 3 years ago

Yes, but maybe the doc needs an update because it was adapted from a copy/paste from doc

mocnik-science commented 3 years ago

Dear @masfaraud,

The Overpass language seems to allow selectors to be specified with and without quotation marks. I have tested your example again, and it returns the same number of elements independent of whether quotation marks are used or not.

Also, I tried to find where the documentation is wrong. I could not find what you are referring to. Yes, I use quotation marks in the documentation, because this seems to make it easier to understand and is in line with most examples of the Overpass language documentation. In case, there should be some error or ambiguous part in in the documentation, please let me know. I would appreciate if you could name the filename and the line of the part in question, because this makes it easier for me to identify the issue.

Thanks again for your comments here.