Lack of support for GDAL 2.0 is beginning to impact users. See #255. If someone has Fiona installed (linking the system GDAL) and upgrades their system GDAL to 2.0, Fiona breaks. If someone installs GDAL 2.0 (only) on their system and installs Fiona, Fiona is broken.
I tried to figure out more in detail what is needed to port fiona to gdal2. See https://github.com/Toblerity/Fiona/compare/master...rbuffat:gdal2
==1== 64bit
The 64bit datatypes need to be added in ogrext. The issue here is, that int in python2 there is the distinction between int and long while in python 3 only int exists.
==2== encoding
in test_bytescollection.py we have self.failUnlessEqual(self.c.encoding, 'utf-8'). This fails because self.c.encoding equals OGR_DETECTED_ENCODING = '-ogr-detected-encoding'
ograpi.OGR_L_TestCapability(
self.cogr_layer, OLC_STRINGSASUTF8) and
OGR_DETECTED_ENCODING)
The documentation states:
OLCStringsAsUTF8 / "StringsAsUTF8": TRUE if values of OFTString fields are assured to be in UTF-8 format. If FALSE the encoding of fields is uncertain, though it might still be UTF-8.
should therefore the test be changed to the following?
ograpi.OGR_L_TestCapability(
self.cogr_layer, OLC_STRINGSASUTF8) and
"utf-8")
== 3 == synctodisk:
ograpi.OGR_DS_SyncToDisk(cogr_ds) in ogrext.Session.sync returns an error code for the geopackage driver test and a few others
OGR_DS_SyncToDisk calls internally FlushCache. The API documentation says
"Using this method does not prevent use from calling GDALClose() to properly close a dataset and ensure that important data not addressed by FlushCache() is written in the file."
http://www.gdal.org/classGDALDataset.html#ab6421c7ec7068c274a030e22aa6609e1
Thus it sounds as synctodisk would not really be needed if the dataset is closed after creation
With adding 1 and commenting out 2 and 3 520 tests are ok and 1 is skipped. 2 and 3 need definitely more time investigating.
Note that also debian is considering moving to gdal 2.0 - fiona is one of the packages where the build fails in that case.
Just a followup note as a user. I ran into the GDAL2/fiona issue recently when trying to iterate through features (actually through the rasterstats package). @rbuffat's gdal2 branch worked for me as a quick fix. Let me know if/how I can best try to help (I don't know any of fiona's internals, but I am a C++/Python dev -- or at least I tell myself I am).
@gidden Do you encounter this problems also with the master branch of fiona? The gdal2 branch is outdated and was used to develop the changes necessary to support gdal 2.0. You should be fine with the master branch of fiona.
I jumped straight from the pip install version to building on your branch. I'll confirm when I'm back in the office tomorrow. Thanks for the heads up, @rbuffat.
Just confirmed, @rbuffat, the master branch does indeed work. The link in
the comments made it seem like these commits weren't merged in. Apologies.
On Mon, Jan 11, 2016 at 1:40 PM, René Buffat [email protected]
wrote:
@gidden https://github.com/gidden Do you encounter this problems also
with the master branch of fiona? The gdal2 branch is outdated and was used
to develop the changes necessary to support gdal 2.0. You should be fine
with the master branch of fiona.—
Reply to this email directly or view it on GitHub
https://github.com/Toblerity/Fiona/issues/259#issuecomment-170533729.
Any idea when a release will be made including these fixes?
Update: 1.7b1 is on PyPI now. See https://github.com/Toblerity/Fiona/issues/289.
Most helpful comment
Update: 1.7b1 is on PyPI now. See https://github.com/Toblerity/Fiona/issues/289.