[gdal-dev] Set axis order with ogr2ogr
Elena Ruiz
eruiz at aplitop.com
Wed Feb 8 03:28:54 PST 2023
Ok, it works thank you very much
________________________________
Elena Ruiz
[https://www.aplitop.com/descargas/logo.png]
Sofware Development & Technical Support
Tel.: +34 952 43 97 71
eruiz at aplitop.com
www.aplitop.com
<http://www.aplitop.com/Product/es/6/5/tcptunnel>
<http://www.aplitop.com/New/es/281/mdt-75-a-la-venta>
De: Even Rouault <even.rouault at spatialys.com>
Enviado el: miércoles, 8 de febrero de 2023 11:58
Para: Elena Ruiz <eruiz at aplitop.com>; gdal-dev at lists.osgeo.org
Asunto: Re: [gdal-dev] Set axis order with ogr2ogr
Set PROJ_LIB as an environment variable (with set PROJ_LIB="D:\MDT\V9\bin\gdal\gdal_latest\share") rather than with --config, as --config is only for GDAL configuration options, and PROJ_LIB is only read by PROJ which reads environment variable.
And don't set OGR_CT_FORCE_TRADITIONAL_GIS_ORDER=YES. It is not needed here.
Le 08/02/2023 à 11:45, Elena Ruiz a écrit :
Hello, actually we use several versions of gdal and among them I have also tried it with the latest one, 3.6.2 in x64, but it gives me these errors:
ogr2ogr -f "ESRI Shapefile" "C:\Users\elena\Downloads\Recinto.shp" "C:\Users\elena\Downloads\Recinto.gml" --config OGR_CT_FORCE_TRADITIONAL_GIS_ORDER YES --config PROJ_LIB "D:\MDT\V9\bin\gdal\gdal_latest\share"
ERROR 1: PROJ: proj_create: no database context specified
ERROR 1: PROJ: proj_create: no database context specified
ERROR 1: PROJ: proj_create: no database context specified
ERROR 1: Field gml_id has a NULL content which is not allowed
ERROR 1: Unable to write feature 0 from layer LandCoverUnit.
ERROR 1: Terminating translation prematurely after failed
translation of layer LandCoverUnit (use -skipfailures to skip errors)
But several things happen, it does not establish the PROJ_LIB directory, I am indicating the directory where the proj.db is, but it ignores it, I don't know if it needs something else. It is not recognizing the OGR_CT_FORCE_TRADITIONAL_GIS_ORDER label either, because the destination file has not modified the order of the axes, and finally it detects some errors in the GML file, and the example file is a correct GML (https://aplitop.sharefile.com/d-scfcb397f54a649598913d6ae00d0d398 ). Thank you and I hope someone can help me, regards
________________________________
Elena Ruiz
[https://www.aplitop.com/descargas/logo.png]
Sofware Development & Technical Support
Tel.: +34 952 43 97 71
eruiz at aplitop.com<mailto:eruiz at aplitop.com>
www.aplitop.com<http://www.aplitop.com>
De: Even Rouault <even.rouault at spatialys.com><mailto:even.rouault at spatialys.com>
Enviado el: miércoles, 8 de febrero de 2023 11:10
Para: Elena Ruiz <eruiz at aplitop.com><mailto:eruiz at aplitop.com>; gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
Asunto: Re: [gdal-dev] Set axis order with ogr2ogr
Elena,
I almost choked when reading "I'm using GDAL 1.1.1". Do you realize this version was released 16 years ago ? Even GDAL 2.4.4 is antiquated. Nobody longer support those versions. Please upgrade to a recent (< 2 years) version first. I've just verified that ogr2ogr works just fine on our file with a recent version
Even
Le 08/02/2023 à 10:40, Elena Ruiz a écrit :
Hello, I need to do a conversion between GML to SHP vector files with the app ogr2ogr.exe, and be able to set the order of the axes TRADITIONAL_GIS_ORDER / AUTHORITY_COMPLIANT, in the OGR API documentation (ogr_srs_api.h), I found the following:
"This will honor the axis order advertised by the source and target SRS, as well as their “data axis to SRS axis mapping”. To have a behavior similar to GDAL < 3.0, the OGR_CT_FORCE_TRADITIONAL_GIS_ORDER configuration option can be set to YES."
And from here I have deduced that I could use the OGR_CT_FORCE_TRADITIONAL_GIS_ORDER tag to establish the order of the axes and I have used the following command line:
ogr2ogr -f "ESRI Shapefile" "C:\Users\elena\Downloads\Recinto.shp" "C:\Users\elena\Downloads\Recinto.gml" -co OGR_CT_FORCE_TRADITIONAL_GIS_ORDER YES
I am using GDAL 1.1.1 on x86, for this version of GDAL it does create the SHP file, it does not give an error when executed, but it does not make any change in the order of the axes of the destination file.
But I have also tried it with version 2.4.4 for x64 and in this case it gives me the following errors:
ERROR 1: Field gml_id has a NULL content which is not allowed
ERROR 1: Unable to write feature 0 from layer LandCoverUnit.
ERROR 1: Terminating translation prematurely after failed
translation of layer LandCoverUnit (use -skipfailures to skip errors)
I attach an example file in the following link: https://aplitop.sharefile.com/d-scfcb397f54a649598913d6ae00d0d398
I hope someone can tell me how I can do what I need, thanks and regards.
________________________________
[https://www.aplitop.com/descargas/firma1.jpg]
Elena Ruiz
Sofware Development & Technical Support
Tel. +34 952 43 97 71
eruiz at aplitop.com<mailto:eruiz at aplitop.com>
Sumatra, 9 - 29190 Málaga (Spain)
www.aplitop.com<http://www.aplitop.com>
[cid:image001.png at 01D93BB8.E4A06B40]<https://www.facebook.com/AplitopSL/> [cid:image002.png at 01D93BB8.E4A06B40] <https://twitter.com/aplitop> [cid:image003.png at 01D93BB8.E4A06B40] <https://www.linkedin.com/company/aplitop> [cid:image004.png at 01D93BB8.E4A06B40] <https://www.youtube.com/user/aplitop>
In accordance with the provisions of the European Regulation of Data Protection 2016/679 (Reglamento Europeo de Protección de Datos 2016/679), we inform you that the data and the information you provide us through this medium will be used by APLITOP, S.L., with C.I.F. B-92543396 and with address at C / Sumatra, 9, Malaga, 29190, in order to answer your questions and inform you about our products. The data provided will be kept as long as it does not request its cessation and will not be transferred to third parties except in cases where there is a legal obligation. You have the right to access your personal data, correct inaccurate data or request its deletion when the data is no longer necessary for the purposes that were collected, as well as any rights recognized in the RGPD 2016/679
_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/gdal-dev
--
http://www.spatialys.com
My software is free, but my time generally not.
--
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230208/8c12aed8/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 365 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230208/8c12aed8/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 619 bytes
Desc: image002.png
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230208/8c12aed8/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 468 bytes
Desc: image003.png
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230208/8c12aed8/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 817 bytes
Desc: image004.png
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230208/8c12aed8/attachment-0007.png>
More information about the gdal-dev
mailing list