Hi Idan, It is indeed this the issue. I was not aware of this change. Man, it has been a while since I have touched GDAL. Thanks a lot for your help.
Idan Miara <i...@miara.com> escreveu no dia sexta, 4/03/2022 à(s) 12:13: > > > On Fri, 4 Mar 2022, 13:12 Idan Miara, <i...@miara.com> wrote: > >> Hi, >> Are you familiar with the axis order that was introduced in gdal 3 and >> its affects on 4326? >> https://gdal.org/tutorials/osr_api_tut.html#crs-and-axis-order >> >> On Fri, 4 Mar 2022, 13:07 Hugo, <hfpmart...@gmail.com> wrote: >> >>> Hi guys, >>> >>> I'm having weird behavior using ogr and osr through python while >>> reprojecting point geometries. >>> >>> Following code: >>> wgs = osr.SpatialReference() >>> wgs.ImportFromEPSG(4326) >>> >>> etrs = osr.SpatialReference() >>> etrs.ImportFromEPSG(3763) >>> >>> geom = ogr.Geometry(ogr.wkbPoint) >>> geom.AddPoint(-9.10165,38.73981) >>> #geom.AddPoint(38.73981,-9.10165) >>> geom.AssignSpatialReference(wgs) >>> >>> reproj = osr.CoordinateTransformation(wgs, etrs) >>> geom.Transform(reproj) >>> >>> If I run it as it is I get wrong coordinates in the target SRS. However >>> if I switch X,Y when building the geometry (the commented line) I will get >>> the correct coordinates. What is weird is that I have another script >>> reading from geonames dataset and there this behavior doesn't happen. >>> >>> I'm using GDAL 3.4.1 installed through conda on Ubuntu 20.04. >>> >>> Any hints? >>> thanks in advance >>> >>> -- >>> Hugo Martins >>> _______________________________________________ >>> gdal-dev mailing list >>> gdal-dev@lists.osgeo.org >>> https://lists.osgeo.org/mailman/listinfo/gdal-dev >>> >> -- Hugo Martins
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev