Ticket #4773 (closed enhancement: fixed)

Opened 9 months ago

Last modified 8 months ago

[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

gdaltindex.patch Download (10.3 KB) - added by etourigny 9 months ago.

Change History

Changed 9 months ago by rouault

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?)

Changed 9 months ago by etourigny

Changed 9 months ago by etourigny

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?

Changed 9 months ago by rouault

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.

Changed 8 months ago by etourigny

  • status changed from new to closed
  • resolution set to fixed

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.