Giter VIP home page Giter VIP logo

polytiles's Introduction

PolyTiles

A script to get tiles from mapnik. Area can be defined by bbox, polygon or an OSM polygon; tiles can be served in image files or mbtiles. Run the script without parameters to see command line help.

Requirements

Mapnik and python-shapely package. Optional dependencies are python-psycopg2 and sqlite3.

Author and license

Written by Ilya Zverev, based on generate\_tiles\_multiprocess.py, licensed WTFPL.

polytiles's People

Contributors

zverik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

polytiles's Issues

IndexError: list index out of range

Hi,
when I run a polytiles.py script for mapnik rendering. It worked just fine until the error:
http://pastebin.com/XT6kSpw7
I used '--threads 8' but with 1 thread there is still the error.
My full command:
sudo ./polytiles.py -u postgres -b 20 52 21 52 -z 17 18 -t /osm/ --threads 8 -s /openstreetmap-carto/osm.xml

Add scale_factor and buffer-size

Hi !

Thanks for your work !

Could you had an option "--scale X" for hdpi screen ?

Line 250: self.m.buffer_size = 128*options.scale
Line 254: mapnik.render(self.m, im, options.scale)

from https://github.com/mapnik/mapnik/wiki/XMLConfigReference :

buffer-size: Default 0; Good value is usually tile size/2 to help avoid cut labels. This influences envelope used by placement detector ( i.e. 'avoid_edges' parameter). Also set maximum-extent, otherwise you will get problems for bboxes near the borders of your map.

&

https://github.com/mapnik/mapnik/wiki/Scale-factor

Thanks :)

EOFError with multithreaded mbtiles writing

I tried to generate mbtiles file using the following command:

polytiles.py -z 3 19 -m taxsee.mbtiles -s project.xml --host postgres-osm -d gis -u osm -a 0 --threads 4

And after ~20 seconds I've got an error:

13 5582 2497
13 5579 2497
11 1394 626
Process ThreadedWriterWrapper-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "../polytiles/polytiles.py", line 237, in run
    req, args = self.pipe.recv()
EOFError

Everything stuck then. Using --threads 1 solves the problem.
Also, issue doesn't shows up whether use plain tiles output to png files (not mbtiles).

command line help depends on python-psycopg2

calling the program when the optional python-psycopg2 is not installed yields

Traceback (most recent call last):
  File "polytiles.py", line 485, in <module>
    if options.bbox == None and options.poly == None and options.cities == None and options.list == None and options.area == None:
AttributeError: 'Namespace' object has no attribute 'cities'

instead, it should just display command line help.

render occurs even if not needed

Hi,

In directory output mode, polytiles always render tiles even if tile already exists

polytiles include in my old Mapnik sources verbose those tiles as 'exists' and skip rendering them

Regards,
Bruno.

Tile List Reading Broken

When a tile list is specified, this is parsed with the regular expression

m = re.search(r"(\d{1,2})\D+(\d+)\D+(\d+)", line)

in line 308.However, the required order of values in the list is "x, y, z", and x can have more than the two digits allowed in this regular expression.

Either the regular expression needs to be fixed, or the file format needs to be changed to "z, x, y" (on reading and writing).

Metatile rendering

To improve rendering speed and make tiles look more like at osm.org etc., render NxN tiles at once, and split them into images.

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.