编译好了Mapnik 3 C++之后,还需要Python Mapnik才能在Python中调用。。。

but....

https://github.com/mapnik/mapnik/issues/4062

Windows binaries are no longer suppported, as per mapnik/node-mapnik/issues/848 . I did make mapnik work after that by creating a VS solution by hand, it was however a pain (to put it mildly). This was of course more a one-time thing rather than a sustainable approach.

Edit: I have just noticed #4056 where there is a link to a CMake build which can be used with Visual Studio, but have not tried it yet.

Windows二进制文件不再提供,因为 mapnik/node-mapnik/issues/848 。我的确让mapnik工作了,经过创建一个VS工程。但是的确是一种痛苦的经历。这更像是一次,而非长久之计。

后续:我刚刚注意到 #4056 。这是一个CMake的编译链接,它可以在VS中使用,但是还没有尝试过。

yes, this fork

https://github.com/pedro-vicente/mapnik

has a CMake build for the 3.0 and 2.3 branches with the minimum dependencies

the 2.3 branch builds without errors and runs a test program with the OSM plugin
the 3.0 branch has some compiling errors, with Visual Studio 2019

I'll post those errors here later

——————————pedro-vicente

here are the 3.0 errors

L:\mapnik\include\mapnik/feature.hpp(108,14): error C2664: 'mapnik::geometry::geometry::geometry(const mapnik::geometry::geometry &)': cannot convert argument 1 from 'mapnik::geometry::geometry_empty' to 'mapbox::util::no_init'

feature_impl(context_ptr const& ctx, mapnik::value_integer _id)
        : id_(_id),
        ctx_(ctx),
        data_(ctx_->mapping_.size()),
        geom_(geometry::geometry_empty()),
        raster_() {}

——————————pedro-vicente

L:\mapnik\include\mapnik/geometry/reprojection_impl.hpp(171,1): error C2440: 'return': cannot convert from 'mapnik::geometry::geometry_empty' to 'mapnik::geometry::geometry'

geometry<T> operator() (geometry_empty) const
        return geometry_empty();

                                                    ——————————pedro-vicente

mapnik\src\wkb.cpp(124,1): error C2440: 'initializing': cannot convert from 'mapnik::geometry::geometry_empty' to 'mapnik::geometry::geometry'

mapnik::geometry::geometry<double> geom = mapnik::geometry::geometry_empty();

                                                    ——————————pedro-vicente

L:\mapnik\src\wkb.cpp(132,1): error C2679: binary '=': no operator found which takes a right-hand operand of type 'mapbox::geometry::point' (or there is no acceptable conversion)

auto pt = read_point();
 if (!std::isnan(pt.x) && !std::isnan(pt.y))
      geom = std::move(pt);

                                                    ——————————pedro-vicente

about python-mapnik:

okay, I could fix the errors and now have a working python package. See my python-mapnik fork.

This requires the static library build. I cannot get all exported symbols working on Visual Studio (the problematic ones are static class members).

You must also set up a working mapnik-config program. I don't know how to do that automatically. After finishing the Mapnik build you can get the flags and libraries names you need from the generated Visual Project file.

Some input plugins have DLL dependencies (eg. gdal requires gdal204.dll). These DLLs have to be available via %PATH% when starting python.

                                                    ——————————roelandschoukens

Hello,
i also try to compile mapnik on window and expect to be able to bind the result with python3. I am a very beginner in this field and started by cloning the mapnik-windows repositery.
Then i ran vcpkg install boost-locale[icu] boost-regex[icu] boost --triplet x64-windows --recurse (which seems to have been succesfull)
And now i am lost. Should i run configure ? When i try scons do not find the c++ compiler even if visual studio 2019 is installed.
Could someone give me an indication about the path to follow ? In advance thank you.

我也尝试着在Windows上编译mapnik,并且期望能把编译好的类库绑定到python3。我是该领域一个十足的新手,从克隆mapnik-windows仓库开始的。

然后我运行了vcpkg安装boost-locale[icu] boost-regex[icu] boost --triplet x64-windows - -recurse(看上去还挺成功的)

然后现在我迷路了。我应该运行configue?当我尝试scons无法找到C++编译器,尽管我已经安装了VS2019。

有人能给我一点指示吗?提前谢谢大家。

                                                    ——————————bipbip1

For many years we've supported windows in the node-mapnik project, keeping builds working on appveyor and providing binaries for all downstream users.

We've been providing windows binaries since 2014 (v1.4.8 release): #202 (comment)

The time has come to drop support however. This is a tough decision because I'd like to keep supporting windows, but I don't have the ability to.

So, windows binaries are no longer going to be supported for > node-mapnik v3.6.3.

I'm sorry to those of you who have been depending on these binaries over the years (especially to those that might have downstream users or companies depending on them as well). This news probably comes as a major inconvenience/disappointment/surprise.

I've been developing in C++ for over 10 years now and much of that time I've been maintaining builds across mac, linux, windows for a variety of projects. Getting Mapnik running on Windows is the one of the hardest and most labor intensive things I've worked on due to:

  • how poor the support for modern C++ features have been in Visual Studio (for C++11 and C++14) (or instead how poor my understanding is, since I primarily develop on unix)
  • the large number of dependencies mapnik has and the lack of good consistent scripts or binary packages for them (requiring my team to maintain https://github.com/mapbox/windows-builds/tree/master/scripts)
  • the fact that mapnik's core build system does not support windows, requiring the maintenance of a totally separate build system (https://github.com/mapnik/mapnik-gyp), which therefore easily breaks.

All of these things combine with the fact that I'm managing a team at Mapbox now and I don't have the time to dig into failed builds. Also my colleague @BergWerkGIS, who was a major force behind making this system work for many years, has moved on to work on other things at Mapbox unrelated to C++ builds. Lastly we've been supporting windows for a couple years now without actually needing it at Mapbox (we don't depend on the windows builds of mapnik or node-mapnik since moving our focus to Mapbox GL - refs https://www.mapbox.com/help/upgrading-from-classic/ and https://www.mapbox.com/help/upgrading-from-classic/).

As such mapnik is no longer building on windows, and its tests have been failing for some time: https://ci.appveyor.com/project/Mapbox/mapnik/history.

If someone were to pick this up they would need to:

Since there is nobody that I know to step up to maintain this system, then my only reasonable option at this point is to drop support for node-mapnik on windows going forward.

So, my recommended solution for developers on windows that are depending on node-mapnik is to pin your usage in your package.json to v3.6.2 like:

  "dependencies": {
    "mapnik": "3.6.2",

Mentioning a few people on this ticket who, from looking at past issues (https://github.com/mapnik/node-mapnik/search?q=windows&type=Issues&utf8=%E2%9C%93), have been users of node-mapnik on windows: @donnyv @eczajk1 @vjpr @BHare1985 @andrelom @bmehta @TimJMartin @germanjoey @aparshin @qiyexue @fnicollet @jbrwn @rclark @n9 @mohsentaleb @djodonnell @iceaxe @mojodna @beaugunderson @strk @mapbox/core-tech

最终,我们希望许多人能够简单地点子pip install mapnik以获得预建的二进制文件,但是目前这还行不通。 所以现在这是说明 创建一个虚拟环境 强烈建议您在mapnik上进行开发时 。 如果您没有从源代码构建mapnik,而只是希望从的最新版本进行开发,则可以使用泥瓦匠构建来设置环境。 为了在构建之前触发梅森构建,您必须设置MASON_BUILD环境变量。 export MASON_BUILD=true 完成此操作后,只需按照源构建的说明进行操作即可。 从源头建造 假设您从源代码构建了自己的mapnik,并且已经运行了make install 。 根据需要设置任何编译器或链接环境变量,以便找到您的mapnik安装。 接下来,只需运行以下两种方法之一: python setup.py develop 如果您当前正在使用mapni var mapnik = require ( 'mapnik' ) ; var fs = require ( 'fs' ) ; // register fonts and datasource plugins mapnik . register_default_fonts ( ) ; mapnik . register_default_input_plugins ( ) ; var map = new mapnik . Map ( 256 , 256 ) ; map . load ( './test/stylesheet.xml' , function ( err , map ) { if ( err ) throw err ; map . zoomAll ( ) ; var im = new mapnik . I <br />Mapnik<br />一、Mapnik介绍<br />Mapnik 是一个开源的Python/C++地图渲染引擎,他的功能是把数据形式的地图,包含一些地理对象,如地图、层、数据源、特征和地理几何等,通过一个样式表的定义,渲染成位图格式,用来提供WMS服务。其核心是一个 C++ 的共享库提供空间数据访问和可视化的算法和模式。该共享库支持多种操作系统,可以在多线程环境下很好的运行,主要面向一些提供GIS服务的Web应用开发。图一为使用mapnik渲染出来的街区图:<br /><br />图一<br Mapnik is an open source toolkit for developing mapping applications. At the core is a C++ shared library providing algorithms and patterns for spatial data access and visualization. Mapnik is basically a collection of geographic objects like maps, layers 原文发布时间:2014/8/13  9:46:47翻译:lkfree  原文地址: http://blog.safe.com/2014/04/mapnik-automation/Mapnik是一个免费的、开源的工具包,它采用了矢量和栅格空间数据,并可以将矢量和栅格数据转换为一幅美丽的影像。在FME 2014版本中, FME和Mapnik已经集成在一起用于创建MapnikRasterizer 。这种... 目录一、简介二、安装 PostgreSQL 数据库和 PostGIS 扩展三、下载地图样式表和上传地图数据四、将地图数据导入 PostgresSQL五、生成 Mapnik Stylesheet六、安装 mapnik七、地图生成1、安装 Express 框架2、创建地图前端页面3、启动地图4、nodejs 服务后台持续运行三种方法 该地图服务器是基于优麒麟系统的安装部署!!! 优麒麟设置 root 密码: sudo passwd root sudo apt update sudo apt The latest release is Mapnik v3.0.22.最新版本是Mapnik v3.0.22。 Mapnik 3.0.22 Release Date: 22 January 2019 Source Installation To build Mapnik v3.0.22 from source eith...   最近的工作重心放在了后端地图渲染引擎上,因此接触到了mapnik,用了一段时间感觉它的功能相当丰富,具有很强的拓展性,生态也比较强大,想对学习过程做一个记录。OK,废话少说。 什么是Mapnik   Mapnik是一款开源的具有地图渲染功能的库,它能够为Postgis,Shapefile,Geojson,SQLite等在内的多种数据源... 我正在django项目中尝试使用GeoDjango。在我的setting.py中,我向已安装的应用程序添加了'django.contrib.gis',但出现此错误。File "C:\Users\lenovo\AppData\Local\conda\conda\envs\myDjangoEnv\lib\site-packages\django\contrib\gis\admin\__init__.p...