Opened 7 years ago

Closed 7 years ago

#6800 closed defect (invalid)

The coordiante reference system for BAG files is being decoded incorrectly.

Reported by: mduzee Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:


The coordinate reference system stored in the BAG (v1.4 and later) header uses the coordinate frame rotation convention (EPSG:9607). GDAL is expecting the Bursa-Wolf conversion (EPSG:9606).

The following information is from the OPENNS bitbucket wiki:

Since version 1.4 if the openns library the BAG metadata has supported the use of WKT (Well Known Text) to define the horizontal reference system. When the TOWGS84 tag is used in the datum definition we expect the values to use the Coordinate Frame Rotation convention (EPSG:9607).

The following information is from the GDAL documentation:

The parameters have the same meaning as EPSG transformation 9606 (Position Vector 7-param. transformation).

You can see from the code below that the BAG's reference system is not being converted correctly (rotation parameters need to be negated):

char* pszWKT = const_cast<char *>( pszSRCodeString );
if( oSRS.importFromWkt( &pszWKT ) != OGRERR_NONE )
    CPLError( CE_Failure, CPLE_AppDefined, "Failed parsing WKT string \"%s\".", pszSRCodeString );

    CPLDestroyXMLNode( psRoot );
    return OGRERR_FAILURE;

oSRS.exportToWkt( &pszProjection );

Change History (5)

comment:1 by Even Rouault, 7 years ago

Sample dataset and patch are welcome.

comment:2 by mduzee, 7 years ago

I will attach a patch and some data soon.

comment:3 by Even Rouault, 7 years ago

I don't see any attachment.

I believe OPENNNS must be wrong since it seems the consensus in WKT is about Bursa-Wolf convention. GeoTools also expect Bursa-Wolf:

Actually that's what the OGC 01-009 spec mentions too :

So is the BAG format using the coord frame rotation convention, or is it just an issue with the OPENNS software ? If so, then it should be fixed, and potentially GDAL could have a config option to alter the TOWGS84 coefficients on user request.

comment:4 by mduzee, 7 years ago

It was the BAG format that was supposed to be using coordinate reference frame. We have since contacted many of the software vendors producing BAGS, and it turns out that no one was following the BAG standard. Because of this it was decided to switch the BAG format to the Bursa-Wolf convention. So this ticket can just be closed since no changes are required.

comment:5 by Even Rouault, 7 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.