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

3D OGRSpatialReference::Transform is failed with PROJ 9.3 (regression!, it works with PROJ 9.2) #3909

Closed
aharondavid opened this issue Sep 28, 2023 · 1 comment
Assignees

Comments

@aharondavid
Copy link

aharondavid commented Sep 28, 2023

GDAL Version: 3.1.2
PROJ Version: 9.3
OS: Windows 11

Code to reproduced:

std::string SourceWKT ="GEOGCS["WGS84 Coordinate System",DATUM["WGS_1984",SPHEROID["WGS 1984",6378137,298.257223563],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]";

std::string DestWKT ="GEOCCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Geocentric X",OTHER],AXIS["Geocentric Y",OTHER],AXIS["Geocentric Z",NORTH],AUTHORITY["EPSG","4978"]]";

OGRSpatialReference sourceSR;
sourceSR.importFromWkt(SourceWKT.c_str());
sourceSR.PromoteTo3D(NULL);

OGRSpatialReference destSR;
destSR.importFromWkt(DestWKT.c_str());
destSR.PromoteTo3D(NULL);



OGRCoordinateTransformation*  ogrTransformation = OGRCreateCoordinateTransformation(sourceSR,destSR);

double X	=-0.31036012488063702;
double Y=	39.611038380093397;
double Z	=28.253883366008200;

int ret = ogrTransformation->Transform(X,Y,Z);
//Result:
//ret equal to 0
//X = inf
//Y = inf
//Z = inf
@rouault
Copy link
Member

rouault commented Sep 28, 2023

Transfering as a PROJ issue, and I don't confirm it is a regression. Using projinfo, I can reproduce the issue at least from PROJ 8.0.0 (didn't try older ones)

@rouault rouault transferred this issue from OSGeo/gdal Sep 28, 2023
@rouault rouault self-assigned this Sep 28, 2023
rouault added a commit that referenced this issue Sep 30, 2023
createOperations(): fix GeogCRS 3D with TOWGS84 to geocentric CRS (fixes #3909)
rouault added a commit that referenced this issue Oct 2, 2023
[Backport 9.3] createOperations(): fix GeogCRS 3D with TOWGS84 to geocentric CRS (fixes #3909)
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