1

I'm trying to get WKT or GeoJson 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" or "France". How may I narrow results only to a capital and a country. Here's my request url:

http://nominatim.openstreetmap.org/search/fr/paris?format=json&polygon_geojson=1

And I get an array of 10 objects where 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 with the same name?

3
2

As you seem to try to getting bulk data, you are encouraged to append the email=... param to avoid beein blocked.
You can use various place=* tags to prefilter your results or even limit your result.

As Nominatim isn't build as a data provider, you might use to get the boundary polygons here:
http://download.geofabrik.de/europe/france.html
http://wiki.openstreetmap.org/wiki/WIWOSM

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.