Why not ask your question on the new OpenStreetMap Community Forum?

I'm trying to get WKT polygons of cities and countries from Nominatim (for example, Paris and France). I send a GET request but it returns me several results named "Paris". How may I narrow results only to the capital. Here's my request url:


And I get an array of 10 objects, only one is the capital,

class: "boundary", type: "administrative".

The rest are:

class: "place", type: "isolated_dwelling"
class: "place", type: "hamlet",
class: "place", type: "neighbourhood"
and so on...

How to select only the desired city and only the desired country ignoring rest of results?

asked 08 Nov '13, 16:10

green10701's gravatar image

accept rate: 0%

There's probably no guaranteed way to do this but several things that can help:

  • Limit the number of results to one by adding &limit=1 (example)
  • Request only certain feature types by adding &featuretype=city (example)
  • Request only cities named "Paris" in a country named "France" by using as structured query: search?city=Paris (example)
permanent link

answered 09 Nov '13, 15:01

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
accept rate: 23%

edited 09 Nov '13, 15:03

Apparently the featuretype parameter was removed https://github.com/osm-search/Nominatim/issues/1938

(16 Sep '22, 05:22) cyberixae
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: 08 Nov '13, 16:10

question was seen: 11,422 times

last updated: 16 Sep '22, 05:22

powered by OSQA