Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rs2dataset.cpp #1668

Merged
merged 3 commits into from
Jun 24, 2019
Merged

Update rs2dataset.cpp #1668

merged 3 commits into from
Jun 24, 2019

Conversation

an-ivanov
Copy link
Contributor

What does this PR do?

Radarsat 2 driver: correct affine GeoTransform calculation (fix #1666)

What are related issues/pull requests?

#1666

The Affine GeoTransform is wrongly calculated , while the "positioningInformation" being assumed as AREA_OR_POINT=POINT (point coordinates from a "mapCoordinate" item is assumed to be a center of the pixel). But really the map projection coordinates from "positioningInformation" are AREA_OR_POINT=AREA (the coordinates of pixel corners). That could be proved by equal coordinate values of these point from "geodeticCoordinate" data and corresponding coordinates of GCP data. As a result of that, georeferencing performed from GeoTransform and GCP point data are different with a half pixel shift and slightly wrong scaled.
@rouault
Copy link
Member

rouault commented Jun 22, 2019

Are you really sure about that ?
GDAL geotransform convention is to go expose the georegistration of formats with PixelIsCenter convention as PixelIsArea.
Perhaps the right fix would be to add +0.5 to dfGCPPixel and dfGCPLine instead ?

@an-ivanov
Copy link
Contributor Author

Yes, you are right. According to the document https://spacedata.copernicus.eu/documents/12833/14537/Radarsat-2_ProductFormatDefinition Chapter A "IMAGE CO-ORDINATE REFERENCE SYSTEMS" all coordinates of the product are related to PixelIsCenter, except direct GeoTiff goereferencing which is corrected to be PixelIsArea.
So, what should I do, close issue #1666 and open a new one and create a new pull requests? Or edit this one?

@rouault
Copy link
Member

rouault commented Jun 24, 2019

So, what should I do, close issue #1666 and open a new one and create a new pull requests? Or edit this one?

You can just update the issue and this pull request (git commit --amend and force push)

@an-ivanov
Copy link
Contributor Author

There are doubts appeared, do the dfGCPPixel and dfGCPLine coordinates belong to the AREA_OR_POINT=Area model. I can not find the information in GDAL manuals. Or it should follow a model defined in GDALMD_AREA_OR_POINT, being AREA_OR_POINT=Area as default?

@rouault
Copy link
Member

rouault commented Jun 24, 2019

There are doubts appeared, do the dfGCPPixel and dfGCPLine coordinates belong to the AREA_OR_POINT=Area model

I guess so. This might not be explicited in the doc, but this is the practice in other drivers and how the GCP transformer works as far as I can remember. AREA_OR_POINT=Area is the dominant model in GDAL. AREA_OR_POINT is mostly a metadata hint in GDAL to indicate format encoding convention (for example in the GeoTIFF driver, this will influence whether a half-pixel shift is done between GDAL GeoTransform and GeoTIFF tiepoint) that has no influence on GDAL algorithms.

@rouault rouault merged commit ddcf131 into OSGeo:master Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong Radarsat 2 GCP coordinates calculation
2 participants