.a; node["amenity"="coworking_space"] (area.a" /> .a; node["amenity"="coworking_space"] (area.a" /> .a; node["amenity"="coworking_space"] (area.a"/>

osm overpass query by country

3.4k Views Asked by At

I am using this Overpass query to extract all coworking amenities in Italy.

( area["ISO3166-1"="IT"];) ->.a;
        node["amenity"="coworking_space"]
          (area.a);
         (._;>;);
 out body;

If I try to do the same for France using FR as ISO3166 country code

( area["ISO3166-1"="FR"];) ->.a;
        node["amenity"="coworking_space"]
          (area.a);
         (._;>;);
 out body;

I get no results while I am sure there are nodes like that in France (i tested with a separate query using automatic bbox).

Question:

  • Am I getting wrong the ISO3166 country code of France?
  • In general, there is a better way to extract osm data from overpass by country?

Thanks,

Jacopo

1

There are 1 best solutions below

0
scai On

You should query for the key ISO3166-1:alpha2 or ISO3166-1:alpha3 and use ISO3166-1 only as a fallback. These keys are explained in the country code wiki page.

The relation for the state of Italy has tag ISO3166-1 while the relation for the state of France doesn't. But both have the value you are looking for in the ISO3166-1:alpha2 key.