Skip to content

Latest commit

 

History

History

example1

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Getting data from the OpenStreetMap overpass api

Step 1: Overpass API

Go to: https://overpass-turbo.eu/ Some documentation here

Step 2: Go to the wizard

You can type in something like "Park in Pennsylvania"

Which will generate a query like this:

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“park in pennsylvania”
*/
[out:json][timeout:25];
// fetch area “pennsylvania” to search in
{{geocodeArea:pennsylvania}}->.searchArea;
// gather results
(
  // query part for: “park”
  node["leisure"="park"](area.searchArea);
  way["leisure"="park"](area.searchArea);
  relation["leisure"="park"](area.searchArea);
);
// print results
out body;
>;
out skel qt;

It may complain about being too large. Push on.

Step 3: Export as geoJson and draw and drop into (geojson.io)

Step 4: Copy and paste the geojson text into a new gist

Step 5: Click 'raw' and copy the URL into var url in the html herewithin. Visualize with leaflet