* detect output format using suffix * after mbtiles is done writing, replace with pmtiles based on map/image tables. * add method to write_json for writing json sub-object.