Mapnik-Windows编译

该博客详细介绍了如何在Windows上编译和打包Mapnik 2.3.x。内容包括使用Visual Studio 2008或2010的步骤,以及构建Mapnik依赖的详细过程,如ICU、Boost、WebP等。此外,还提到了一些常见问题和解决方案。
摘要由CSDN通过智能技术生成

Build and Package Mapnik for windows编译和打包

These are working notes on building Mapnik from source on windows.

  • Currently these instructions target the upcoming Mapnik 2.3.x release.
  • This is being tested on windows 7 64 bit.
  • This is currently only tested with release builds in 32 bit. 64 bit support is planned, but not tested yet.

Visual Studio versions.

These notes attempt to map out the steps to compile Mapnik and dependencies with either VS 2008 or VS 2010. We also plan to support VS 2012.

编译Mapnik和依赖是VS2008或VS2010。

Setup

Step 1: Build Mapnik dependencies

第1步:编译Mapnik依赖

See the building_mapnik_dependencies.md document for details on building Mapnik dependencies.

查看“编译_Mapnik_依赖.md”文档有更多关于编译Mapnik依赖的细节。

Step through it copying and pasting chunks of commands, ensuring they work before continuing.

逐步复制和粘贴命令块,确保它们在继续之前工作。

Step 2: Download and build Mapnik

Currently we are targeting Mapnik 2.3.x:

git clone https://github.com/mapnik/mapnik.git -b 2.3.x mapnik

Next edit the build_mapnik.bat and ensure the variables match your system (https://github.com/mapnik/mapnik-packaging/blob/18bb66ba95540c069acaf267ea7594bfd83734d9/windows/build_mapnik.bat#L3-L12). In particular ensure that the MAPNIK_SOURCE variable points the git checkout you just made above.

Then run the build_mapnik.bat:

cd mapnik-packaging/windows
build_mapnik.bat 1> build.log

Mapnik should be compiled and placed in the folder pointed to by the PREFIX variable in build_mapnik.bat

If you hit errors you can ask for help by creating an issue at https://github.com/mapnik/mapnik-packaging/issues?state=open

Gochas

The VS 2008 vcbuild command is broken on arrival

It complains about write-access. To fix it do:

cd C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages
regsvr32 vcprojectengine.dll

https://github.com/mapnik/mapnik-packaging/tree/master/windows

 

编译依赖

Building Mapnik dependencies on Windows编译Mapnik依赖

(Visual C++ express 2008, 2010 and 2012 32-bit)

Buiding dependencies on windows can be very tedious. The goal here is to provide concise instructions for building individual packages using either VC++ 2008, or 2010/2012.

在windows上构建依赖关系可能非常乏味。这里的目标是提供使用VC++2008或2010/2012构建单个包的简明说明。

Hopefully, this will allow fully automated builds in the future.

希望这将允许将来完全自动化的构建。

Prerequisites前提准备

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Mapnik是一个开源的地图渲染引擎,可以在不同的平台上使用。下面是MapnikWindows和Linux上的安装教程: Windows: 1. 下载和安装Visual Studio Mapnik需要Visual Studio来编译,你可以从Microsoft官网下载Visual Studio Community版或者购买商业版。 2. 下载和安装Python Mapnik需要Python来运行,你可以从Python官网下载并安装Python 2.7或者Python 3.x版本。 3. 安装Mapnik依赖库 Mapnik需要一些依赖库来编译和运行,包括Boost、ICU、libxml2、libjpeg、libpng、libtiff、proj4和freetype。 这些库可以从官方网站下载,或者你可以使用预编译的二进制文件进行安装。在安装过程中,你需要将它们添加到系统路径中。 4. 下载和编译Mapnik 你可以从Mapnik官网下载最新的源代码,然后使用Visual Studio打开项目文件并编译Mapnik。 在编译过程中,你需要设置一些变量来指定依赖库的路径和版本,以及编译选项。 5. 测试Mapnik 编译完成后,你可以使用Python脚本测试Mapnik是否正常工作。 Linux: 1. 安装依赖库 Mapnik需要一些依赖库来编译和运行,包括Boost、ICU、libxml2、libjpeg、libpng、libtiff、proj4和freetype。 在Ubuntu上,你可以使用命令sudo apt-get install来安装这些库: ``` sudo apt-get install libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-system-dev libboost-thread-dev libicu-dev libxml2-dev libjpeg-dev libpng-dev libtiff-dev libproj-dev libfreetype6-dev ``` 2. 下载和编译Mapnik 你可以从Mapnik官网下载最新的源代码,然后使用命令行进入源代码目录,并执行以下命令编译Mapnik: ``` ./configure && make && sudo make install ``` 在编译过程中,你需要设置一些变量来指定依赖库的路径和版本,以及编译选项。 3. 测试Mapnik 编译完成后,你可以使用Python脚本测试Mapnik是否正常工作。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值