IT Notes : Use Overpass Turbo API to extract information from OSM
Use Overpass Turbo API to extract information from OpenStreetMap
Example : Find and download places of worship in Hong Kong
Go to https://overpass-turbo.eu/
move the map to show Hong Kong SAR boundary
Set [amenity=place_of_worship]
After a while, circles were generated on the map showing the locations of place of worship.
Select the [Export] option to download the required format, e.g. gpx.
Since some area in Shenzhen was also included in the data collection, remove them using GIS tools.
Import the gpx file into map application. The place of worship was shown in the map.
Alternatively, we can use overpass API to retrieve the above data
First locate HKSAR's border coordinates from Wikipedia
The order of the four numbers is left, bottom, right, top:
http://www.overpass-api.de/api/xapi?map?bbox=left,bottom,right,top
left is the longitude of the left (westernmost) side of the bounding box, or minlon.
bottom is the latitude of the bottom (southernmost) side of the bounding box, or minlat.
right is the longitude of the right (easternmost) side of the bounding box, or maxlon.
top is the latitude of the top (northernmost) side of the bounding box, or maxlat.
http://www.overpass-api.de/api/xapi_meta?*[amenity=place_of_worship][bbox=113.8222,22.12,114.4522,22.5706]
An xml data file containing places of worship in Hong Kong (with some Shenzhen data that needed to be removed) will be downloaded.
Comments