using the Overpass API

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

using the Overpass API

Andrew Salzberg
Hi,

just trying out the overpass API - very happily able to build scripts here in overpass turbo that run great (http://overpass-turbo.eu/) but wanted to take the next step and a) write a script in text file and b) send a request via bash so that ultimately I can write a script to loop this for a few cases.

I'm basically an API newb (not just an OSM API newb) so I'm able to do things like write a GET request but I'm not sure what the actual address I should be putting in my request to overpass is? Try as I might I can't find it in here: http://wiki.openstreetmap.org/wiki/Overpass_API I have working .txt file with an <osm_script> in it that I'd like to send via bash to overpass... if that makes sense.

any help much appreciated.

Andrew

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

Re: using the Overpass API

Mike Thompson
Andrew,

Here is how I do it in Windows.  Put your "script" into an xml file, let's call it my.xml:  
========================  
<osm-script>
  <union>
    <bbox-query e="e" n="n" s="s" w="w"/>
    <recurse type="up"/>
    <recurse type="down"/>
  </union>
  <print/>
</osm-script>
=========================   

(enter your own bounding box in above)
 
Use wget from a batch file (could call from the command line):    

=========================     
wget www.overpass-api.de/api/interpreter --post-file=my.xml -O my.osm     
=========================    

Does this help?

Mike



On Fri, May 17, 2013 at 11:27 AM, Andrew Salzberg <[hidden email]> wrote:
Hi,

just trying out the overpass API - very happily able to build scripts here in overpass turbo that run great (http://overpass-turbo.eu/) but wanted to take the next step and a) write a script in text file and b) send a request via bash so that ultimately I can write a script to loop this for a few cases.

I'm basically an API newb (not just an OSM API newb) so I'm able to do things like write a GET request but I'm not sure what the actual address I should be putting in my request to overpass is? Try as I might I can't find it in here: http://wiki.openstreetmap.org/wiki/Overpass_API I have working .txt file with an <osm_script> in it that I'd like to send via bash to overpass... if that makes sense.

any help much appreciated.

Andrew

_______________________________________________
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: using the Overpass API

Jo-2
In reply to this post by Andrew Salzberg
wget  -O "PT.osm" --post-file="PT.overpass" "http://overpass-api.de/api/interpreter"

should do the trick. I used it on Windows, so maybe the parameters for wget are different on Linux, not sure.


Jo

2013/5/17 Andrew Salzberg <[hidden email]>
Hi,

just trying out the overpass API - very happily able to build scripts here in overpass turbo that run great (http://overpass-turbo.eu/) but wanted to take the next step and a) write a script in text file and b) send a request via bash so that ultimately I can write a script to loop this for a few cases.

I'm basically an API newb (not just an OSM API newb) so I'm able to do things like write a GET request but I'm not sure what the actual address I should be putting in my request to overpass is? Try as I might I can't find it in here: http://wiki.openstreetmap.org/wiki/Overpass_API I have working .txt file with an <osm_script> in it that I'd like to send via bash to overpass... if that makes sense.

any help much appreciated.

Andrew

_______________________________________________
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: using the Overpass API

Andrew Salzberg
Hi all,

thanks for the responses. I'm actually using bash on my mac here (should've said that originally), so working with curl (should i be?)

I'm definitely communicating with overpass - thanks for the http://overpass-api.de/api/interpreter - but can't seem to send a script succesfully.

Even the simple sample taken directly from the tutorial page

curl --request GET "http://overpass-api.de/api/interpreter?data=node[name=\"Gielgen\"];out;"

yields:

curl: (3) [globbing] error: bad range specification after pos 50

but i'm acutally more interested in sending a file then storing the output (as your examples through wget do)

Andrew



On Fri, May 17, 2013 at 1:50 PM, Jo <[hidden email]> wrote:
wget  -O "PT.osm" --post-file="PT.overpass" "http://overpass-api.de/api/interpreter"

should do the trick. I used it on Windows, so maybe the parameters for wget are different on Linux, not sure.


Jo

2013/5/17 Andrew Salzberg <[hidden email]>
Hi,

just trying out the overpass API - very happily able to build scripts here in overpass turbo that run great (http://overpass-turbo.eu/) but wanted to take the next step and a) write a script in text file and b) send a request via bash so that ultimately I can write a script to loop this for a few cases.

I'm basically an API newb (not just an OSM API newb) so I'm able to do things like write a GET request but I'm not sure what the actual address I should be putting in my request to overpass is? Try as I might I can't find it in here: http://wiki.openstreetmap.org/wiki/Overpass_API I have working .txt file with an <osm_script> in it that I'd like to send via bash to overpass... if that makes sense.

any help much appreciated.

Andrew

_______________________________________________
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: using the Overpass API

Mike Thompson
Andrew,

I think curl interprets [] as a range specifier.  It expects something like [1-100] or [a-w].  You might have to escape those characters.  Not a curl expert so I can say for sure how to do that.

Mike


On Fri, May 17, 2013 at 12:16 PM, Andrew Salzberg <[hidden email]> wrote:
Hi all,

thanks for the responses. I'm actually using bash on my mac here (should've said that originally), so working with curl (should i be?)

I'm definitely communicating with overpass - thanks for the http://overpass-api.de/api/interpreter - but can't seem to send a script succesfully.

Even the simple sample taken directly from the tutorial page

curl --request GET "http://overpass-api.de/api/interpreter?data=node[name=\"Gielgen\"];out;"

yields:

curl: (3) [globbing] error: bad range specification after pos 50

but i'm acutally more interested in sending a file then storing the output (as your examples through wget do)

Andrew




On Fri, May 17, 2013 at 1:50 PM, Jo <[hidden email]> wrote:
wget  -O "PT.osm" --post-file="PT.overpass" "http://overpass-api.de/api/interpreter"

should do the trick. I used it on Windows, so maybe the parameters for wget are different on Linux, not sure.


Jo

2013/5/17 Andrew Salzberg <[hidden email]>
Hi,

just trying out the overpass API - very happily able to build scripts here in overpass turbo that run great (http://overpass-turbo.eu/) but wanted to take the next step and a) write a script in text file and b) send a request via bash so that ultimately I can write a script to loop this for a few cases.

I'm basically an API newb (not just an OSM API newb) so I'm able to do things like write a GET request but I'm not sure what the actual address I should be putting in my request to overpass is? Try as I might I can't find it in here: http://wiki.openstreetmap.org/wiki/Overpass_API I have working .txt file with an <osm_script> in it that I'd like to send via bash to overpass... if that makes sense.

any help much appreciated.

Andrew

_______________________________________________
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: using the Overpass API

Andrew Salzberg
that was it - thanks!

On Fri, May 17, 2013 at 2:42 PM, Mike Thompson <[hidden email]> wrote:
Andrew,

I think curl interprets [] as a range specifier.  It expects something like [1-100] or [a-w].  You might have to escape those characters.  Not a curl expert so I can say for sure how to do that.

Mike


On Fri, May 17, 2013 at 12:16 PM, Andrew Salzberg <[hidden email]> wrote:
Hi all,

thanks for the responses. I'm actually using bash on my mac here (should've said that originally), so working with curl (should i be?)

I'm definitely communicating with overpass - thanks for the http://overpass-api.de/api/interpreter - but can't seem to send a script succesfully.

Even the simple sample taken directly from the tutorial page

curl --request GET "http://overpass-api.de/api/interpreter?data=node[name=\"Gielgen\"];out;"

yields:

curl: (3) [globbing] error: bad range specification after pos 50

but i'm acutally more interested in sending a file then storing the output (as your examples through wget do)

Andrew




On Fri, May 17, 2013 at 1:50 PM, Jo <[hidden email]> wrote:
wget  -O "PT.osm" --post-file="PT.overpass" "http://overpass-api.de/api/interpreter"

should do the trick. I used it on Windows, so maybe the parameters for wget are different on Linux, not sure.


Jo

2013/5/17 Andrew Salzberg <[hidden email]>
Hi,

just trying out the overpass API - very happily able to build scripts here in overpass turbo that run great (http://overpass-turbo.eu/) but wanted to take the next step and a) write a script in text file and b) send a request via bash so that ultimately I can write a script to loop this for a few cases.

I'm basically an API newb (not just an OSM API newb) so I'm able to do things like write a GET request but I'm not sure what the actual address I should be putting in my request to overpass is? Try as I might I can't find it in here: http://wiki.openstreetmap.org/wiki/Overpass_API I have working .txt file with an <osm_script> in it that I'd like to send via bash to overpass... if that makes sense.

any help much appreciated.

Andrew

_______________________________________________
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



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

Re: using the Overpass API

MERIGHI Marcus-4
In reply to this post by Andrew Salzberg
[hidden email] (Andrew Salzberg), 2013.05.17 (Fri) 19:27 (CEST):

> just trying out the overpass API - very happily able to build scripts here
> in overpass turbo that run great (http://overpass-turbo.eu/) but wanted to
> take the next step and a) write a script in text file and b) send a request
> via bash so that ultimately I can write a script to loop this for a few
> cases.
>
> I'm basically an API newb (not just an OSM API newb) so I'm able to do
> things like write a GET request but I'm not sure what the actual address I
> should be putting in my request to overpass is? Try as I might I can't find
> it in here: http://wiki.openstreetmap.org/wiki/Overpass_API I have working
> .txt file with an <osm_script> in it that I'd like to send via bash to
> overpass... if that makes sense.
> any help much appreciated.
my script below and attached, not used for about two years:

bye, marcus

#!/bin/sh -e
# 14.0498277 48.3033928 14.6455346 48.5420446
# lon-min    lat-min    lon-max    lat-max
# top/max    left/max   bottom/min right/min
# lon=laenge, lat=breite
lonmin="${1}"
latmin="${2}"
lonmax="${3}"
latmax="${4}"
#
# get data of larger areas from:
#
# http://wiki.openstreetmap.org/wiki/Overpass_API
# http://overpass.osm.rambler.ru/ (production)
# http://www.overpass-api.de/ (testing)
#
# our query will be:
#
# union means: put all query results in to one result set
# <union>
#  we do a even more comprehensive search than recommended in
#  http://wiki.openstreetmap.org/wiki/Overpass_API#The_map_query
#  because simplifyway does not like missing nodes/ways.
#  
#  first get all nodes for the bbox
#  <bbox-query s="51.249" n="51.251" w="7.148" e="7.152"/>
#  get all relations from nodes; keep default variable "_" populated
#  with bbox query by putting result into "rels"
#  <recurse type="node-relation" into="rels"/>
#  get all ways from nodes, fill default variable "_" with result
#  <recurse type="node-way"/>
#  get all relations for just discovered ways; keep result of node-way by
#  putting new results into var "waysrels"
#  <recurse type="way-relation" into="waysrels"/>
#  finally get all nodes for these ways, accessing default variable "_" which
#  was filled by way-relation above
#  <recurse type="way-node"/>
# </union>
# we want the result with all data (user, version, timestamp, ...) so we can
# open it in JOSM and others
# <print mode="meta"/>
#
# The attributes n and s are used for the latitudes of the
# bounding box, w and e for the longitudes. See more details
# about bbox below.
# s the southern limit (bottom lat)
# n the northern limit (top lat)
# w the western limit (usually lower lon)
# e the eastern limit (usually higher lon)
#
# possible values of recurse:
# relation-relation, relation-backwards, relation-way,
# relation-node, way-node, way-relation,node-relation, node-way
#
# create the url to query
url="http://overpass.osm.rambler.ru/cgi"
url="${url}/interpreter"
url="${url}?data="
url="${url}%3Cunion%3E"
url="${url}%3Cbbox-query%20s=%22${latmin}%22%20n=%22${latmax}%22%20w=%22${lonmin}%22%20e=%22${lonmax}%22/%3E"
url="${url}%3Crecurse%20type=%22node-relation%22%20into=%22rels%22/%3E"
url="${url}%3Crecurse%20type=%22node-way%22/%3E"
url="${url}%3Crecurse%20type=%22way-relation%22%20into=%22waysrels%22/%3E"
url="${url}%3Crecurse%20type=%22way-node%22/%3E"
url="${url}%3C/union%3E"
url="${url}%3Cprint%20mode=%22meta%22/%3E"
# now get the stuff and print it to stdout
lynx -dump "${url}"
#
# does not work, ways/nodes missing
# lynx -dump "http://www.overpass-api.de/api/xapi?*[bbox=${bboxstr}][@meta]" \
# print "getting osm data from http://www.overpass-api.de/api/xapi?*[bbox=${bboxstr}][@meta]"
# print "getting osm data from http://api1.osm.absolight.net/api/0.6/map?bbox=${bboxstr}"

> !DSPAM:519668b88291234514069!

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

geo-osm-get.sh (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: using the Overpass API

Jeff Meyer
Do any other subscribers think it's funny to see an Overpass API thread on newbies@?


On Mon, May 20, 2013 at 12:50 PM, MERIGHI Marcus <[hidden email]> wrote:
[hidden email] (Andrew Salzberg), 2013.05.17 (Fri) 19:27 (CEST):
> just trying out the overpass API - very happily able to build scripts here
> in overpass turbo that run great (http://overpass-turbo.eu/) but wanted to
> take the next step and a) write a script in text file and b) send a request
> via bash so that ultimately I can write a script to loop this for a few
> cases.
>
> I'm basically an API newb (not just an OSM API newb) so I'm able to do
> things like write a GET request but I'm not sure what the actual address I
> should be putting in my request to overpass is? Try as I might I can't find
> it in here: http://wiki.openstreetmap.org/wiki/Overpass_API I have working
> .txt file with an <osm_script> in it that I'd like to send via bash to
> overpass... if that makes sense.
> any help much appreciated.

my script below and attached, not used for about two years:

bye, marcus

#!/bin/sh -e
# 14.0498277 48.3033928 14.6455346 48.5420446
# lon-min    lat-min    lon-max    lat-max
# top/max    left/max   bottom/min right/min
# lon=laenge, lat=breite
lonmin="${1}"
latmin="${2}"
lonmax="${3}"
latmax="${4}"
#
# get data of larger areas from:
#
# http://wiki.openstreetmap.org/wiki/Overpass_API
# http://overpass.osm.rambler.ru/ (production)
# http://www.overpass-api.de/ (testing)
#
# our query will be:
#
# union means: put all query results in to one result set
# <union>
#  we do a even more comprehensive search than recommended in
#  http://wiki.openstreetmap.org/wiki/Overpass_API#The_map_query
#  because simplifyway does not like missing nodes/ways.
#
#  first get all nodes for the bbox
#  <bbox-query s="51.249" n="51.251" w="7.148" e="7.152"/>
#  get all relations from nodes; keep default variable "_" populated
#  with bbox query by putting result into "rels"
#  <recurse type="node-relation" into="rels"/>
#  get all ways from nodes, fill default variable "_" with result
#  <recurse type="node-way"/>
#  get all relations for just discovered ways; keep result of node-way by
#  putting new results into var "waysrels"
#  <recurse type="way-relation" into="waysrels"/>
#  finally get all nodes for these ways, accessing default variable "_" which
#  was filled by way-relation above
#  <recurse type="way-node"/>
# </union>
# we want the result with all data (user, version, timestamp, ...) so we can
# open it in JOSM and others
# <print mode="meta"/>
#
# The attributes n and s are used for the latitudes of the
# bounding box, w and e for the longitudes. See more details
# about bbox below.
# s the southern limit (bottom lat)
# n the northern limit (top lat)
# w the western limit (usually lower lon)
# e the eastern limit (usually higher lon)
#
# possible values of recurse:
# relation-relation, relation-backwards, relation-way,
# relation-node, way-node, way-relation,node-relation, node-way
#
# create the url to query
url="http://overpass.osm.rambler.ru/cgi"
url="${url}/interpreter"
url="${url}?data="
url="${url}%3Cunion%3E"
url="${url}%3Cbbox-query%20s=%22${latmin}%22%20n=%22${latmax}%22%20w=%22${lonmin}%22%20e=%22${lonmax}%22/%3E"
url="${url}%3Crecurse%20type=%22node-relation%22%20into=%22rels%22/%3E"
url="${url}%3Crecurse%20type=%22node-way%22/%3E"
url="${url}%3Crecurse%20type=%22way-relation%22%20into=%22waysrels%22/%3E"
url="${url}%3Crecurse%20type=%22way-node%22/%3E"
url="${url}%3C/union%3E"
url="${url}%3Cprint%20mode=%22meta%22/%3E"
# now get the stuff and print it to stdout
lynx -dump "${url}"
#
# does not work, ways/nodes missing
# lynx -dump "<a href="http://www.overpass-api.de/api/xapi?*[bbox=${bboxstr}][@meta]" target="_blank">http://www.overpass-api.de/api/xapi?*[bbox=${bboxstr}][@meta]" \
# print "getting osm data from <a href="http://www.overpass-api.de/api/xapi?*[bbox=${bboxstr}][@meta]" target="_blank">http://www.overpass-api.de/api/xapi?*[bbox=${bboxstr}][@meta]"
# print "getting osm data from <a href="http://api1.osm.absolight.net/api/0.6/map?bbox=${bboxstr}" target="_blank">http://api1.osm.absolight.net/api/0.6/map?bbox=${bboxstr}"

> !DSPAM:519668b88291234514069!

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




--
Jeff Meyer
Global World History Atlas
www.gwhat.org
[hidden email]
206-676-2347

OpenStreetMap: Mapping with a Human Touch




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

Re: using the Overpass API

James Card
On Mon, 20 May 2013 21:31:53 -0700, Jeff Meyer <[hidden email]> wrote:

> Do any other subscribers think it's funny to see an Overpass API thread  
> on newbies@?

I was happy to see it, because it made me aware of other OSM tools that  
might be useful to me.

It is definitely a dev-type tool, but I knew nothing of it before its  
mention here. Some of the OSM-newbies here may be developers, but new to  
OSM and/or GIS.

--
James Card  --  <http://jdcard.com/>
Often there are several ways to understand a given set of
facts; some of them may be more useful than others.

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

Re: using the Overpass API

Andy Allan
In reply to this post by Jeff Meyer
On 21 May 2013 05:31, Jeff Meyer <[hidden email]> wrote:
Do any other subscribers think it's funny to see an Overpass API thread on newbies@?


Not "funny", no.

This mailing list is expressly for helping out newbie mappers getting started with OpenStreetMap.

Development queries and any coding-related matters should always be directed to the development mailing list, [hidden email] . If you are a newbie-developer, then [hidden email] is the list for you.

I would ask everyone on this list ([hidden email]) to refrain from any discussion of any development or coding-related matters, it's unfair on the mapping newbies for whom this list was set up. If somebody asks a development question, please point them politely to the correct list.

Thanks,
Andy

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

Re: using the Overpass API

Richard Fairhurst
In reply to this post by Jeff Meyer
Jeff Meyer wrote:
> Do any other subscribers think it's funny to see an Overpass API thread
> on newbies@?
> [full message quote snipped]

Quick request to Jeff and others - please snip the quoted message to the minimum before replying.

Top-posting has become an acceptable shortcut in corporate and informal email pingpongs, but is seriously inconvenient for mailing lists, like this one, which are often read in digest form or via a web interface.

Thank you. :)

cheers
Richard
newbies@ list admin

Reply | Threaded
Open this post in threaded view
|

Re: using the Overpass API

Tac Tacelosky
In reply to this post by Jeff Meyer
The folks on newbies are pretty responsive and friendly!

That being said, yes, questions about the API and Overpass probably belong on the dev list, or maybe some other list, but since newbies was the list I was on at the time, I started here.

What list does this thread belong on?  I had originally thought that dev was for the core OSM developers, who might have frowned on elementary API questions.  

Tac


On Tue, May 21, 2013 at 12:31 AM, Jeff Meyer <[hidden email]> wrote:
Do any other subscribers think it's funny to see an Overpass API thread on newbies@?


On Mon, May 20, 2013 at 12:50 PM, MERIGHI Marcus <[hidden email]> wrote:
[hidden email] (Andrew Salzberg), 2013.05.17 (Fri) 19:27 (CEST):
> just trying out the overpass API - very happily able to build scripts here
> in overpass turbo that run great (http://overpass-turbo.eu/) but wanted to
> take the next step and a) write a script in text file and b) send a request
> via bash so that ultimately I can write a script to loop this for a few
> cases.
>
> I'm basically an API newb (not just an OSM API newb) so I'm able to do
> things like write a GET request but I'm not sure what the actual address I
> should be putting in my request to overpass is? Try as I might I can't find
> it in here: http://wiki.openstreetmap.org/wiki/Overpass_API I have working
> .txt file with an <osm_script> in it that I'd like to send via bash to
> overpass... if that makes sense.
> any help much appreciated.

my script below and attached, not used for about two years:

bye, marcus

#!/bin/sh -e
# 14.0498277 48.3033928 14.6455346 48.5420446
# lon-min    lat-min    lon-max    lat-max
# top/max    left/max   bottom/min right/min
# lon=laenge, lat=breite
lonmin="${1}"
latmin="${2}"
lonmax="${3}"
latmax="${4}"
#
# get data of larger areas from:
#
# http://wiki.openstreetmap.org/wiki/Overpass_API
# http://overpass.osm.rambler.ru/ (production)
# http://www.overpass-api.de/ (testing)
#
# our query will be:
#
# union means: put all query results in to one result set
# <union>
#  we do a even more comprehensive search than recommended in
#  http://wiki.openstreetmap.org/wiki/Overpass_API#The_map_query
#  because simplifyway does not like missing nodes/ways.
#
#  first get all nodes for the bbox
#  <bbox-query s="51.249" n="51.251" w="7.148" e="7.152"/>
#  get all relations from nodes; keep default variable "_" populated
#  with bbox query by putting result into "rels"
#  <recurse type="node-relation" into="rels"/>
#  get all ways from nodes, fill default variable "_" with result
#  <recurse type="node-way"/>
#  get all relations for just discovered ways; keep result of node-way by
#  putting new results into var "waysrels"
#  <recurse type="way-relation" into="waysrels"/>
#  finally get all nodes for these ways, accessing default variable "_" which
#  was filled by way-relation above
#  <recurse type="way-node"/>
# </union>
# we want the result with all data (user, version, timestamp, ...) so we can
# open it in JOSM and others
# <print mode="meta"/>
#
# The attributes n and s are used for the latitudes of the
# bounding box, w and e for the longitudes. See more details
# about bbox below.
# s the southern limit (bottom lat)
# n the northern limit (top lat)
# w the western limit (usually lower lon)
# e the eastern limit (usually higher lon)
#
# possible values of recurse:
# relation-relation, relation-backwards, relation-way,
# relation-node, way-node, way-relation,node-relation, node-way
#
# create the url to query
url="http://overpass.osm.rambler.ru/cgi"
url="${url}/interpreter"
url="${url}?data="
url="${url}%3Cunion%3E"
url="${url}%3Cbbox-query%20s=%22${latmin}%22%20n=%22${latmax}%22%20w=%22${lonmin}%22%20e=%22${lonmax}%22/%3E"
url="${url}%3Crecurse%20type=%22node-relation%22%20into=%22rels%22/%3E"
url="${url}%3Crecurse%20type=%22node-way%22/%3E"
url="${url}%3Crecurse%20type=%22way-relation%22%20into=%22waysrels%22/%3E"
url="${url}%3Crecurse%20type=%22way-node%22/%3E"
url="${url}%3C/union%3E"
url="${url}%3Cprint%20mode=%22meta%22/%3E"
# now get the stuff and print it to stdout
lynx -dump "${url}"
#
# does not work, ways/nodes missing
# lynx -dump "http://www.overpass-api.de/api/xapi?*[bbox=${bboxstr}][@meta]" \
# print "getting osm data from http://www.overpass-api.de/api/xapi?*[bbox=${bboxstr}][@meta]"
# print "getting osm data from http://api1.osm.absolight.net/api/0.6/map?bbox=${bboxstr}"

> !DSPAM:519668b88291234514069!

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




--
Jeff Meyer
Global World History Atlas
www.gwhat.org
[hidden email]
<a href="tel:206-676-2347" value="+12066762347" target="_blank">206-676-2347

OpenStreetMap: Mapping with a Human Touch




_______________________________________________
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: using the Overpass API

Serge Wroclawski-2
On Tue, May 21, 2013 at 7:02 AM, Tac Tacelosky <[hidden email]> wrote:

What list does this thread belong on?  I had originally thought that dev was for the core OSM developers, who might have frowned on elementary API questions.  

 
dev is a pretty broadly scoped list- from questions about API calls, to rendering questions, to database questions, to discussions about the software's direction.

newbies was set up because talk can be pretty high traffic and intimidating.

In the meantime, help.osm.org has a wealth of information, for all types of questions.

- Serge

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

Re: using the Overpass API

Dave F.
In reply to this post by Jeff Meyer
On 21/05/2013 05:31, Jeff Meyer wrote:
> Do any other subscribers think it's funny to see an Overpass API
> thread on newbies@?
>

Err... No.
It's an end user having a newbie problem using Overpass for the first
time. This is the perfect place to discuss.

Dave F.



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

Re: using the Overpass API

Richard Welty-2
On 5/21/13 9:20 AM, Dave F. wrote:
> On 21/05/2013 05:31, Jeff Meyer wrote:
>> Do any other subscribers think it's funny to see an Overpass API
>> thread on newbies@?
>>
>
> Err... No.
> It's an end user having a newbie problem using Overpass for the first
> time. This is the perfect place to discuss.
up to a point. one of the functions the experienced mappers should be
providing here
is pointers to appropriate discussion venues once a discussion here gets
advanced.

it's probably not a good idea to swamp the newbies list with too much
technical detail,
we have other places to swamp people with too much technical detail.

richard


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

Re: using the Overpass API

Richard Fairhurst
In reply to this post by Dave F.
Dave F. wrote:
> Err... No.
> It's an end user having a newbie problem using Overpass for the
> first time. This is the perfect place to discuss.

When the newbies@ list was set up, its purpose was explicitly stated as:

"If you have time, know a lot about OSM and want to help newbies get started^d^d^d^d^d^d^d^ addicted then please join that list. It is explicitly *not* for general discussion, tag voting, license, coding questions and so on :-)"

By an oversight this was not added to the mailing list description page. I have now rectified that oversight: http://lists.openstreetmap.org/listinfo/newbies

To restate: this is a list for newbie mappers, not for development queries.

cheers
Richard
newbies@ admin

Reply | Threaded
Open this post in threaded view
|

Re: using the Overpass API

Jeff Meyer
In reply to this post by Richard Fairhurst
Mea culpa! Good point. Will do. I didn't even realize I was doing it. (web reader, but not a digester)
Quick request to Jeff and others - please snip the quoted message to the
minimum before replying.


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

Re: using the Overpass API

Dave F.
In reply to this post by Richard Fairhurst
On 21/05/2013 15:40, Richard Fairhurst wrote:
>
> When the newbies@ list was set up, its purpose was explicitly stated as:
>
> "If you have time, know a lot about OSM and want to help newbies get
> started^d^d^d^d^d^d^d^ addicted then please join that list. It is explicitly
> *not* for general discussion, tag voting, license, coding questions and so
> on :-)"

Is that how you meant that to appear?

> To restate: this is a list for newbie mappers, not for development queries.

Then my comment still stands. The OP was not developing but using.

Dave F.

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

Re: using the Overpass API

Jo-2
Working with map data is technical, so we shouldn't be afraid to give a technical answer, even on a newbies list.

Since this tangent started, I have been considering to unsubscribe from this list. I guess I'm a bit out of place here.

Still glad I was able to help Andrew get on with what he was trying to accomplish though. Let's hope he'll get as addicted as I turned out to be. :-)

Polyglot

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