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

Parameter +range in polynomial transformation +horner #4368

Open
Jochem-L opened this issue Jan 6, 2025 · 0 comments
Open

Parameter +range in polynomial transformation +horner #4368

Jochem-L opened this issue Jan 6, 2025 · 0 comments
Labels

Comments

@Jochem-L
Copy link
Contributor

Jochem-L commented Jan 6, 2025

I found two problems with the range parameter in the polynomial transformation +horner. I assume the range parameter was added because a polynomial transformation gives terrible results outside its area of validity.

Problem 1

The +range parameter (default value 500 000) applies on the input coordinates in the forward and inverse transformation. I think it should apply on the input coordinates in the forward transformation, but it should apply on the output coordinates in the inverse transformation. That would mean one can use the same range for the forward and inverse transformation. This is currently not the case, which is confusing.

Forward example
(echo 30000.00 100000.00 & echo 30000.00 120000.00) | cct -d 2 -z 0 +proj=horner +deg=3 +fwd_origin=0,0 
+fwd_u=+120025.8705,+0.999986846,-0.0250515e-8,+0.1471965e-14,+0.006918172,-0.0860518e-8,-0.0398590e-14,+0.0011249e-8,+0.4556545e-14,+0.1991105e-14 
+fwd_v=+390181.7849,+0.999993024,-0.0338879e-8,+0.1184845e-14,-0.006907254,-0.0492600e-8,-0.1945916e-14,+0.0222878e-8,+0.9244571e-14,-0.1091684e-14 
+inv_tolerance=0.001
    150717.96      489970.61          0.00           inf
    150857.90      509969.45          0.00           inf
Inverse example
(echo 150717.96 489970.61 & echo 150857.90 509969.45) | cct -d 2 -z 0 +proj=horner +deg=3 +fwd_origin=0,0 
+fwd_u=+120025.8705,+0.999986846,-0.0250515e-8,+0.1471965e-14,+0.006918172,-0.0860518e-8,-0.0398590e-14,+0.0011249e-8,+0.4556545e-14,+0.1991105e-14 
+fwd_v=+390181.7849,+0.999993024,-0.0338879e-8,+0.1184845e-14,-0.006907254,-0.0492600e-8,-0.1945916e-14,+0.0222878e-8,+0.9244571e-14,-0.1091684e-14 
+inv_tolerance=0.001 +inv
     30000.00      100000.00          0.00           inf
#Record 1 TRANSFORMATION ERROR: 150857.90 509969.45
 (Point outside of projection domain)

To solve the error, a different range parameter needs to be specified.

(echo 150717.96 489970.61 & echo 150857.90 509969.45) | cct -d 2 -z 0 +proj=horner +deg=3 +fwd_origin=0,0 
+fwd_u=+120025.8705,+0.999986846,-0.0250515e-8,+0.1471965e-14,+0.006918172,-0.0860518e-8,-0.0398590e-14,+0.0011249e-8,+0.4556545e-14,+0.1991105e-14 
+fwd_v=+390181.7849,+0.999993024,-0.0338879e-8,+0.1184845e-14,-0.006907254,-0.0492600e-8,-0.1945916e-14,+0.0222878e-8,+0.9244571e-14,-0.1091684e-14 
+inv_tolerance=0.001 +range=600000 +inv
     30000.00      100000.00          0.00           inf
     30000.00      120000.00          0.00           inf  

Problem 2

It makes no sense to use a range parameter if the origin is not in the centre of the area of use (e.g. in case of false easting and northing). A bounding box would be more appropriate.

In the example given above the input coordinates for the forward transformation are approximately:
-100 000 < x < +200 000
-100 000 < y < +200 000

But the input coordinates in the inverse transformation are:
0 < x < +300 000
+300 000 < y < +600 000

@Jochem-L Jochem-L added the bug label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant