GithubHelp home page GithubHelp logo

laferrieren / invar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from onyxfish/invar

0.0 2.0 0.0 200 KB

Command line tools for generating map images from Mapnik configuration.

Home Page: http://blog.apps.chicagotribune.com/

Python 96.84% Shell 3.16%

invar's Introduction

invar

Command line tools for generating map images from Mapnik configuration and uploading them to S3.

invar is named after a metal alloy frequently used in leveling rods and survey tapes.

Installation

invar only works with Mapnik2. Instructions for installing Mapnik2 can be found here. Once you have Mapnik2 installed you can install invar using pip:

pip install invar

It can be quite tricky to get Mapnik2 working within virtualenv, so it may be simpler/better to install invar in the global site-packages.

Usage

ivtile

ivtile renders continous tiles of the map, such as those used by Google Maps, Open Street Map, or any other "slippy" map provider.

invar tiler sample usage:

ivtile map.xml output_directory 32.4419 -95.393 32.2307 -95.301 10 16 --process_count 2

Details of each parameter are available via:

ivtile -h

ivframe

ivframe renders discontinous frames of the map centered on locations, such as an individual map for the area around each of a hundred bus stops.

invar framer rendering a single large frame to the current directory:

ivframe map.xml . 32.351 -95.301 --name filename_without_extension -w 1024 -t 768

invar framer rendering a series frames from latitude/longitude pairs in a CSV file:

ivframe map.xml output_directory --csv data.csv --name name_column  --process_count 2

Details of each parameter are available via:

ivframe -h

ivs3

ivs3 pushes a collection of tiles (or anything, really) into an Amazon S3 bucket using concurrent connections (so its super-fast).

Sample usage pushing a tiles directory into a bucket called "test_bucket":

ivs3 tiles_directory test_bucket -P

You must have your Amazon Web Services access credentials defined in the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables. The -P flag makes the uploaded files public. For a complete list of flags run:

ivs3 -h

Using with TileMill

In order to use invar with TileMill you need to convert TileMill's .mml configuration and .mss styles into a Mapnik .xml file. Here is an example of how to do this:

$TILEMILL_PATH/node_modules/carto/bin/carto map.mml > map.xml

Note: some versions of TileMill (0.10.1) print debug statements to STDOUT which can mess up the output of this conversion. If you see a line at the top of your output XML file like [millstone] finished processing '/path/to/my/file' then prefix your compile command with NODE_ENV=foo which will disable these statements.

Credits

Open Street Map

Much of this application is derived from selections of the Open Street Map project--notably generate_tiles.py.

Projects

invar was developed to address the needs of both @tribapps and the #hacktyler project.

Authors

License

MIT

invar's People

Contributors

joegermuska avatar laferrieren avatar onyxfish avatar

Watchers

 avatar  avatar

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.