OpenStreetMap Docker for Overpass API.
Download a OSM file in XML format compressed in bzip format and save as planet.osm.bz2
. Geofabrik is an excellent resource for this.
curl -o planet.osm.bz2 http://download.geofabrik.de/australia-oceania/new-zealand-latest.osm.bz2
docker build -t mediasuite/overpass-api .
docker run -p 81:81 overpass-api
Get all ways that have a highway key value near -36.9162, 174.8310 in JSON format.
Overpass QL
[out:json][timeout:25];
(
way
(
around:15,-36.9162,174.8310
)
["highway"];
._;>;
);
out;
- If error code is related to code 137 then it indicates process is killed due to the out of memery. Either start with smaller osm file, maybe for a smaller region, or change docker settings for the memory usage.
- If error is related to no directory is found then this can be due to the blank characters in any of the file in windows. So, run
dos2unix.exe
on all 4 files (i.e. Dockerfile , overpass, nginx.conf, docker-start)