Overpass API to get all amenities?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Overpass API to get all amenities?

Tac Tacelosky
I'd like to get all nodes and ways within a bounding box that have any amenity tags.  I think the Overpass API is the best way to go, but the filtering seems to be for a specific amenity, e.g. k="amenity" and v="restaurant".  I tried "*", but that didn't work.

Any suggestions on how to get all nodes and ways via an API call that are tagged accordingly?

Thanks,

Tac


_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies
Reply | Threaded
Open this post in threaded view
|

Re: Overpass API to get all amenities?

Richard Welty-2
On 5/3/13 2:59 PM, Tac Tacelosky wrote:
> I'd like to get all nodes and ways within a bounding box that have any
> amenity tags.  I think the Overpass API is the best way to go, but the
> filtering seems to be for a specific amenity, e.g. k="amenity" and
> v="restaurant".  I tried "*", but that didn't work.
>
> Any suggestions on how to get all nodes and ways via an API call that are
> tagged accordingly?
>
try this:

   <has-kv k="amenity" regv="." />

richard


_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies
Reply | Threaded
Open this post in threaded view
|

Re: Overpass API to get all amenities?

Tac Tacelosky
Thanks!

Tac


On Fri, May 3, 2013 at 3:06 PM, Richard Welty <[hidden email]> wrote:
On 5/3/13 2:59 PM, Tac Tacelosky wrote:
I'd like to get all nodes and ways within a bounding box that have any
amenity tags.  I think the Overpass API is the best way to go, but the
filtering seems to be for a specific amenity, e.g. k="amenity" and
v="restaurant".  I tried "*", but that didn't work.

Any suggestions on how to get all nodes and ways via an API call that are
tagged accordingly?

try this:

  <has-kv k="amenity" regv="." />

richard


_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies


_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies
Reply | Threaded
Open this post in threaded view
|

Re: Overpass API to get all amenities?

Tac Tacelosky
In reply to this post by Richard Welty-2
Thanks, Richard.  

I've put that into a union query, and now I'm getting all the ways and nodes that are marked with as having an amenity.

But the ways can't be displayed without their associated notes, which are often just points.  Is there a way to say "Any nodes marked with amenity, plus any ways marked as amenity and their associated nodes".

Would that be using "recurse"?  I can't quite grasp the syntax.  Any suggestions?

Thanks,

Tac



On Fri, May 3, 2013 at 3:06 PM, Richard Welty <[hidden email]> wrote:
On 5/3/13 2:59 PM, Tac Tacelosky wrote:
I'd like to get all nodes and ways within a bounding box that have any
amenity tags.  I think the Overpass API is the best way to go, but the
filtering seems to be for a specific amenity, e.g. k="amenity" and
v="restaurant".  I tried "*", but that didn't work.

Any suggestions on how to get all nodes and ways via an API call that are
tagged accordingly?

try this:

  <has-kv k="amenity" regv="." />

richard


_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies


_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies
Reply | Threaded
Open this post in threaded view
|

Re: Overpass API to get all amenities?

Tac Tacelosky
I thought I found a solution to get all the ways and nodes with an 'amenity' tag, plus the nodes that make up the way, with this:

<osm-script>
<union>
<query type="way">
  <has-kv k="amenity" regv="."/>
  <bbox-query s="%s" w="%s" n="%s" e="%s"/>
</query>

<query type="node">
  <has-kv k="amenity" regv="."/>
  <bbox-query s="%s" w="%s" n="%s" e="%s"/>
</query>
</union>
<recurse type="way-node" />
<print/></osm-script> 

Alas, that doesn't work.  I've tried with the recurse tag inside the union tag, and throw an item tag around, but I'm still not getting it.  Can someone point me in the right direction?

Thanks,

Tac


On Mon, May 6, 2013 at 7:03 PM, Tac Tacelosky <[hidden email]> wrote:
Thanks, Richard.  

I've put that into a union query, and now I'm getting all the ways and nodes that are marked with as having an amenity.

But the ways can't be displayed without their associated notes, which are often just points.  Is there a way to say "Any nodes marked with amenity, plus any ways marked as amenity and their associated nodes".

Would that be using "recurse"?  I can't quite grasp the syntax.  Any suggestions?

