Hi, I apologize that I don’t know Python, but I saved the projection strings into files and made a test with gdaltransform
gdaltransform -s_srs proj1.prj -t_srs proj2.prj Enter X Y [Z [T]] values separated by space, and press Return. 0 0 -4602842.82460905 0 0 Maybe your code does not do what you think it does. -Jukka Rahkonen- Lähettäjä: gdal-dev <[email protected]> Puolesta Tom Hayden Lähetetty: torstai 16. maaliskuuta 2023 6.14 Vastaanottaja: [email protected] Aihe: [gdal-dev] Reprojecting with Same Projection but Different Central_Meridians Hello - I apologize if this is not the right place to ask this question. This is a question about a specific set of projections and coordinate transformations using the osr/ogr libraries. Suppose I have two projections where the only thing that differs is the Central Meridian value. See below (these are from ArcGIS online by the way) >>> p 'PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-41.34804059746178],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]' >>> p2 = >>> """PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]""" I can load these >>> srs2 = osr.SpatialReference(wkt=p2) >>> srs = osr.SpatialReference(wkt=p) And then attempt a transformation >>> transform_func = osr.CoordinateTransformation(srs2, srs) >>> u = ogr.Geometry(ogr.wkbPoint) >>> u.AddPoint(0,0) >>> u.Transfrom(transform_func) But the end result is the same point that I originally put in. >>> u.ExportToWkt() 'POINT (0 0 0)' I would (I think?) expect to see a different x value, due to the changing central meridian. In theory, the reprojected point should be offset some. Maybe I'm missing something - is this a bug or am I mis-understanding the role of Central Meridian in projections. Regards -- Tom Hayden
_______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
