GithubHelp home page GithubHelp logo

giggls / mapnik-stylesheets-polar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mazdermind/mapnik-stylesheets-polar

0.0 2.0 1.0 1.07 MB

Rendering OpenStreetMap with Mapnik into Polar-Centric Tiles or Images

Home Page: http://polar.openstreetmap.de/

Python 19.27% HTML 67.51% Perl 11.72% Shell 1.51%

mapnik-stylesheets-polar's Introduction

Rendering OpenStreetMap with Mapnik into Polar-Centric Tiles or Images


This is not the Style you should use to render arbitrary Images. The Style and the supplied Tools are specialized for rendering Polar Regions.


Welcome, if you have Mapnik and osm2pgsql installed and you want to render your own OSM tiles, you've come to the right place.

This is the development location of the Mapnik XML stylesheets powering http://polar.openstreetmap.de/

This directory also holds an assortment of helpful utility scripts for working with Mapnik and the OSM Mapnik XML stylesheets.

However, the easiest way to start rendering Mapnik tiles is to use the 'render_tiles.py' script located within this directory.

Quick References

If you need additional info, please read:

If you are new to Mapnik see:

Required

Mapnik >= 2.0.0 | The rendering library

osm2pgsql trunk | Tool for importing OSM data into PostGIS

Coastline Shapefiles

  • Download these locally using ./get-coastlines.sh

Antarctica data in PostGIS

Quickstart

git clone https://github.com/MaZderMind/mapnik-stylesheets.git mapnik-stylesheets-polar
cd mapnik-stylesheets-polar
./get-coastlines.sh
./generate_xml.py --epsg 4326 --extent -180,-90,180,90 --dbname=$USER --prefix ant --accept-none
wget https://download.geofabrik.de/antarctica-latest.osm.pbf
osm2pgsql --create --cache 1024 --database $USER --prefix ant --latlong antarctica-latest.osm.pbf

# render an image
./render_polar.py --style osm.xml --bbox -3000000,0,0,3000000 --file top-left --size 500x500

# render tiles
./render_polar_tiles.py --minzoom 1 --maxzoom 4 --threads 4 --style osm.xml

# render tiles around stations, peaks, islands, ... (NOTE: currently only McMurdo is counted as interesting)
./render_polar_tiles.py --minzoom 5 --maxzoom 18 --threads 4 --style osm.xml --only-interesting

# show tiles via view.html

Manually editing 'inc' files

To manually configure your setup you will need to work with the XML snippets in the 'inc' directory which end with 'template'.

Copy them to a new file and strip off the '.template' extension.

cp inc/datasource-settings.xml.inc.template inc/datasource-settings.xml.inc
cp inc/fontset-settings.xml.inc.template inc/fontset-settings.xml.inc
cp inc/settings.xml.inc.template inc/settings.xml.inc

Then edit the settings variables (e.g. '%(value)s') in those files to match your configuration. Details can be found in each file. Stick with the recommended defaults unless you know better.

Troubleshooting

If trying to read the XML with Mapnik (or any of the python scripts included here that use Mapnik) fails with an error like XML document not well formed or Entity 'foo' not defined, then try running xmllint, which may provide a more detailed error to help you find the syntax problem in the XML (or its referenced includes):

xmllint osm.xml --noout

Not output from the above command indicates the stylesheet should be working fine.

If you see an error like: warning: failed to load external entity "inc/datasource-settings.xml.inc" then this likely indicates that an include file is missing, which means that you forgot to follow the steps above to generate the needed includes on the fly either by using generate_xml.py or manually creating your inc files.

mapnik-stylesheets-polar's People

Contributors

giggls avatar hholzgra avatar mazdermind avatar

Watchers

 avatar  avatar

Forkers

hholzgra

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.