Thanks,

Tac



On Fri, May 3, 2013 at 3:06 PM, Richard Welty <[hidden email]> wrote:
On 5/3/13 2:59 PM, Tac Tacelosky wrote:
I'd like to get all nodes and ways within a bounding box that have any
amenity tags.  I think the Overpass API is the best way to go, but the
filtering seems to be for a specific amenity, e.g. k="amenity" and
v="restaurant".  I tried "*", but that didn't work.

Any suggestions on how to get all nodes and ways via an API call that are
tagged accordingly?

try this:

  <has-kv k="amenity" regv="." />

richard


_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies



_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies
Reply | Threaded
Open this post in threaded view
|

Re: Overpass API to get all amenities?

Richard Welty-2
i know this will only make things worse, but it's possible for amenity tags
to appear on relations as well.

richard

On 5/15/13 2:50 PM, Tac Tacelosky wrote:
I thought I found a solution to get all the ways and nodes with an
'amenity' tag, plus the nodes that make up the way, with this:

<osm-script>
<union>
<query type="way">
  <has-kv k="amenity" regv="."/>
  <bbox-query s="%s" w="%s" n="%s" e="%s"/>
</query>

<query type="node">
  <has-kv k="amenity" regv="."/>
  <bbox-query s="%s" w="%s" n="%s" e="%s"/>
</query>
</union>
<recurse type="way-node" />
<print/></osm-script>

Alas, that doesn't work.  I've tried with the recurse tag inside the union
tag, and throw an item tag around, but I'm still not getting it.  Can
someone point me in the right direction?

Thanks,

Tac


On Mon, May 6, 2013 at 7:03 PM, Tac Tacelosky [hidden email] wrote:

Thanks, Richard.

I've put that into a union query, and now I'm getting all the ways and
nodes that are marked with as having an amenity.

But the ways can't be displayed without their associated notes, which are
often just points.  Is there a way to say "Any nodes marked with amenity,
plus any ways marked as amenity and their associated nodes".

Would that be using "recurse"?  I can't quite grasp the syntax.  Any
suggestions?

Thanks,

Tac



On Fri, May 3, 2013 at 3:06 PM, Richard Welty [hidden email]wrote:

On 5/3/13 2:59 PM, Tac Tacelosky wrote:

I'd like to get all nodes and ways within a bounding box that have any
amenity tags.  I think the Overpass API is the best way to go, but the
filtering seems to be for a specific amenity, e.g. k="amenity" and
v="restaurant".  I tried "*", but that didn't work.

Any suggestions on how to get all nodes and ways via an API call that are
tagged accordingly?

 try this:
  <has-kv k="amenity" regv="." />

richard


______________________________**_________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.**org/listinfo/newbies<http://lists.openstreetmap.org/listinfo/newbies>



      

_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies


_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies
Reply | Threaded
Open this post in threaded view
|

Re: Overpass API to get all amenities?

Jo-2
In reply to this post by Tac Tacelosky
Can you try with this:

<osm-script>
<union>
<query type="node">
  <has-kv k="amenity"/>
  <bbox-query s="50.852" w="4.359" n="50.854" e="4.364"/>
</query>
<query type="way">
  <has-kv k="amenity"/>
  <bbox-query s="50.852" w="4.359" n="50.854" e="4.364"/>
</query>
<recurse type="way-node" />
</union>
<print/>
</osm-script>

I tested it, but now the %s are replaced...

Cheers,

Jo


2013/5/15 Tac Tacelosky <[hidden email]>
I thought I found a solution to get all the ways and nodes with an 'amenity' tag, plus the nodes that make up the way, with this:

<osm-script>
<union>
<query type="way">
  <has-kv k="amenity" regv="."/>
  <bbox-query s="%s" w="%s" n="%s" e="%s"/>
</query>

<query type="node">
  <has-kv k="amenity" regv="."/>
  <bbox-query s="%s" w="%s" n="%s" e="%s"/>
</query>
</union>
<recurse type="way-node" />
<print/></osm-script> 

Alas, that doesn't work.  I've tried with the recurse tag inside the union tag, and throw an item tag around, but I'm still not getting it.  Can someone point me in the right direction?

Thanks,

Tac


On Mon, May 6, 2013 at 7:03 PM, Tac Tacelosky <[hidden email]> wrote:
Thanks, Richard.  

I've put that into a union query, and now I'm getting all the ways and nodes that are marked with as having an amenity.

But the ways can't be displayed without their associated notes, which are often just points.  Is there a way to say "Any nodes marked with amenity, plus any ways marked as amenity and their associated nodes".

Would that be using "recurse"?  I can't quite grasp the syntax.  Any suggestions?

Thanks,

Tac



On Fri, May 3, 2013 at 3:06 PM, Richard Welty <[hidden email]> wrote:
On 5/3/13 2:59 PM, Tac Tacelosky wrote:
I'd like to get all nodes and ways within a bounding box that have any
amenity tags.  I think the Overpass API is the best way to go, but the
filtering seems to be for a specific amenity, e.g. k="amenity" and
v="restaurant".  I tried "*", but that didn't work.

Any suggestions on how to get all nodes and ways via an API call that are
tagged accordingly?

try this:

  <has-kv k="amenity" regv="." />

richard


_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies



_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies



_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies
Reply | Threaded
Open this post in threaded view
|

Re: Overpass API to get all amenities?

Tac Tacelosky
Yep, yours works, mine doesn't.  Here's mine, along with a link:

<?xml version="1.0" encoding="UTF-8" ?><osm-script>
<union>
<query type="way">
  <has-kv k="amenity"/>
  <bbox-query s="39.01784900" w="-76.92662000" n="39.05015900" e="-76.89787300"/>
</query>

<query type="node">
  <has-kv k="amenity"/>
  <bbox-query s="39.01784900" w="-76.92662000" n="39.05015900" e="-76.89787300"/>
</query>
<recurse type="way-node" />
</union>
<print/></osm-script>



All of the ways are missing their related nodes.

Thanks,

Tac


On Wed, May 15, 2013 at 4:32 PM, Jo <[hidden email]> wrote:
Can you try with this:

<osm-script>
<union>
<query type="node">
  <has-kv k="amenity"/>
  <bbox-query s="50.852" w="4.359" n="50.854" e="4.364"/>
</query>
<query type="way">
  <has-kv k="amenity"/>
  <bbox-query s="50.852" w="4.359" n="50.854" e="4.364"/>
</query>
<recurse type="way-node" />
</union>
<print/>
</osm-script>

I tested it, but now the %s are replaced...

Cheers,

Jo



2013/5/15 Tac Tacelosky <[hidden email]>
I thought I found a solution to get all the ways and nodes with an 'amenity' tag, plus the nodes that make up the way, with this:

<osm-script>
<union>
<query type="way">
  <has-kv k="amenity" regv="."/>
  <bbox-query s="%s" w="%s" n="%s" e="%s"/>
</query>

<query type="node">
  <has-kv k="amenity" regv="."/>
  <bbox-query s="%s" w="%s" n="%s" e="%s"/>
</query>
</union>
<recurse type="way-node" />
<print/></osm-script> 

Alas, that doesn't work.  I've tried with the recurse tag inside the union tag, and throw an item tag around, but I'm still not getting it.  Can someone point me in the right direction?

Thanks,

Tac


On Mon, May 6, 2013 at 7:03 PM, Tac Tacelosky <[hidden email]> wrote:
Thanks, Richard.  

I've put that into a union query, and now I'm getting all the ways and nodes that are marked with as having an amenity.

But the ways can't be displayed without their associated notes, which are often just points.  Is there a way to say "Any nodes marked with amenity, plus any ways marked as amenity and their associated nodes".

Would that be using "recurse"?  I can't quite grasp the syntax.  Any suggestions?

Thanks,

Tac



On Fri, May 3, 2013 at 3:06 PM, Richard Welty <[hidden email]> wrote:
On 5/3/13 2:59 PM, Tac Tacelosky wrote:
I'd like to get all nodes and ways within a bounding box that have any
amenity tags.  I think the Overpass API is the best way to go, but the
filtering seems to be for a specific amenity, e.g. k="amenity" and
v="restaurant".  I tried "*", but that didn't work.

Any suggestions on how to get all nodes and ways via an API call that are
tagged accordingly?

try this:

  <has-kv k="amenity" regv="." />

