-
Notifications
You must be signed in to change notification settings - Fork 213
Silence errors on overwriting GeoJSON #929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@sgillies Lines 1026 to 1064 in 6ee5939
Currently, there is a special treatment for the GeoJSON that overwrites local files. Would it make sense to have an overwrite=True/False flag in fiona.open() instead, that depending of the result of CPLCheckForFile either returns an error or overwrites? If you are interested, I could create a new PR with just this part. |
|
@rbuffat I'm 👎 on an overwrite option. I think the mode argument should cover everything. That said, I think I might be implementing "w" wrong for multi-layer formats. It doesn't truncate to zero (overwrite) in that case, where maybe it should. We could require "r+" to add layers to a multi-layer format? |
If I understand correctly the issue is that is not possible to differentiate between creating a new layer, or overwriting an existing file. If I understand correctly the OGR model strictly separates read and write mode, thus "r+" might be a bit confusing. Regarding the overwrite aspect, would you just use the existing behavior or having something to separate "w" for writing if the file or layer does not exist and "w!" or "w+" to overwrite a file or layer if it already exists. |
Resolves #771