Re: How to use fiona.open to overwrite existing GPKG file?
toggle quoted messageShow quoted text
Because a geopackage file can contain multiple layers, opening a layer in "w" mode does not overwrite the entire .gpkg file. If you want to overwrite a layer, you need to pass "overwrite=True" to fiona.open(). For example:
>>> with fiona.open("/tmp/coutwildrnp.gpkg", "w", driver="GPKG", crs=crs, schema=schema, layer="coutwildrnp", overwrite=True) as col:
>>> with fiona.open("/tmp/coutwildrnp.gpkg", layer="coutwildrnp") as col:
On Thu, Jun 6, 2019 at 7:05 AM <joe.huang@...> wrote:
I'm trying to overwrite a temporary file with fiona,open, but it throws an error. Is there a way to get around this?