You are not logged in.

#1 2016-07-25 21:44:55

deepsoul
Member
From: Earth
Registered: 2012-12-23
Posts: 67
Website

Python bindings for Mapnik

The Mapnik package in the community repository used to contain Python bindings - I am sure of that because I wrote and used a Python script using them last autumn.  Also, only the Python bindings are documented on the Mapnik site.

The current Mapnik package does not seem to contain any Python bindings any more.  Is that a bug?  Does it have to do with the update to version 3.x?  Is there any documentation of the bindings of 3.x versions anywhere?


Officer, I had to drive home - I was way too drunk to teleport!

Offline

#2 2016-07-29 16:37:19

frnc
Member
Registered: 2009-07-10
Posts: 9

Re: Python bindings for Mapnik

Hi, absolute beginner here. I'm trying too to use python (3.x) with mapnik.

It seems that from version 3 of Mapnik "the python bindings that were previously bundled with Mapnik have now been moved to https://github.com/mapnik/python-mapnik and are versioned independently".

But python-mapnik installation docs clarify that, as a pip install mapnik way of setting things up is still missing, you are only left with building the bindings from source, which entails launching a setup.py file that is not to be found in the pacman package (apparently you have to build the whole mapnik bundle from source to have that setup.py in place).

So I am stuck. Please leave a note if you find a different way out. Thnx

Offline

#3 2016-07-30 18:33:27

deepsoul
Member
From: Earth
Registered: 2012-12-23
Posts: 67
Website

Re: Python bindings for Mapnik

Thank you for your reply, frnc.

For my own purpose, I have rewritten my small script in C++.  This took less time than any other option, and in any case C++development effort is not much more than Python's when all you do is call library functions.

Regarding the new python bindings:  You are right, they are in a separate repository as of this commit.  The setup.py build script is in that new repository (where it should be).  I managed to build them, but could not create an AUR package because the build script insists on performing tests that fail when installing to a temporary package directory.  Usage messages for the build script can be obtained with the following commands (after cloning the repository you linked to):

python setup.py --help-commands
python setup.py --help develop

To answer my own questions: There is no documentation for version 3 python bindings.  There is no documentation for the C++ bindings either, but a few of the mapnik header files have doxygen comments.  I may put them on the web with my OpenStreetmap stuff when I find the time.

One last thing to consider before using the new python bindings is how much development effort they are going to receive in the future.  If their development was anticipated to proceed in step with that of mapnik, there would have been no reason to move them to a different repository.  Considering the openness of the project in general (no docs, custom build systems), they may be more trouble than they are worth.


Officer, I had to drive home - I was way too drunk to teleport!

Offline

Board footer

Powered by FluxBB