IT:uMap/Guide/Importazione di dati con Overpass

From OpenStreetMap Wiki
Jump to navigation Jump to search

uMap può usare dati esterni attraverso un collegamento a un URL (query) a Overpass – Questo metodo è particolarmente adatto a dati che cambiano frequentemente. In questo modo, i dati saranno aggiornati automaticamente.

  • 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 Queries section and select compact to reduce it without line breaks, tabulations or comments :
    [out:json][timeout:15];(node["building"="church"](45,46,47,48);way["building"="church"](45,46,47,48);relation["building"="church"](45,46,47,48););out body;>;out skel qt;
    
  • Add https://overpass-api.de/api/interpreter?data= in front of the query built before (that you should 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):
    https://overpass-api.de/api/interpreter?data=%5Bout%3Ajson%5D%5Btimeout%3A15%5D%3B%28node%5B%22building%22%3D%22church%22%5D%2845%2C46%2C47%2C48%29%3Bway%5B%22building%22%3D%22church%22%5D%2845%2C46%2C47%2C48%29%3Brelation%5B%22building%22%3D%22church%22%5D%2845%2C46%2C47%2C48%29%3B%29%3Bout+body%3B%3E%3Bout+skel+qt%3B
    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