[IMAGEIO_EXT-42] Add capability to warp/reproject images on read using gdal.AutoCreateWarpVRT Created: 31/Jul/12  Updated: 30/Oct/12  Resolved: 30/Oct/12

Status: Resolved
Project: imageio-ext
Component/s: gdal-framework
Affects Version/s: current
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: newmanw10 Assignee: dany111
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 2 days
Time Spent: Not Specified
Original Estimate: 2 days
Environment:

All


Attachments: Java Source File GDALImageReader.java     Java Source File GDALImageReadParam.java     Java Source File GeoTiffTest.java     Text File imageio-42-patch.txt    

 Description   

The java GDAL bindings support warping a Dataset on the fly when reading an image using gdal.AutoCreateWarpVRT(...).

http://gdal.org/java/org/gdal/gdal/gdal.html#AutoCreateWarpedVRT(org.gdal.gdal.Dataset,%20java.lang.String,%20java.lang.String,%20int,%20double)

My suggestion is to modify GDALImageReader.read() to accept a new ImageReadParam extension (GDALImageReadParam) that contains the necessary information to pass to the AutoCreateWaprVRT method. The read method could check if the read param is a GDALImageReadParam and if the source projection is different from the destination projection create a virtual warped dataset from the original dataset.

This change would allow users of imageio-ext to warp images being read into any projection recognized by gdal.



 Comments   
Comment by newmanw10 [ 31/Jul/12 ]

Description of attached files:

GDALImageReader:
This reader has modifications to check if the ImageReadParam is of type GDALImageReadParam. If so it will check if the destination projection contained in the GDALImageReadParam is different from the source files projection. If it is different it will use the AutoCreateWarpedVRT from the original dataset.

GDALImageReadParam:
Extension of ImageReadParam used to pass read parameters specific to reading GDAL images. In this case this class contains parameters needed to warp an image on read.

GeoTiffTest:
A new test to pass a GDALImageReadParam with a different projection from the source image and read.

Comment by newmanw10 [ 01/Aug/12 ]

Attached a patch for the modified files. Please ignore the original files attached as there was a small bug. The patch file is correct.

Comment by dany111 [ 30/Oct/12 ]

Fixed on trunk. (check the latest github repository on master branch)
Need some test before porting it to 1.1.x series.

Generated at Sat Jan 21 15:14:22 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.