Opened 12 years ago

Closed 5 years ago

#4298 closed enhancement (wontfix)

Strict mode for parsing SRS strings

Reported by: simonf Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: Utilities Version: unspecified
Severity: normal Keywords: gdal_translate
Cc: Kurt Schwehr

Description

As discussed in person, it may be disconcerting when "gdal_translate -a_srs" silently ignores SRS fields it does not understand. I'd like to have a strict mode - eg, have a flag named "--strict_srs" that is set to false by default. The strict mode would raise an error any time it encounters an SRS field it does not understand or that cannot be expressed in the target format.

Change History (5)

comment:1 by warmerdam, 12 years ago

Component: defaultUtilities
Keywords: gdal_translate added

Simon, do you mind if I paste the problem SRS into the ticket? It raises a couple distinct kinds of "faithful reproduction" issues.

I'd be inclined to treat "strict mode" as wider than just the SRS. Among other things it should control the "bStrict" flag to CreateCopy(), and we could actually have the gdal_translate utility itself do some validation after translation.

Ah, I see we already have a -strict flag to do this. So we can just extend gdal_translate to do more based on it.

For the case in question it might also be that the GeoTIFF driver should be doing a better job of writing hard to translate SRSes to .aux.xml or special in-tiff tags.

comment:2 by simonf, 12 years ago

Frank - feel free to use the SRS.

As for writing more data to GeoTIFF - sure, but this should be reversible. When I later read the file using GDAL, I should, obviously, get back exactly what I put in. If that's not possible, I want strict mode to raise an error as well.

comment:3 by warmerdam, 12 years ago

The problem (assigned with -a_srs to gdal_translate) was:

PROJCS["MODIS Sinusoidal",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.01745329251994328,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Sinusoidal"],
    PARAMETER["false_easting",0.0],
    PARAMETER["false_northing",0.0],
    PARAMETER["central_meridian",0.0],
    PARAMETER["semi_major",6371007.181],
    PARAMETER["semi_minor",6371007.181],
    UNIT["m",1.0],
    AUTHORITY["SR-ORG","6974"]]

comment:4 by Kurt Schwehr, 10 years ago

Cc: Kurt Schwehr added

comment:5 by Even Rouault, 5 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.