Skip to content

Repository files navigation

mapnik_maps

Experiments with mapnik.

Installation (macOS)

The official guide. Also need to install python-mapnik.

Steps for mapnik:

brew install icu4c
brew install boost --with-icu4c

# install all dependencies and mapnik
brew install mapnik

# do not need to do further steps if mapnik-render works without errors

# install mapnik from source code
brew uninstall mapnik
git clone --recursive https://github.com/mapnik/mapnik.git
cd mapnik
./configure
make
make install

In case of errors, it may be required to define some variables:

./configure SQLITE_INCLUDES=/usr/local/opt/sqlite/include CUSTOM_DEFINES="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"

If the library proj is not detected then it is necessary to manually edit the SConstruct script:

  1. In CheckProjData return /usr/local/Cellar/proj/6.3.0/share/proj/ (change to the actual location) manually.

  2. When iterating over OPTIONAL_LIBSHEADERS check that libname == 'proj' and manually add:

env.Append(CPPDEFINES = define)
env.Append(CPPDEFINES = 'ACCEPT_USE_OF_DEPRECATED_PROJ_API_H')

(Alternatively, run brew link --force icu4c before brew install boost).

Steps for python-mapnik:

virtualenv mapnik
source mapnik/bin/activate

git clone https://github.com/mapnik/python-mapnik
python setup.py install

deactivate
source mapnik/bin/activate
python
import mapnik
exit()
rm -rf python-mapnik

If the build process fails, then try to install mapnik from source code and repeat the build process. Additionally it may be required to set a custom version of boost-python library:

export BOOST_PYTHON_LIB=boost_python38

Fixing broken virtualenv links

find mapnik -type l -delete
virtualenv mapnik

From here.

Links

Mapnik Links

Extra Links

About

Experiments with mapnik

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages