Git Product home page Git Product logo

docker-mapnik's Introduction

docker-mapnik

Mapnik Docker container with Node and Python bindings

Building

โ— Ensure your Docker build environment, be it a VM (if you use Docker for Mac or Windows) or bare metal, has at least 4 gigabytes of memory. Any less and you'll have to enjoy hella swapping.

  • Do docker build -t mapnik .. It will take a long while, so best get another coffee.

Contents of the image

  • Ubuntu 16.04 LTS
  • Mapnik 3.0.10 (at the time of writing)
  • Node.js 6.x

Node bindings

  • /opt/node-mapnik contains the Node bindings.
  • They are npm linked, so any apps requiring them should be able to just npm link mapnik.

Python bindings

  • /opt/python-mapnik contains the Python bindings.
  • The bindings are built for both Python 2.x and 3.x, and installed system-wide.
  • If your app requires a virtualenv, pip install -e /opt/python-mapnik is likely your best bet.
  • Otherwise, just --system-site-packages your virtualenv or don't use a virtualenv at all.

Test apps

  • The basic Python world-rendering script is installed in /opt/demos/world.py.

    • Use cd /opt/demos; python2 world.py to try that Python 2.x works.
    • Use cd /opt/demos; python3 world.py to try that Python 3.x works.
    • The script outputs a world.png. You can use docker cp to look at it.
  • The Node.js "render a map from a stylesheet" demo is installed in /opt/demos/world.js.

    • Use cd /opt/demos; npm i mapnik; node world.js to try it. You'll get a crapload of deprecation warnings (see the related bug) since we're running Node 6, but the script does output a map.png anyway. You can use docker cp to look at it.

docker-mapnik's People

Contributors

akx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

docker-mapnik's Issues

are these warnings a problem? Probably not.

Just FYI -- possible to avoid these potentially alarming warnings (below).

For example "-Wno-unknown-pragmas"
https://stackoverflow.com/questions/18257854/pragma-gcc-diagnostic-warning-with-gcc

D

scons: Reading SConscript files ...
Using previous successful configuration...
Re-configure by running "python scons/scons.py configure".

Welcome to Mapnik...

scons: done reading SConscript files.
scons: Building targets ...
c++ -o src/renderer_common/render_group_symbolizer.os -c -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -pthread -ftemplate-depth-300 -Wsign-compare -Wshadow -O3 -fPIC -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DLINUX -DMAPNIK_THREADSAFE -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -Ideps -Ideps/agg/include -Iinclude -I/usr/include -I/usr/include/freetype2 -I/usr/include/postgresql -I/usr/include/gdal -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 src/renderer_common/render_group_symbolizer.cpp
In file included from include/mapnik/transform_processor.hpp:28:0,
from include/mapnik/attribute_collector.hpp:27,
from src/renderer_common/render_group_symbolizer.cpp:24:
include/mapnik/value.hpp:1012:32: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
#pragma GCC diagnostic ignored "-Wmismatched-tags"
^
c++ -o src/renderer_common/render_markers_symbolizer.os -c -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -pthread -ftemplate-depth-300 -Wsign-compare -Wshadow -O3 -fPIC -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DLINUX -DMAPNIK_THREADSAFE -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -Ideps -Ideps/agg/include -Iinclude -I/usr/include -I/usr/include/freetype2 -I/usr/include/postgresql -I/usr/include/gdal -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 src/renderer_common/render_markers_symbolizer.cpp
In file included from include/mapnik/attribute.hpp:28:0,
from include/mapnik/vertex_converters.hpp:28,
from src/renderer_common/render_markers_symbolizer.cpp:25:
include/mapnik/value.hpp:1012:32: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
#pragma GCC diagnostic ignored "-Wmismatched-tags"

Where is 110m-admin-0-countries.zip?

Hey akx,
Sorry to keep pestering you. In the Dockerfile, at line 31 of commit t bcfdbb1, we see COPY 110m-admin-0-countries.zip ... but alas, said file is nowhere to be found. I'm sure I could fix this, so if you'd like a change request, I'd be happy to discuss further how to that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.