Re: [talk-au] Waterway data check overpass query

2023-05-09 Thread stevea
Nice work, everbody.  I include Phil's use of the tool (chatbot mentioned), but 
I do not directly address said chatbot, because it is not sentient.  It is 
merely a tool, well-used in this instance.

Tight snippet of OT there, Andrew; nice.  (make, convert, makefile, 
y'know...yeah).

Is that a light clapping sound / round of applause I hear?
___
Talk-au mailing list
Talk-au@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-au


Re: [talk-au] Waterway data check overpass query

2023-05-09 Thread Phil Wyatt
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  
Sent: Tuesday, May 9, 2023 7:51 PM
To: talk-au@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@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-au


___
Talk-au mailing list
Talk-au@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-au


Re: [talk-au] Waterway data check overpass query

2023-05-09 Thread Andrew Davidson
I had a read of the wiki page on waterway relations and it seems that
you can put in unnamed tributaries (if they have a name they go in a
different relation).

This version will filter out those https://overpass-turbo.eu/s/1uJc

On Tue, May 9, 2023 at 8:31 PM Little Maps  wrote:
>

___
Talk-au mailing list
Talk-au@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-au


Re: [talk-au] Waterway data check overpass query

2023-05-09 Thread Little Maps
Aah, you’re a genius Andrew, there’s no way I could have written that query! 
Thanks heaps, Ian

> On 9 May 2023, at 8:09 pm, Andrew Davidson  wrote:
> 
> On 9/5/23 19:51, Andrew Davidson wrote:
>> 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;
> 
> Apologies, I should have used make rather than convert. The corrected version 
> is here https://overpass-turbo.eu/s/1uIF
> 
> 
> ___
> Talk-au mailing list
> Talk-au@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/talk-au

___
Talk-au mailing list
Talk-au@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-au


Re: [talk-au] Waterway data check overpass query

2023-05-09 Thread Andrew Davidson

On 9/5/23 19:51, Andrew Davidson wrote:


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;


Apologies, I should have used make rather than convert. The corrected 
version is here https://overpass-turbo.eu/s/1uIF



___
Talk-au mailing list
Talk-au@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-au


Re: [talk-au] Waterway data check overpass query

2023-05-09 Thread Andrew Davidson

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@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-au


Re: [talk-au] Waterway data check overpass query

2023-05-08 Thread Little Maps

Sorry all for dodgy message above, not sure what happened there. Thanks Phil, 
that works fine but I was hoping for a tool I could use across large areas. 
I’ve used a series of overpass queries to do things like display all waterways 
in Vic named river that are in a relation, show those that aren’t, and overlaid 
ways and relations in different colors, etc, which show various anomalies that 
I’ve then checked and fixed where needed. The most common issues were probably 
relations that were much shorter than named ways (extra ways were probably 
added and named more recently) and the inclusion of creeks and rivers with 
different names in some relations, especially in headwaters but some flotsam 
and jetsam that was probably left over when relations were edited in the past. 
Just as I was about to turn the laptop off tonight I found the example below, 
where the relation for the Thomson River in Gippsland follows another creek for 
a long stretch SW of Heyfield. I’ll fix this tomorrow. If there was a simple 
way to display all ways in a relation that had a different name to the 
relation, it’d be a really useful tool. Thanks again, cheers Ian

https://www.openstreetmap.org/relation/2211661#map=12/-38.0079/146.7550

___
Talk-au mailing list
Talk-au@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-au


Re: [talk-au] Waterway data check overpass query

2023-05-08 Thread Little Maps
Thanks Phil, yes, this works fine on individual relations but I was hoping to find a tool that works across much larger areas, statewide preferably. I’ve done a series of overpass queries across Vic for all waterways with river in their name, including things like find all river ways that are in relations, those that aren’t in relations, overlaying waterway ways and relations in different colors, and more, each of which has been useful. The most common issues were probably relations that were shorter than named ways, and to a lesser extent, relations that included sections of other rivers or creeks (esp in headwaters but also some flotsam and jetsam). I’ve found the latter by looking for strange color patterns in the overpass outputs, but I’m sure I’ve missed lots. Just as I was about to close the laptop today I found the example below (which I’ll fix next time) where the relation for the Thomson River follows another creek for a long stretch, just west of Heyfield. If there was a way to search for all relations that contains ways with a different name, it’d be fantastic. Thanks again, IanRelation: ‪Thomson River‬ (‪2211661‬)openstreetmap.org___
Talk-au mailing list
Talk-au@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-au


Re: [talk-au] Waterway data check overpass query

2023-05-08 Thread Phil Wyatt
Hi Little Maps,

One simple way would be just to look at the members in a relation

https://www.openstreetmap.org/relation/2181945#map=9/-36.4017/146.8309

but I assume you want to do this on a much larger scale?

What have you tried so far and what were the results?

Cheers - Phil

-Original Message-
From: Little Maps  
Sent: Monday, May 8, 2023 7:59 PM
To: OSM Aust Discussion List 
Subject: [talk-au] Waterway data check overpass query

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

___
Talk-au mailing list
Talk-au@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-au


___
Talk-au mailing list
Talk-au@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-au


[talk-au] Waterway data check overpass query

2023-05-08 Thread Little Maps
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

___
Talk-au mailing list
Talk-au@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-au