uMap/Guide/Import data with Overpass

From OpenStreetMap Wiki
< UMap‎ | Guide
Jump to navigation Jump to search

uMap can use external data from a URL link (query) to overpass – This method is well suited for data changing regularly. This way, they'll be automatically updated.

  • Go to overpass.
  • Go to "assistant" tab, and type in the tags of your Overpass query (example : building=church for churches). Then click on "build and execute a query". Results should be displayed on a map and the built query can look like this:
    [out:json][timeout:15];
    (node["building"="church"]({{bbox}});
     way["building"="church"]({{bbox}});
     relation["building"="church"]({{bbox}});
    );
    out body;
    >;
    out skel qt;
    
  • Target the search area of the query. To do this, click on "manually select the limits of the bbox" next to the map on the left side.
    If a restriction rectangle of the query has to be stored within the query, replace "({{bbox}})" by the numerical GPS coordinates.
  • Go to the export tab, then in the Query section and copy the uMap remote data url. It should look like:
    [out:json][timeout:25];(node["building"="church"]({south},{west},{north},{east});way["building"="church"]({south},{west},{north},{east});relation["building"="church"]({south},{west},{north},{east}););out body;>;out skel qt;
    
  • Add https://overpass-api.de/api/interpreter?data= in front of the query built before :
    https://overpass-api.de/api/interpreter?data=[out:json][timeout:25];(node["building"="church"]({south},{west},{north},{east});way["building"="church"]({south},{west},{north},{east});relation["building"="church"]({south},{west},{north},{east}););out body;>;out skel qt;
    You may urlencode for a standard HTTP GET query, in order to facilitate integration of the URL in a web page or other services limiting allowed characters in URLs if the query wasn't compacted. The raw text of the urlencoded query can be decoded again with a website like this one.
  • In Umap, go to the parameters of the layer,
    Importer des données sur uMap - Etape2.PNG
    then click on "Remote data".
    Importer des données sur uMap - Etape3.PNG
  • Add the link built previously with the query on the data in the URL. Select the osm format and check the dynamic option. If the data searched for are dense in OpenStreetMap, limit the loading of these data to high levels of zoom (for example zoom 16).
  • Select "Save" in the upper part.
  • Data should now appear in your layer. One example for churches is available here.
    Umap exemple résultat requête Overpass.png