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

PRF: Fix Photomod x-dem files georeference #1077

Merged
merged 4 commits into from Nov 14, 2018
Merged

Conversation

drons
Copy link
Contributor

@drons drons commented Nov 7, 2018

No description provided.

@@ -608,11 +608,11 @@ GDALDataset* PhPrfDataset::Open( GDALOpenInfo* poOpenInfo )
abDemMetadataOk[2] && abDemMetadataOk[3] )
{
adfGeoTrans[0] = adfDemMetadata[0];
adfGeoTrans[1] = (adfDemMetadata[1] - adfDemMetadata[0])/nSizeX;
adfGeoTrans[1] = (adfDemMetadata[1] - adfDemMetadata[0])/(nSizeX - 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a check somewhere that nSizeX != 1 and nSizeY != 1 ?
And generally when you do this, it means that the native geolocation is given with respect to pixel centre. So to go to GDAL convention of pixel-corner, you have to apply a half-pixel offset to gt[0], gt[3]

@drons
Copy link
Contributor Author

drons commented Nov 8, 2018

And generally when you do this, it means that the native geolocation is given with respect to pixel centre.

@rouault Thanks for the tip. On this issue, I need to consult with x-dem format developers. And after additional testing, I will let you know.

@drons
Copy link
Contributor Author

drons commented Nov 13, 2018

@rouault
We made a detailed comparison of the GDAL and the Photomod, now x-dem geolocation is read in the same way. If you have no objections, then I consider the task done.

@rouault rouault merged commit e1e0eb5 into OSGeo:master Nov 14, 2018
@drons
Copy link
Contributor Author

drons commented Nov 14, 2018

Thanks!

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.

None yet

2 participants