This is a static archive of our old OSM Help Site. Please post any new questions and answers at community.openstreetmap.org.

OSM Feature Count and Feature Extraction

1

1)what is the total amount of places per country (by places I mean village, city, hamlet, etc). The count does not have to be split out, just one number per nation. And how do I figure this number out on my own for future reference?

2)I was told to run a overpass turbo query to extract specific features I wanted to review. How would I run it, or create it based on this information:

nsroadimport #thailand, source = digitalglobe and import = yes

asked 09 Oct '17, 23:01

MapMakinMeyers's gravatar image

MapMakinMeyers
26113
accept rate: 0%


One Answer:

2

Here's a sample script for counting the place features in a country:

http://overpass-turbo.eu/s/seM

(click on show data when the warning pops up)

The geocodeArea:Thailand is a feature of the Overpass Turbo website, to do the query directly against Overpass API it needs to be replaced with a reference to the OSM object the Overpass API area object is created from:

http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#By_area_.28area.29

A query like area["name:en"="Thailand"][admin_level="2"]->.searchArea; should also usually work.

Overpass API doesn't support queries against changeset tags, but if the tags are on the objects you want to review, just putting something like import=yes and source=digitalglobe into the Overpass Turbo wizard will return objects with those tags. There are some resource limits on the public instances, so queries returning a large number of objects may time out. Limiting the query to some smaller bounding box is one way to deal with that.

answered 09 Oct '17, 23:24

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

edited 09 Oct '17, 23:28

Seeing how place is sometimes used, the more interesting query probably also checks for name.

(11 Oct '17, 16:03) maxerickson