2

I'm trying to find all rivers with a name containing specific word (or part of it). F. ex. all 'Danube-' rivers, or 'Danu-', 'Dan-' and so. In another topic I've found useful query, which after example modification looks like this:

<osm-script output="xml" timeout="250">
<union>
    <query type="nwr">
        <has-kv k="river"/>
        <has-kv k="name" regv="Danube(.*)"/>
        <bbox-query {{bbox}}/>
    </query>
</union>
<print mode="body"/>

and it finds nothing.

I tried also this:

<osm-script output="xml" timeout="250">
<union>
    <query type="nwr">
        
        <has-kv k="name" regv="Danube(.*)"/>
        <bbox-query {{bbox}}/>
    </query>
</union>
<print mode="body"/>

and it will find all 'Danube' restaurants and hotels, but not the river itself.

Can someone explain to me how to find also rivers (lines)? I need it for my historical research (toponymy). I might add I'm not great at coding.

Edit: Danube was just an example. I don't need Danube itself, but other rivers and wild card is a must.

I'll give you better example - I'm searching for the 'Stob-' rivers and I need query which will find rivers like 'Stob-nica', 'Stob-ianka' and 'Stob-niczanka' and others 'Stob-' rivers whose suffixes I don't know. Can't do that without wild card.

2 Answers 2

1

Be careful, the key name is using the local language. So in Germany, it's written Donau and not Danube. So your regular expression needs to be more complexe and you would need to check all names.

Example in Germany: https://www.openstreetmap.org/way/203099955

Instead of looking for the name "Danube", I would use the relation ID of the river :

  • go on OpenStreetMap.org website
  • Use the Query features tool and click on the Danube itself.
  • It will show you that the river belongs to a OSM relation ID 89652

This is the link to the Danube relation: https://www.openstreetmap.org/relation/89652

Use QuickOSM to download this relation by writing in the query tab:

<osm-script>
  <id-query ref="89652" type="relation"/>
  <union>
    <item/>
    <recurse type="down"/>
  </union>
  <print/>
</osm-script>

This will give you the river, no using wild cards which might be wrong.

Note, the relation should be complete in OSM to use this technique. You might have a look to the relation in JOSM or in QGIS to detect gaps.

1
  • Thanks for your answer, however 'Danube' was just an example and not very fitting I guess. I've edited my main question to clarify my problem. Jul 15, 2020 at 11:18
0

Ok, I've made it:

[out:xml][timeout:250];(way["name"~"Stob(.*)"]["waterway"]({{bbox}}););out body;>;out skel qt;

It will find all 'Stob-' rivers like 'Stobxyz', 'Stobzyx' and so. Works like a charm:-)

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.