首页 > 编程语言 > 详细

Mapnik for java

时间:2021-02-20 09:51:24      阅读:111      评论:0      收藏:0      [点我收藏+]

目的

这是一个简单的基于Spring和libmapnik JNI的切片服务器。

要求

The mapnik-jni bindings for mapnik 3 will be needed. The original authors of Mapnik do not maintain such a tool, but there is a one available here:

需要mapnik3的mapnik-jni纽带:https://github.com/springmeyer/mapnik-jni。docs:https://spatialinteractive.github.io/mapnik-jni/javadocs/mapnik/package-summary.html

Mapnik的原始作者并不保管这个jni工具,但是可以在下面链接找到:

 git@github.com:jlnr/mapnik-jni.git

Once cloned, the repository will require the libmapnik3.0-dev package. Then a simple make will result in the build/dist/libmapnik-jni.so file to be generated.

Copy this libmapnik-jni.so to /usr/lib/jni/ directory, the libmapnik-jni.jar into /usr/share/java, then you should be done with the mapnik bindings setup.

Data

Using osm2pgsql, load a postgis database, then edit the file simplemap.xml, the postgresql configuration around line 140 to adapt to your setup.

Launch

$ mvn jetty:run

Then a minimalist webserver should be available at http://localhost:8080/demo.

Results

技术分享图片

Caveats

This is not much than a Proof-of-Concept ! Do not expect to use it in production, as there is no caching of the generated tiles, which can take ~ 1 minute on my computer to render ...

https://github.com/pmauduit/mapnik-java

Mapnik for java

原文:https://www.cnblogs.com/2008nmj/p/14418994.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!