mapbox / rio-mbtiles

A plugin command for the Rasterio CLI that exports a raster dataset to an MBTiles 1.1 SQLite file
MIT License
125 stars 36 forks source link

Use a semaphore for sqlite writes #55

Closed dazza-codes closed 4 years ago

dazza-codes commented 4 years ago

Related to #51

Just in case some deadlocks might be related to access to sqlite, wrap the tile data writes in a semaphore. (Replaces #53 without removing multiprocessing; hasn't been tested on larger inputs where occasional dead locks are found, so dead-locks might still occur if they are somehow related to contention over reading the global src data or running short on memory while processing tiles.)

Adds outputs of an empty tile-record for tiles with no src-data, since mbview crashes when src is totally empty of all data (something about max_zoom is not defined).

sgillies commented 4 years ago

Thanks, but as I said in #53, we don't have any evidence that there's a problem with our use of sqlite3.