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"/>
    <query type="node">
      <has-kv k="amenity" v="parking"/>
      <area-query from="area"/>
    <query type="way">
      <has-kv k="amenity" v="parking"/>
      <area-query from="area"/>
    <query type="relation">
      <has-kv k="amenity" v="parking"/>
      <area-query from="area"/>
  <print mode="body"/>
  <recurse type="down"/>
  <print mode="skeleton" order="quadtile"/>

Any suggestions?

asked 02 Jan '15, 13:42

turgus's gravatar image

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

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

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

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

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



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:


question asked: 02 Jan '15, 13:42

question was seen: 2,706 times

last updated: 02 Jan '15, 14:41

powered by OSQA