-
Notifications
You must be signed in to change notification settings - Fork 0
Deployment
Since setting up the dependencies needed for this project can be difficult, we are providing an exemplary installation guide here.
You need to have a Postgres Database set up with the extensions HSTORE and PostGis enabled. The data should have been generated by the OHDMConverter, because it needs to match the mapnik schema with columns 'valid_since' and 'valid_until' added to each table, filled with logical data.
Note: Data with null-values in either of those columns will be ignored in rendering.
- Python 2.7 - Mapnik recommends 2.4-2.7, but this version is only tested with 2.7
- pip - Package Installer for Python
- Mapnik dependencies: https://github.com/mapnik/mapnik/blob/2.3.x/INSTALL.md#Depends
Clone the repository of mapnik 2.3:
git clone -b 2.3.x https://github.com/mapnik/mapnik.git
Follow the instructions on:
https://github.com/mapnik/mapnik/blob/2.3.x/INSTALL.md
We documented the issues we frequently encountered while setting up mapnik below (Known Issues).
Clone this repository:
git clone https://github.com/OpenHistoricalDataMap/Preselected-Rendering.git
cd Preselected-Rendering
wget http://tile.openstreetmap.org/world_boundaries-spherical.tgz # (51M)
wget http://tile.openstreetmap.org/processed_p.tar.bz2 # (391M)
wget http://tile.openstreetmap.org/shoreline_300.tar.bz2 # (42M)
wget http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_populated_places.zip # (1.5 MB)
wget http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_boundary_lines_land.zip # (44 KB)
Note: It may be possible that the wget commands will result in an error. If that occurs, just download them manually via the provided links and move them into the world_boundaries directory.
tar -xzf world_boundaries-spherical.tgz
tar -xjf processed_p.tar.bz2 -C world_boundaries
tar -xjf shoreline_300.tar.bz2 -C world_boundaries
unzip ne_10m_populated_places.zip -d world_boundaries
unzip ne_110m_admin_0_boundary_lines_land.zip -d world_boundaries
rm world_boundaries-spherical.tgz processed_p.tar.bz2 shoreline_300.tar.bz2 ne_10m_populated_places.zip ne_110m_admin_0_boundary_lines_land.zip
This is needed to access a postgres database.
sudo pip install psycopg2
You NEED TO customize the following file to match your database configuration.
inc/datasource-settings.xml.inc
You CAN customize the following file to change fontsettings for Mapnik fonts.
inc/fontset-settings.xml.inc
You CAN customize the following file to match your settings for symbols, the spatial reference of your postgis tables and coastline shapefiles directory.
You SHOULD NOT however change the <!ENTITY prefix [...]>
, because that entry is used by generate_view_tiles.py to access preselected database tables (Views).
inc/settings.xml.inc
You should stick with the recommended defaults unless you know better.
To generate a simple image of the area around the HTW in Berlin use the 'generate_image.py' script.
python generate_image.py # will output an 'image.png' file
Exiting... the following required dependencies were not found:
- freetype-config (freetype-config program | try setting FREETYPE_CONFIG SCons option or configure with FREETYPE_LIBS & FREETYPE_INCLUDES)
See '/home/<user>/mapnik/config.log' for details on possible problems.
If you have Freetype installed, mapnik can't find its location. You can fix this by overwriting the location:
./configure FREETYPE_INCLUDES=/path/to/include FREETYPE_LIBS=/path/to/lib
(See also: https://github.com/mapnik/mapnik/issues/3211)