[GIS] Extract polygons using Overpass Turbo

openstreetmapoverpass-apioverpass-turbo

I'm trying to extract areas that have the tag name = "Maroc Telecom using Overpass Turbo, to do so I executed this query:

area
 [name="Maroc Telecom"];
out geom;

When I look at the data tab I find an xml file which contains the features of my query yet on the map I can't see these areas to export them as GeoJSON.

Here is the resulting XML from Overpass Turbo query:

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Overpass API 0.7.55.4 3079d8ea">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<meta osm_base="2018-08-27T14:38:02Z" areas="2018-08-27T13:42:02Z"/>

  <area id="2502675189">
    <tag k="amenity" v="telephone"/>
    <tag k="building" v="public_building"/>
    <tag k="name" v="Maroc Telecom"/>
    <tag k="shop" v="mobile_phone"/>
  </area>
  <area id="2643523107">
    <tag k="building" v="yes"/>
    <tag k="name" v="Maroc Telecom"/>
  </area>
  <area id="2651330415">
    <tag k="addr:city" v="taza تازة"/>
    <tag k="name" v="Maroc Telecom"/>
    <tag k="office" v="telecommunication"/>
  </area>
  <area id="2681225147">
    <tag k="addr:city" v="Tanger"/>
    <tag k="building" v="yes"/>
    <tag k="name" v="Maroc Telecom"/>
    <tag k="office" v="telecommunication"/>
  </area>
  <area id="2778063776">
    <tag k="building" v="yes"/>
    <tag k="name" v="Maroc Telecom"/>
    <tag k="office" v="telecommunication"/>
  </area>
  <area id="2799103379">
    <tag k="addr:city" v="Ouarzazate"/>
    <tag k="addr:postcode" v="45000"/>
    <tag k="building" v="commercial"/>
    <tag k="name" v="Maroc Telecom"/>
    <tag k="office" v="telecommunication"/>
  </area>
  <area id="2854549079">
    <tag k="building" v="yes"/>
    <tag k="name" v="Maroc Telecom"/>
    <tag k="office" v="telecommunication"/>
  </area>

</osm>

Best Answer

The main use case for areas in Overpass API is to restrict further queries to certain polygons defined by some ways or relations. Your use case looks quite different: you're interested in ways / relations to generate some GeoJSON.

In this case you should query directly for the respective nodes, ways and relations, and use the Overpass Turbo Export feature to create GeoJSON output for it (Overpass API doesn't support GeoJSON!):

nwr[name="Maroc Telecom"];
out geom;