Opened 12 years ago

Closed 12 years ago

#4773 closed enhancement (fixed)

[PATCH] [FEATURE] allow to use gdaltindex on files with different CRS

Reported by: etourigny Owned by: warmerdam
Priority: normal Milestone:
Component: Utilities Version: svn-trunk
Severity: normal Keywords: gdaltindex, srs
Cc:

Description

I have written an improvement for gdaltindex, to overcome the limitation that CRS be identical for all input files. I am attaching it for review before committing.

The patch adds an option -t_srs to set the output srs, and performs transformation of the points if needed.

Attachments (1)

gdaltindex.patch (10.3 KB ) - added by etourigny 12 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by Even Rouault, 12 years ago

I believe you forgot to attach the patch. One important point is that I believe MapServer won't support such indexes properly. There's a warning that is emitted currently in that situation, so it is important that it is preserved to warn users (gdaltindex historical use case is for MapServer)

by etourigny, 12 years ago

Attachment: gdaltindex.patch added

comment:2 by etourigny, 12 years ago

Here is the patch. I did not change any warnings about mapserver (it's still there), but should it be shown explicitly when the t_srs option is given?

comment:3 by Even Rouault, 12 years ago

Looks good to me. A few remarks :

In the "if( hCT == NULL
!OCTTransform( hCT, 5, adfX, adfY, NULL ) )" case, it might be good to add the name of the raster file for which it occurs. And after the error message, I'm wondering if it shouldn't exit completely, because the points will be written unprojected, which will lead to an inconsistant output file. Or skipping that file and not inserting it in the tile index.
  • I suppose that the printf("did not destroy CT\n"); which looks like a debug trace should be removed.
  • In the .dox file, I'd suggest adding that a file generated with the -t_srs option will not be usable by MapServer (because the general description of the utiliy suggests that the "output is suitable for use with MapServer as a raster tileindex")
  • Extending autotest/utilities/test_gdaltindex.py to test the new option might be good.

comment:4 by etourigny, 12 years ago

Resolution: fixed
Status: newclosed

implemented in r24977 and new test in r24978

I followed our recommendations, when a file cannot be transformed it is skipped, and doc has been updated. Thanks.

Note: See TracTickets for help on using tickets.