0

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>
7
  • Does the XML contain geocoordinates? Can you post an example output?
    – Zeitsperre
    Commented Aug 27, 2018 at 14:15
  • No it doesn't contain the coordinates and I know that this is the source of the issue. I don't know how to have these areas displayed on the map so I can export them. Commented Aug 27, 2018 at 14:18
  • It's likely that the result of the query is NULL (no results). Are you certain that there are "area" polygons named "Maroc Telecom"?
    – Zeitsperre
    Commented Aug 27, 2018 at 14:19
  • Yes Im pretty sure that there are some areas named "Maroc Telecom". I did some researches directly in OSM. Commented Aug 27, 2018 at 14:22
  • It could be that there are other features named "Maroc Telecom" (e.g. "Buildings"). Areas could be open expanses of land (e.g. "Commercial", "Nature Reserve"). I would try using overpass-turbo.eu to get a better handle of how the OSM API works.
    – Zeitsperre
    Commented Aug 27, 2018 at 14:27

1 Answer 1

2

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;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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