Opened 9 years ago

Closed 9 years ago

#24840 closed New feature (fixed)

Add Warp and Transform functionality for GDALRasters

Reported by: Daniel Wiesmann Owned by: nobody
Component: GIS Version: 1.8
Severity: Normal Keywords: raster gdal gis
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Warping and transforming (reprojecting) are fundamental operations on raster objects. Suporting those functions on GDALRaster objects makes the use of the raster api much more flexible.

Change History (13)

comment:1 by Daniel Wiesmann, 9 years ago

Created a pull request for the implementation. However, the patch still lacks testing and documentation.

https://github.com/django/django/pull/4694

Last edited 9 years ago by Daniel Wiesmann (previous) (diff)

comment:2 by Tim Graham, 9 years ago

Needs documentation: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

comment:3 by Claude Paroz <claude@…>, 9 years ago

In c078021:

Refs #24840 -- Added GDALRaster Warp and transform methods

Thanks to Tim Graham for the review.

comment:4 by Claude Paroz, 9 years ago

Resolution: fixed
Status: newclosed

comment:5 by Simon Charette, 9 years ago

Has patch: unset
Needs documentation: unset
Patch needs improvement: unset
Resolution: fixed
Status: closednew

Error on Oracle for the new gis_tests.gdal_tests.test_raster.GDALRasterTests.test_raster_transform test:

Traceback (most recent call last):
  File "/mnt/jenkinsdata/workspace/pull-requests-oracle/database/oracle11/python/python3.4/tests/gis_tests/gdal_tests/test_raster.py", line 266, in test_raster_transform
    ndv, ndv, 20, ndv, ndv, ndv, ndv,
AssertionError: Lists differ: [99, [118 chars]23, 99, 99, 99, 15, 21, 22, 99, 99, 99, 99, 20, 99, 99, 99, 64] != [99, [118 chars]23, 99, 99, 99, 15, 21, 22, 99, 99, 99, 99, 20, 99, 99, 99, 99]

First differing element 48:
64
99

  [99,
   99,
   99,
   99,
   4,
   99,
   99,
   99,
   99,
   2,
   3,
   9,
   99,
   99,
   99,
   1,
   2,
   8,
   13,
   19,
   99,
   0,
   6,
   6,
   12,
   18,
   18,
   24,
   99,
   10,
   11,
   16,
   22,
   23,
   99,
   99,
   99,
   15,
   21,
   22,
   99,
   99,
   99,
   99,
   20,
   99,
   99,
   99,
-  64]
+  99]

comment:6 by Claude Paroz, 9 years ago

Apparently, this error can also occur with SQLite or Postgres, so it does not seem to be related to the database engine. I wasn't able to reproduce locally, though.

comment:7 by Daniel Wiesmann, 9 years ago

Yes, this test uses the GDAL api only, so the failure is not related to the database. Maybe the gdal version? Where can I see the exact specification of the build environment?

comment:8 by Tim Graham, 9 years ago

The Jenkins wiki page has details about installed versions.

comment:9 by Daniel Wiesmann, 9 years ago

I was able to reproduce the same error on a fresh ubuntu precise where I installed the default gdal-bin, which turned out to be GDAL 1.7.3. So I guess the transform parameters or the sampling algorithm behave different for older gdal versions.

What is the best way to adapt to this? Add a flag to the test to check for the gdal version or find a test case that works for both?

Last edited 9 years ago by Daniel Wiesmann (previous) (diff)

comment:10 by Claude Paroz, 9 years ago

Let's skip the test for older GDAL versions...

comment:11 by Daniel Wiesmann, 9 years ago

Ok I narrowed down the gdal version, the test works from 1.8.1 forward (tested versions using this). Here is a patch for the version checker

https://github.com/geodesign/django/commit/effdc27c60d670a5d393127e0d0be572fe5ec8ae

comment:12 by Claude Paroz <claude@…>, 9 years ago

In b647ccfa:

Refs #24840 -- Added skip flag to raster transform test for GDAL<1.8.1.

Thanks to Simon Charette for the report.

comment:13 by Claude Paroz, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top