这是一个简单的基于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.
Using osm2pgsql
, load a postgis database, then edit the file simplemap.xml
, the postgresql configuration around line 140 to adapt to your setup.
$ mvn jetty:run
Then a minimalist webserver should be available at http://localhost:8080/demo
.
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
原文:https://www.cnblogs.com/2008nmj/p/14418994.html