-
Notifications
You must be signed in to change notification settings - Fork 9
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
Tests fail with GDAL 3.0.2 #16
Comments
It's also worth noting that Gohlke isn't producing Python 3.8 wheels for GDAL 2: https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal, so GDAL3 should really be in our future. |
Found some interesting things going on with difference between GDAL 3 and GDAL 2. Wanted to document this before signing off for the day. |
There was some pretty big changes to GDAL 3.0 relating to PROJ 6. Here are some notes: proj6-wkt2. This will take awhile to digest. |
It looks like the change with the axis order is the issue. Switching the points in pygeo This post sums it up quite well: OSGeo/gdal#1546 |
Came across a fresh error in tests for GDAL 3+
|
Instead of using next it might be better to call: GetNextFeature() from : https://gdal.org/python/osgeo.ogr.Layer-class.html#GetNextFeature. This allows the test to pass in GDAL 3. |
GDAL 3 expected test outputs will vary slightly in some cases from GDAL 2. Should we support both GDAL 2 and GDAL 3 test cases? |
Adding support to handle GDAL 3. This effectively ends support for GDAL 2. When using coordinate transformations now setting Axis properties to be 'friendly' which means to expect lon,lat as opposed to the now standard of lat,lon. This was recommonended in the migration guide from GDAL. Changing the values of a hardcoded test slightly as spatial references are slightly different in GDAL3, so minor extent differences are expected in some instances.
Adding python 3.8 to setup.py for support as all GDAL 3 testing has been done using python 3.8
Below is a post I made to the premature PR for this issue: I just spent a significant amount of time in the WKT2 docs, PROJ 6 docs, and GDAL 3 Docs. I think I'm starting to develop a deeper understanding. I think the basics are as follows:
note: Most projected CRS use Easting first, Northing second convention, however, some defined in the EPSG registry use the reverse convention. So, I think you're correct in that Perhaps a better solution is to create a mapping of Axis Order to Geographic (Lat,Lon) and Projected (Easting, Northing), such that when handling the extents and bounding box points we can correctly return x, y. |
There is no need to check if the SRS is geographic or projected, GDAL 3 appears to only swap when expected, like for lat/lon to lon/lat for GIS friendly axis order. Also removing the axis swapping in reproject_vector where the geometries actually handle this internally. Adding better comments.
This is needed because when the geometries are transformed to the target SRS, by default GDAL 3 will now return those as Lat,Lon, however they're handled as Lon,Lat. Setting this has the transformed geometries returned as Lon,Lat if using a geographic SRS
Adding tests to transform_bounding_box and reproject_vector functions where osr.CreateCoordinateTransformation are handled. The tests for transform bounding box use coordinates from a polygon made in QGIS in the New England Coastal area for WGS84 and UTM 19N. The expected results were varified in QGIS. The test for reproject vector handle all possible transformation cases in and out of WGS84 and Projected SRS. Specifically the latlon to latlon test checks that the vectors are identical as well as the SRS is as expected. To handle WGS84 I added a WGS84 reference to sampledata, following the conventions for the other used SRS.
Refactoring reproject_vector test functions to create their own vectors for transforming.
Like raster creation options, exposing OSR Axis Order Mapping Strategy for creating coordinate transformations in def transform_bounding_box and def reproject_vector.
Also adding conda-forge and anaconda to conda channels
Using setup-miniconda as opposed to setup-conda as this resource properly sets the GDAL_DATA and PROJ_LIB envs. Also setting GDAL to 3.0.4 as has better precision handling than 3.0.2 which is likely related to bug fixes in handling SRS and forcing transformations in and out of WGS84.
I'm closing this issue since the GDAL 3 PR has been merged and since there is another issue #44 that reflects why the tests are failing. |
In a new virtualenv, I pip installed
pygeoprocessing==1.9.1
using dependencies (including GDAL 3.0.2 from Gohlke) from our PyPI. 3 of our tests fail. I've attached the log from this test run here: gdal3_error_log.txtTests work great on the latest version of GDAL v2 (currently 2.4.2, I believe)
The text was updated successfully, but these errors were encountered: