makinacorpus / landez

Landez operates with tiles, arranges them together into images or builds MBTiles files
GNU Lesser General Public License v3.0
135 stars 52 forks source link

Skip Missing Tile! #37

Open faridcher opened 9 years ago

faridcher commented 9 years ago

I am trying to convert an Mbtile file to a single raster. Landez gives me this error: ExtractionError: Could not extract tile (12, 2644, 1692) from Shiraz.sqlite
which simply means the mentioned tile is missing in the mbtile. I want to skip this tile and I want to add no data pixels instead that tile ( I'm exporting to Png). Here is my simple code:

import logging
from landez import ImageExporter

logging.basicConfig(level=logging.DEBUG)

ie = ImageExporter(mbtiles_file="Shi.sqlite") 

ie.export_image(bbox=(52.3615993,29.461357,52.682949,29.85397), zoomlevel=12, imagepath="shi12.png")

Is is possible to do so with landez? Thanks

leplatrem commented 9 years ago

Thanks for your feedback!

It is already supported for MBTiles creation using the ìgnore_errors option. Unfortunately this option is ignored in ImageExporter code ! We should fix that!

If you can do it, we would be pleased to review your pull request! Have a look at how it was done for MBTiles : https://github.com/makinacorpus/landez/commit/594d987896fb1bbb87d138905bbc0a68e89434f7 and mimic the idea :)