Skip to content

Conversation

@pomadchin
Copy link
Member

@pomadchin pomadchin commented Mar 23, 2025

LCC ProjectInverse fix, and BasicCoordinateTransform.transform z cord cleanup fix which is not needed.

transformToGeocentricFromWgs84 takes z into the account:

public void transformToGeocentricFromWgs84(ProjCoordinate p) {
if (transform.length == 3) {
p.x -= transform[0];
p.y -= transform[1];
p.z -= transform[2];
} else if (transform.length == 7) {
double Dx_BF = transform[0];
double Dy_BF = transform[1];
double Dz_BF = transform[2];
double Rx_BF = transform[3];
double Ry_BF = transform[4];
double Rz_BF = transform[5];
double M_BF = transform[6];
double x_tmp = (p.x - Dx_BF) / M_BF;
double y_tmp = (p.y - Dy_BF) / M_BF;
double z_tmp = (p.z - Dz_BF) / M_BF;
p.x = x_tmp + Rz_BF * y_tmp - Ry_BF * z_tmp;
p.y = -Rz_BF * x_tmp + y_tmp + Rx_BF * z_tmp;
p.z = Ry_BF * x_tmp - Rx_BF * y_tmp + z_tmp;
}
}

Fixes #116

@pomadchin pomadchin added the bug label Mar 23, 2025
@pomadchin pomadchin changed the title LCC ProjectInverse readjustment, BasicCoordinateTransform.transform fix LCC ProjectInverse adjustment, BasicCoordinateTransform.transform fix Mar 23, 2025
@pomadchin pomadchin changed the title LCC ProjectInverse adjustment, BasicCoordinateTransform.transform fix LCC ProjectInverse adjustment, BasicCoordinateTransform.transform cleanup Mar 23, 2025
@pomadchin pomadchin merged commit 9a92e99 into master Mar 23, 2025
3 checks passed
@pomadchin pomadchin deleted the fix/transformer-wipe branch March 23, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python pyproj conversion results are different

2 participants