mapbox / mbutil

Importer and Exporter of MBTiles
http://mapbox.com/developers/
BSD 3-Clause "New" or "Revised" License
762 stars 199 forks source link

Add do_compression option #54

Closed petropavel13 closed 7 years ago

petropavel13 commented 10 years ago

When I try to use that function, number of tiles was reduced by half but size of database increases!

./mb-util --scheme=tms ~/coding/tiles_page/gits/ gits.mbtiles
./mb-util --do_compression --scheme=tms ~/coding/tiles_page/gits/ gits_compressed.mbtiles

sqlite3 gits_compressed_integer.mbtiles 'select count(*) from images;'
100818

sqlite3 gits.mbtiles 'select count(*) from tiles;'
200747

ls -sh | grep gits
264M gits.mbtiles
270M gits_compressed.mbtiles

Then I replaced type of field tile_id from string (uuid) to integer (aka regular foreign key) and I got following results:

ls -sh | grep gits
264M gits.mbtiles
270M gits_compressed.mbtiles
256M gits_compressed_integer.mbtiles

Is there any reason to use uuid instead of simple integer?

https://github.com/mapbox/mbutil/issues/38, https://github.com/mapbox/mbutil/issues/39, https://github.com/mapbox/mbutil/issues/40

springmeyer commented 10 years ago

Is there any reason to use uuid instead of simple integer?

Thanks for your contribution. I'm not sure about this without looking closer. But a good thing to check would be to see if a few other tools can still read the data properly.

bradh commented 9 years ago

Do you have time to work on the merge conflicts? If not, do you mind if I work on the patch and resubmit it?

springmeyer commented 9 years ago

@bradh that would be great if you can help review and update.

tmcw commented 7 years ago

Merged in https://github.com/mapbox/mbutil/pull/76