invar 0.1.0

About

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.

ivframe rendering a single large frame to the current directory:

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

ivframe supports 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

  • Christopher Groskopf

License

The MIT License

Copyright (c) 2015 Christopher Groskopf and contributers

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Release process

  1. Ensure these files all have the correct version number:
    • CHANGELOG
    • setup.py
    • docs/conf.py
  2. Tag the release: git tag -a x.y.z; git push --tags

  3. Roll out to PyPI: python setup.py sdist upload

  4. Iterate the version number in all files where it is specified. (see list above)

  5. Flag the new version for building on Read the Docs.

  6. Wait for the documentation build to finish.

  7. Flag the new release as the default documentation version.

  8. Announce the release on Twitter, etc.

Changelog

0.1.0

  • Add CHANGELOG.
  • Add AUTHORS.
  • Add docs.
  • Fix several issues with broken tile queues. (#6)
  • Add SVG output support. (#13)
  • Update dependency version requirements. (#10)

Indices and tables