mb-util export/import -> no such file error

benedikt's Avatar

benedikt

09 Aug, 2012 01:33 AM

hello tilemillers,

i am trying to post-process (e.g. color correction and a other effects) some tiles in a .mbtiles file (including teaser interaction) ... i am able to get the tiles extracted out of the .mbtiles file via the mb-util.

the extract works fine with
mb-util bos311_IX_baselayer.mbtiles tiles

but then creating out of the untouched tiles a new .mbtiles always fails
mb-util tiles bos311_new.mbtiles

error message is this one

INFO:mbutil.util:Importing disk to MBTiles
DEBUG:mbutil.util:tiles --> bos311_new.mbtiles
INFO:mbutil.util:metadata from metadata.json restored
Traceback (most recent call last):
  File "/usr/local/bin/mb-util", line 5, in <module>
    pkg_resources.run_script('mbutil==0.1.0', 'mb-util')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 489, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1214, in run_script
    exec script_code in namespace, namespace
  File "/Library/Python/2.7/site-packages/mbutil-0.1.0-py2.7.egg/EGG-INFO/scripts/mb-util", line 58, in <module>

  File "build/bdist.macosx-10.7-intel/egg/mbutil/util.py", line 158, in disk_to_mbtiles
IOError: [Errno 2] No such file or directory: 'tiles/1.0.0/bos311_IX_baselayer/1289.png'

and as the last line says, there is no such file ... it seems there is something wrong with the paths scheme, mb-util expects:
tiles/1.0.0/bos311_IX_baselayer/1289.png but has created earlier (extract) tiles/1.0.0/bos311_IX_baselayer/11/618/1289.png

wondering now how to resolve this or whether this is even a bug? i uploaded my file for verification, just in case.

furthermore, let's assume it would have worked, i don't understand how to get the teaser interactivity from my old .mbtiles back to the new one. is there an easy way to merge everything in the end together. unfortunately i am not at all familiar with sql.

many thanks,
benedikt

  1. 2 Posted by Petr Pridal - Klokan Technologies GmbH on 10 Aug, 2012 03:51 PM

    Petr Pridal - Klokan Technologies GmbH's Avatar

    It is a bug of mb-util. I fixed that in a separate branch:
    https://github.com/klokantech/mbutil

    You can try this version of mbutil.

    Hopefully this fix will find it's way into the official tree:
    https://github.com/mapbox/mbutil/pull/34

    It would be great to make also new release of mb-util on http://pypi.python.org/pypi, because this is quite an important bug.

  2. 3 Posted by benedikt on 10 Aug, 2012 09:05 PM

    benedikt's Avatar

    hello petr,

    many thanks for the bugfix and the confirmation!
    fingers crossed for the pull request and an update of mb-util in the very near future.

    best, benedikt

  3. Support Staff 4 Posted by Tom MacWright on 20 Aug, 2012 03:57 PM

    Tom MacWright's Avatar

    Pull request is accepted, and I've pushed a v0.1.1 to PyPI with it. You may also want to try the Alpstein fork, which has continued moving after mbutil development has eased off.

  4. Tom MacWright closed this discussion on 20 Aug, 2012 03:57 PM.

  5. benedikt re-opened this discussion on 21 Aug, 2012 02:46 PM

  6. 5 Posted by benedikt on 21 Aug, 2012 02:46 PM

    benedikt's Avatar

    Hello Tom,

    thanks fixing mb-util and the hint for the Alpstein fork! I am now able to export, import and merge tile sets. But unfortunately I still have no idea how to deal with the second part of my initial post: "how to get the teaser interactivity from my old .mbtiles back to the new one". It seems importing tiles kills always the utf8grid. I tried for instance here to combine the tiles of MapA (till zoom level 14), the UTF8Grid of MapB (all zoom levels) and the tiles of MapB (starting from zoom level 15). I used these commands (Alpstein fork):

    Extract the tiles
    ./mb-util --export --max-zoom=14 MapA.mbtiles tiles

    Import the tiles to MapB, existing tiles are correctly overwritten, but UTF8Grid Interaction is also gone
    ./mb-util --import tiles MapB.mbtiles

    This was my attempt to copy the UTF8Grid back to MapB from an untouched backup file, without success.
    ./mb-util --merge --no-overwrite MapB.mbtiles MapB_untouched_backup.mbtiles

    Any hint is very welcome :)
    Many thanks, Benedikt

  7. Support Staff 6 Posted by Tom MacWright on 21 Aug, 2012 02:52 PM

    Tom MacWright's Avatar

    Hi,

    So far neither the MapBox fork nor Alpstein fork have grid support; if you want to try adding it (or helping Alpstein add it), that'd work. It's probably better to use mbpipe or similar for the kind of task you're going for, rather than exporting/importing MBTiles. Otherwise.. unfortunately we just don't use mb-util much at MapBox so it doesn't get much development time.

    Tom

  8. 7 Posted by benedikt on 21 Aug, 2012 03:18 PM

    benedikt's Avatar

    Hello Tom,

    thanks for the swift response! But mapmaking with and around web-technologies is still pretty new to me. So contributing something feels at the moment just a bit out of my realm (but I am optimistic for the future). Furthermore I had a look on the mbpipe documentation ... Bot one more tiny hint how to get an alien tile in this pipeline would be great. Something like this?

    mbpipe 'cat path_to_other_tiles/%1' file.mbtiles

    or directly a hack in bin/mbpipe ?

    As you can see I am a bit lost.

    Benedikt

  9. System closed this discussion on 28 Mar, 2013 10:22 PM.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

25 May, 2013 02:19 PM
25 May, 2013 09:12 AM
25 May, 2013 08:30 AM
25 May, 2013 01:00 AM
25 May, 2013 12:58 AM

 

25 May, 2013 12:20 AM