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

Got ERROR 1: Geotransform should define a north-up non rotated area, but area seems not rotated #11618

Closed
jonasdlindner opened this issue Jan 9, 2025 · 2 comments
Assignees

Comments

@jonasdlindner
Copy link

What is the bug?

In some cases the Geotransformation raises ERROR 1: Geotransform should define a north-up non rotated area, but area seems not rotated. See also the attached example.
example.zip

Steps to reproduce the issue

Unzip example.
gdal_create test.pdf -co COMPOSITION_FILE=pdfcomposition_working.xml
gdal_create test.pdf -co COMPOSITION_FILE=pdfcomposition_broken.xml
The last command raises the error mentioned before.

After investigation the error is happening here:

std::fabs(georeferencing.m_adfGT[4]) <

The second condition is not met, because

std::fabs(georeferencing.m_adfGT[4]) is not smaller than

1e-5 * std::fabs(georeferencing.m_adfGT[5]))

georeferencing.m_adfGT[4] has for example the value 4.76e-19 and
georeferencing.m_adfGT[5] has for example the value 0.
I would assume 4.76e-19 ≈ 0.

But maybe I'm wrong and the issue is somewhere different.
Any ideas how to resolve this?

Thanks in advance.

Versions and provenance

3.8.4, Package from Distribution. Ubuntu 24.04.1 LTS

Additional context

No response

@rouault
Copy link
Member

rouault commented Jan 9, 2025

But maybe I'm wrong and the issue is somewhere different.

The set of GCPs is inconsistent. It forms a "hour-glass" like shape if I might say. The fact that it "works" (actually it doesn't really) for working is just due to numerical precision luck/unluck

if I print the adfGT[] coefficients, I get:

$ gdal_create test.pdf -co COMPOSITION_FILE=pdfcomposition_working.xml
4.604582 0.002127 0.000000 5.500000 0.000000 0.000000
4.602405 0.002132 0.000000 5.500000 0.000000 0.000000

$ gdal_create test.pdf -co COMPOSITION_FILE=pdfcomposition_broken.xml
4.598406 0.002142 0.000000 5.500000 0.000000 0.000000
4.596238 0.002147 0.000000 5.500000 -0.000000 0.000000
ERROR 1: Geotransform should define a north-up non rotated area.

In both cases the fact that adfGT[5] is zero or close to it is a sign that the GCPs don't make sense. adfGT[5] is supposed to be the resolution in the Y axis. This can't be a zero value for a valid geotransform.

In #11620 I make GDALGCPsToGeoTransform() to fail in both cases

rouault added a commit to rouault/gdal that referenced this issue Jan 9, 2025
@jonasdlindner
Copy link
Author

@rouault Thanks for your fast response. You are right. Both cases are invalid.

rouault added a commit to rouault/gdal that referenced this issue Jan 10, 2025
rouault added a commit that referenced this issue Jan 10, 2025
rouault added a commit that referenced this issue Jan 10, 2025
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

No branches or pull requests

2 participants