Name: vanilla-extract
Owner: Mapzen
Description: Clone OSM planet and perform bounding-box extracts for routing. Consumes and produces PBF format.
Created: 2015-04-29 13:08:00.0
Updated: 2015-05-01 17:37:52.0
Pushed: 2015-05-01 17:37:59.0
Size: 195
Language: C
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Clone OSM planet and perform bounding-box extracts for bulk data users. Consumes and produces PBF format.
You will need zlib and protobuf-c libraries. On ubuntu you can install them from packages:
sudo apt-get install libprotobuf-c0-dev zlib1g-dev
You will also need gcc and make if you don't already have them:
sudo apt-get install build-essential
Clang is a nice compiler which produces nice error messages. You may want to install it and modify the CC line of the makefile to use it:
sudo apt-get install clang
Then just make as usual:
make clean && make
Only store the database on a filesystem that supports sparse files (ext3 and ext4 do). Everything goes much quicker on a solid-state disk. The program itself should only need a few megabytes of memory but benefits greatly from free memory that the OS can use as cache.
To load a PBF file into the database:
./vex <database_directory> <planet.pbf>
Loading a full planet PBF to a solid-state drive will take at least an hour, so you may want to start with a small PBF file just to experiment with making extracts. You will want to delete the contents of the database directory before you start another import. If your machine has enough memory available, you can bypass disk entirely and perform the entire operation entirely in memory by replacing specifying 'memory' (without quotes) as the database directory parameter.
Once your PBF data is loaded, to perform an extract run:
./vex <database_directory> <min_lat> <min_lon> <max_lat> <max_lon> <output_file.pbf>
If you specify -
as the output file, vex
will write to standard output.
vexserver.js
provides a simple NodeJS server to run vex
over HTTP. This is useful if you want to keep all your data
in one place, or if you only have one server with a large SSD. It requires data to already be loaded to the database,
and is used like so:
node vexserver.js
(on ubuntu, nodejs vexserver.js
)
Parameters are taken from the environment:
Remaining loose ends to provide lossless extracts:
Future possibilities include: