[talk-au] Waterway data check overpass query

Phil Wyatt phil at wyatt-family.com
Wed May 10 00:17:51 UTC 2023


Many thanks for this Andrew,

Not being a coder, I asked ChatGPT if it could convert this to output the geometry (so I could pull it into ID editor easily via gpx) and it responded with this...

[out:json][timeout:900];
area["ISO3166-2"="AU-VIC"]->.a;
relation["type"="waterway"](area.a);
foreach -> .rel {
  way(r.rel)(if:t["name"] != rel.u(t["name"]));
  (._;>;);
  out body;
}


This seems to give a similar number of ways so hopefully its correct.

So useful for finding errors

Cheers - Phil

-----Original Message-----
From: Andrew Davidson <theswavu at gmail.com> 
Sent: Tuesday, May 9, 2023 7:51 PM
To: talk-au at openstreetmap.org
Subject: Re: [talk-au] Waterway data check overpass query

On 8/5/23 19:59, Little Maps wrote:
> Hi all, does anyone know if it’s possible to use Overpass Turbo or another tool to find waterway ways for which the way has a different name to the relation that the way is a part of? As an example, imagine that the relation for Ovens River includes a way called Castle Creek. Can this be found? I’ve been data checking river relations and can’t work out how to make a query that would detect this issue. Many thanks for your help, Ian

https://overpass-turbo.eu/s/1uIC

Which should be this code:

[timeout:900][out:csv(way_id,riv_name,rel_id,rel_name;true;",")];
area["ISO3166-2"="AU-VIC"]->.a;
relation["type"="waterway"](area.a);
foreach -> .rel(

   way(r.rel)(if:t["name"] != rel.u(t["name"]))->.ways;

   foreach .ways -> .reach (
     convert object way_id = reach.u(id()),
                             riv_name = reach.u(t["name"]),
                             rel_id = rel.u(id()),
                             rel_name = rel.u(t["name"]);
     out;

     );
);


_______________________________________________
Talk-au mailing list
Talk-au at openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-au




More information about the Talk-au mailing list