richard


_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies



_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies



_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies



_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies
Reply | Threaded
Open this post in threaded view
|

Re: Overpass API to get all amenities?

Tac Tacelosky
Jo explained to me off-list that the order of commands is critical, and my problem would be solved by reversing the two queries.  So for the archives, here's the correct answer:

<?xml version="1.0" encoding="UTF-8" ?><osm-script>
<union>
<query type="node">
  <has-kv k="amenity"/>
  <bbox-query s="38.91075100" w="-77.04882000" n="38.91265100" e="-77.02414700"/>
</query>
<query type="way">
  <has-kv k="amenity"/>
  <bbox-query s="38.91075100" w="-77.04882000" n="38.91265100" e="-77.02414700"/>
</query>

<recurse type="way-node" />
</union>
<print/></osm-script>

Thanks, Jo!

Tac


On Wed, May 15, 2013 at 5:14 PM, Tac Tacelosky <[hidden email]> wrote:
Yep, yours works, mine doesn't.  Here's mine, along with a link:

<?xml version="1.0" encoding="UTF-8" ?><osm-script>
<union>
<query type="way">
  <has-kv k="amenity"/>
  <bbox-query s="39.01784900" w="-<a href="tel:76.92662000" value="+17692662000" target="_blank">76.92662000" n="39.05015900" e="-76.89787300"/>
</query>

<query type="node">
  <has-kv k="amenity"/>
  <bbox-query s="39.01784900" w="-<a href="tel:76.92662000" value="+17692662000" target="_blank">76.92662000" n="39.05015900" e="-76.89787300"/>
</query>
<recurse type="way-node" />
</union>
<print/></osm-script>



All of the ways are missing their related nodes.

Thanks,

Tac


On Wed, May 15, 2013 at 4:32 PM, Jo <[hidden email]> wrote:
Can you try with this:

<osm-script>
<union>
<query type="node">
  <has-kv k="amenity"/>
  <bbox-query s="50.852" w="4.359" n="50.854" e="4.364"/>
</query>
<query type="way">
  <has-kv k="amenity"/>
  <bbox-query s="50.852" w="4.359" n="50.854" e="4.364"/>
</query>
<recurse type="way-node" />
</union>
<print/>
</osm-script>

I tested it, but now the %s are replaced...

Cheers,

Jo



2013/5/15 Tac Tacelosky <[hidden email]>
I thought I found a solution to get all the ways and nodes with an 'amenity' tag, plus the nodes that make up the way, with this:

<osm-script>
<union>
<query type="way">
  <has-kv k="amenity" regv="."/>
  <bbox-query s="%s" w="%s" n="%s" e="%s"/>
</query>

<query type="node">
  <has-kv k="amenity" regv="."/>
  <bbox-query s="%s" w="%s" n="%s" e="%s"/>
</query>
</union>
<recurse type="way-node" />
<print/></osm-script> 

Alas, that doesn't work.  I've tried with the recurse tag inside the union tag, and throw an item tag around, but I'm still not getting it.  Can someone point me in the right direction?

Thanks,

Tac


On Mon, May 6, 2013 at 7:03 PM, Tac Tacelosky <[hidden email]> wrote:
Thanks, Richard.  

I've put that into a union query, and now I'm getting all the ways and nodes that are marked with as having an amenity.

But the ways can't be displayed without their associated notes, which are often just points.  Is there a way to say "Any nodes marked with amenity, plus any ways marked as amenity and their associated nodes".

Would that be using "recurse"?  I can't quite grasp the syntax.  Any suggestions?

Thanks,

Tac



On Fri, May 3, 2013 at 3:06 PM, Richard Welty <[hidden email]> wrote:
On 5/3/13 2:59 PM, Tac Tacelosky wrote:
I'd like to get all nodes and ways within a bounding box that have any
amenity tags.  I think the Overpass API is the best way to go, but the
filtering seems to be for a specific amenity, e.g. k="amenity" and
v="restaurant".  I tried "*", but that didn't work.

Any suggestions on how to get all nodes and ways via an API call that are
tagged accordingly?

try this:

  <has-kv k="amenity" regv="." />

richard


_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies



_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies



_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies




_______________________________________________
newbies mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/newbies