Experiments with mapnik.
The official guide. Also need to install python-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:
-
In
CheckProjDatareturn/usr/local/Cellar/proj/6.3.0/share/proj/(change to the actual location) manually. -
When iterating over
OPTIONAL_LIBSHEADERScheck thatlibname == '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).
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
find mapnik -type l -delete
virtualenv mapnik
From here.