NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I'm having trouble executing my query using the overpass-api.de API.

Error: line 3: parse error: not well-formed (invalid token)

My query is the following:

<osm-script timeout="300">
  <id-query {{nominatimArea:Mexico}} into="area"/>
  <union>
    <query type="node">
      <has-kv k="amenity" v="parking"/>
      <area-query from="area"/>
    </query>
    <query type="way">
      <has-kv k="amenity" v="parking"/>
      <area-query from="area"/>
    </query>
    <query type="relation">
      <has-kv k="amenity" v="parking"/>
      <area-query from="area"/>
    </query>
  </union>
  <print mode="body"/>
  <recurse type="down"/>
  <print mode="skeleton" order="quadtile"/>
</osm-script>

Any suggestions?

asked 02 Jan '15, 13:42

turgus's gravatar image

turgus
31113
accept rate: 0%


{{nominatimArea:Mexico}} is overpass turbo specific (=syntactic sugar). Overpass API (the database backend) has no idea about this, hence the error message you get.

Just paste your query into overpass-turbo.eu and click on Export. What you're probably looking for is the link behind "raw data directly from Overpass API".

Before sending your query to Overpass API, overpass turbo will automatically replace this by

<id-query type="area" ref="3600114686" into="area"/>

permanent link

answered 02 Jan '15, 14:25

mmd's gravatar image

mmd
5.7k15388
accept rate: 37%

edited 02 Jan '15, 14:29

Doing that, the second line became: <id-query type="area" ref="3600114686" into="area"/>

Is there anyway I can find out the ref number somehow without overpass turbo doing all the work?

(02 Jan '15, 14:29) turgus
2

Yes, sure, something along those lines:

<query into="area" type="area"> <has-kv k="boundary" v="administrative"/> <has-kv k="ISO3166-1" v="MX"/> </query>

(02 Jan '15, 14:32) mmd

Thanks a ton!

(02 Jan '15, 14:33) turgus
1

overpass turbo link: http://overpass-turbo.eu/s/6Nb

(02 Jan '15, 14:33) mmd

Sorry, one last question. Let's say I had:

<query into="area" type="area"> <has-kv k="boundary" v="administrative"/> <has-kv k="ISO3166-1" v="US"/> </query>

and wanted to get only the state Florida from US?

Edit: Nevermind, got it! Thanks again

(02 Jan '15, 14:36) turgus
1

Florida's relation (www.openstreetmap.org/relation/162050) is currently tagged as "ISO3166-2"= "US-FL", "admin_level"="4" and "boundary" = "administrative".

So I would probably use <has-kv k="ISO3166-2" v="US-FL"/> along with <has-kv k="boundary" v="administrative"/>

(02 Jan '15, 14:40) mmd
showing 5 of 6 show 1 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×483
×290

question asked: 02 Jan '15, 13:42

question was seen: 3,703 times

last updated: 02 Jan '15, 14:41

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum