博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
OpenStreetMap初探(七)——渲染和地图瓦片之安装Mapnik
阅读量:4033 次
发布时间:2019-05-24

本文共 1508 字,大约阅读时间需要 5 分钟。

主要的渲染和瓦片工具有这么几个:

 和:
 (XSLT)

 distributed rendering -
 desktop rendering
 mapnik-based tileserver
 for requesting bigger map images
...see 
开源就是开源啊,工具很丰富。早闻Mapnik大名,先来看看这个。

Mapnik

Mapnik is the software we use for  the main  layer for OSM, along with other layers such as the "cycle map" layer and "noname" layer. It is also the name given to the main layer, so things get a bit confusing sometimes.

Mapnik is a open source toolkit for rendering maps. It's written in C++ and includes high-level Python bindings. It uses the AGG library and offers anti-aliasing rendering with subpixel accuracy. It can read ESRI shapefiles,, TIFF rasters,  files, any GDAL or OGR supported formats. Packages are available for most Linux distributions and binaries are available for  and .

想要多了解的可以看这位仁兄的博文()。

具体的软件安装和下载地址可以根据自己系统的不同,参考这里来安装:

我是在winXP环境下安装配置的。

1、首先要下Python 2.7版本,教程给出的连接坏掉了,在网上随便搜了一个。

      安装在C:\Python27。

2、在这里下载windows下的Mapnik(),下载后是一个压缩包,解压后拷贝至c盘根目录下即可,即C:\mapnik-2.0.1rc0\...

3、添加环境变量。

path下添加两个:

;C:\mapnik-2.0.1rc0\lib;C:\Python27;

然后添加一个新的环境变量(如果不存在的话)PYTHONPATH,值为

C:\mapnik-2.0.1rc0\python\2.7\site-packages
4、在命令行中运行python

C:\Python27\python.exe

显示版本号等信息。

命令提示符变为>>>表示在python命令下,通过"Ctrl + Z" 或键入 "quit()"可退出python。输入命令:

from mapnik import *

没有报错。

测试mapnik中提供的例子:

提示pycario不可用,

(注:关于这个提示,我查了一下,大体是目前windows版本还不支持Cairo Rendering这个特性(参看:),所以不用担心这条提示)

稍等一下,在demo文件夹下,成功生成一些demo.*文件。

注:

在生成以上几张图片后,我这弹了这么一个错误。不知道是由于我的电脑的问题还是我的配置问题。由于个人对mapnik实在不怎么感冒,安装过程也比较纠结,这个问题先放这吧,了解的朋友劳烦赐教,或者告诉我你们有没有弹类似错误我们再进一步讨论一下。

参考文献:

1、

2

转载地址:http://kzrbi.baihongyu.com/

你可能感兴趣的文章
[LeetCode By Python]122. Best Time to Buy and Sell Stock II
查看>>
[LeetCode By Python]125. Valid Palindrome
查看>>
[LeetCode By Python]136. Single Number
查看>>
[LeetCode By Python]167. Two Sum II - Input array is sorted
查看>>
[LeetCode BY Python]169. Majority Element
查看>>
[LeetCode By Python]172. Factorial Trailing Zeroes
查看>>
[LeetCode By MYSQL] Combine Two Tables
查看>>
python jieba分词模块的基本用法
查看>>
[CCF BY C++]2017.12 最小差值
查看>>
[CCF BY C++]2017-12 游戏
查看>>
如何打开ipynb文件
查看>>
[Leetcode BY python ]190. Reverse Bits
查看>>
面试---刷牛客算法题
查看>>
Android下调用收发短信邮件等(转载)
查看>>
Android中电池信息(Battery information)的取得
查看>>
SVN客户端命令详解
查看>>
Android/Linux 内存监视
查看>>
Linux系统信息查看
查看>>
用find命令查找最近修改过的文件
查看>>
Android2.1消息应用(Messaging)源码学习笔记
查看>>