-
Notifications
You must be signed in to change notification settings - Fork 23
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
Show append support in list_drivers #375
Comments
I am not directly sure if GDAL provides a way to query that information. In Fiona, those values are hardcoded in their In pyogrio, for listing the drivers that support writing, we use the Lines 103 to 129 in dff672c
But that doesn't say anything about append support. Looking at the code of ogr2ogr, it seems they first try to open in append mode, and if that fails open in normal mode, and if that works raise a specific error message about not being able to open an existing data source. This led me to realize that our current error message for failing Lines 165 to 171 in dff672c
But that message is not very helpful when the reason for this failure is that In [4]: df = geopandas.GeoDataFrame({"col": np.random.randn(10), "geometry": geopandas.points_from_xy(range(10), range(10))})
In [5]: pyogrio.write_dataframe(df, "test.gml") # works fine
In [6]: pyogrio.write_dataframe(df, "test.gml", append=True)
...
File pyogrio/_io.pyx:169, in pyogrio._io.ogr_open()
DataSourceError: 'test.gml' not recognized as a supported file format. It might help to specify the correct driver explicitly by prefixing the file path with '<DRIVER>:', e.g. 'CSV:path'. |
Fiona shows which drivers support appending in
fiona.supported_drivers
. Is there a way for pyogrio to do the same?The text was updated successfully, but these errors were encountered: