User:Breki/Overpass API Installation
- which version of Ubuntu (link)
- which version of Overpass
- include caveats - newby Linux user etc.
- warning about paths
Installing Prerequisite Packages
These packages are needed so you can compile Overpass API package and run it. Apache web server is also included.
sudo apt-get update sudo apt-get install g++ make expat libexpat1-dev zlib1g-dev apache2
Downloading Overpass API Tarball And Compiling The Source Code
We will organize all Overpass files in the
/home/igor/overpass directory. For simplicity reasons, Overpass binaries will be built inside the sources directory.
cd Downloads wget http://dev.overpass-api.de/releases/osm-3s_v0.7.54.tar.gz mkdir overpass cd overpass tar -zxvf ../Downloads/osm-3s_v0.7.54.tar.gz cd osm-3s_v0.7.54/ ./configure --prefix="`pwd`" make
Downloading Sample OSM Data
We are using a Isle of Man sample extract from Geofabrik since it is small and (mostly) self-contained.
cd Downloads/ wget http://download.geofabrik.de/europe/isle-of-man-latest.osm.bz2 cd ..
Populating Overpass API Database
First we make sure the scripts will have the necessary access to the Overpass files:
chmod -R 755 overpass
For testing reasons, we will do the populating in-process since it should not take too long for such a small dataset.
osm-3s_v0.7.54/bin/init_osm3s.sh ../Downloads/isle-of-man-latest.osm.bz2 db osm-3s_v0.7.54
For larger datasets, it is better to use
nohup command so the process can continue to run even if the user logs out:
nohup osm-3s_v0.7.54/bin/init_osm3s.sh ../Downloads/isle-of-man-latest.osm.bz2 db osm-3s_v0.7.54 &
(note that the ending
& character means the command will run in the background).
The database will be stored in the
Running A Sample Query
Now we are ready to run a sample query on the imported data. Enter command
... and then copy & paste this sample query into the prompt:
node["amenity"="post_box"]; out skel;
... and press Ctrl+D to start the query. It should return skeleton OSM data about all post box nodes on Isle of Man.