-
Notifications
You must be signed in to change notification settings - Fork 1
WindowsInstallation
Mapnik binaries can be installed and configured manually on windows. See http://mapnik.org/download/ for the latest download and instructions on installing.
If you are interested in installing Mapnik on other operating systems see Mapnik-Installation
If you an interested in compiling Mapnik from source on windows see the windows scripts at https://github.com/mapnik/mapnik-packaging
The Windows builds have a slightly less complete feature set than is possible from source builds. Full support is planned, and this table tracks the versions in which new features are added:
Mapnik Feature | 0.5.0 | 0.5.1 | 0.6.0 | 0.6.1 | 0.7.0 | 0.7.1 | 2.2.0 |
---|---|---|---|---|---|---|---|
Cairo Rendering | - | - | - | - | - | - | *** |
ICU Unicode Support | - | - | *** | *** | *** | *** | *** |
Python 2.5 Support | *** | *** | *** | *** | *** | *** | - |
Python 2.6 Support | - | - | - | - | *** | *** | - |
Python 2.7 Support | - | - | - | - | *** | *** | *** |
Libxml2 Parser Support | - | - | - | *** | *** | *** | *** |
Shapefile Plugin | *** | *** | *** | *** | *** | *** | *** |
Raster Plugin | *** | *** | *** | *** | *** | *** | *** |
PostGIS Plugin | *** | *** | *** | *** | *** | *** | *** |
GDAL Plugin | - | - | *** | *** | *** | *** | *** |
OGR Plugin | - | - | - | *** | *** | *** | *** |
SQLite Plugin | - | - | *** | *** | *** | *** | *** |
GeoJSON Plugin | - | - | - | - | - | - | *** |
CSVJSON Plugin | - | - | - | - | - | - | *** |
OSM Plugin | - | - | - | - | - | - | - |
shapeindex.exe | - | *** | *** | *** | *** | *** | *** |
pgsql2sqlite.exe | - | - | *** | *** | *** | *** | *** |
-
- : not available
-
***: available
-
Note: as of Mapnik 0.6.1 memory-mapped files are disabled in the Shapefile Plugin in windows builds (see #342)
This Guide will walk you through installing Mapnik and then running a test script to generate the sample map below:
Get the latest Windows binaries at http://mapnik.org/download/
Place the unzipped folder into C:\mapnik-v2.2.0\
Do this at Control Panel->System->Advanced->Environment Variables
- Add
;C:\mapnik-v2.2.0\lib;
to thePATH
variable. -
Note: The
;
characters are separators so add them before or after other entries that may be in yourPATH
variable. If you are only addingC:\mapnik-v2.2.0\lib
(and yourPATH
has not been modified/added to yet then technically you can leave out the;
until you add more entries. - Note: you may also need to set your user path environment variable.
-
Note: Adding
;C:\mapnik-v2.2.0\bin;
to thePATH
variable is for the following commands: - mapnik-config, pgsql2sqlite, shapeindex, svg2png, upgrade_map_xml
- If the variable
PATH
is not already present, add it. - Setting this correctly allows the Mapnik python bindings to find the
mapnik.dll
- for PYTHON support add:
- PYTHON 2.7:
;C:\mapnik-v2.2.0\python\2.7\site-packages;
to thePYTHONPATH
variable. - Setting this correctly allows Python to find the Mapnik python bindings when you do
>>> import mapnik
- Open a new console by running "cmd" to test settings.
- Type "path" to make sure your PATH contains
C:\mapnik-v2.2.0\lib
- Run
C:\Python27\python.exe
- Then type at a python prompt:
import mapnik
- If you get no error message, you made it!
- If you do get an error message, see Troubleshooting below
- Open explorer, go to
C:\mapnik-v2.2.0\demo\python
- Double click
rundemo.py
- You should see several demo.* files output.
Head over to GettingStarted for your first tutorial on the Mapnik Python API.
You get an error like:
Can't find mapnik.dll
Solution: make sure that you complete Step 3.a properly.
Problem: When importing mapnik in python you get:
>>> import mapnik
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named mapnik
Solution: make sure that you have put the site-packages
folder on your PYTHONPATH by completing Step 3.b.
Problem: When importing mapnik in python you get:
ImportError: DLL load failed: The specified procedure could not be found.
One possible reason is an libxml2
conflict. See http://stackoverflow.com/questions/7576751/installing-mapnik-on-windows-xp-fails-with-the-message-importerror-dll-load-fa for details on how to workaround and follow https://github.com/mapnik/mapnik-packaging/issues/109.
Problem: When importing mapnik in python you get:
>>> import mapnik
[...snip...]
from _mapnik import *
ImportError: DLL load failed: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
Solution:
- You may need to install the 2010 Microsoft Visual C++ 2010 Redistributable Package (
vcredist.exe
) from the Microsoft. - You can get more information on what is missing or incompatible by examining mapnik.dll with Dependency Walker. On a 64bit system you must use the 32bit Version.