Hi,

I found only an issue with having comma as a decimal separator. When I fixed 
that I got correct results both with GDAL 3.5.1 and with GDAL 3.6.0. Please 
tell if you have still some problem when the decimal separator is correct and 
present a new exact test case.

-Jukka Rahkonen-

Lähettäjä: Moises Calzado <mcalz...@carto.com>
Lähetetty: maanantai 21. marraskuuta 2022 13.27
Vastaanottaja: Rahkonen Jukka <jukka.rahko...@maanmittauslaitos.fi>
Aihe: Re: [gdal-dev] Latest GDAL version not transforming lat/lng into geom 
column

Yes, we noticed that!
I just shared a dataset with the wrong limiter. Sorry about that!

We've downgraded GDAL for the moment to the 3.5.1 version. Should I open an 
issue on GDAL repository, or is this one already being handled?
Thanks so much for your prompt help!


El lun, 21 nov 2022 a las 12:16, Rahkonen Jukka 
(<jukka.rahko...@maanmittauslaitos.fi<mailto:jukka.rahko...@maanmittauslaitos.fi>>)
 escribió:
Hi,

Did you ever notice that the result from GDAL 3.5.1 is wrong as well? You csv 
file has coordinates with a comma as a decimal separator and enclosed between 
double quotes
my_file.csv
=========
CD_MES,store_id,date_id,ticket_id,hour_id,lat,lon
202112,101,04/12/21,1,11,"19,38358","-99,183735"
202112,101,25/12/21,31,15,"19,38066","-99,183405"

The result that you considered right cuts the decimals
"POINT (-99 19)","202112","101",04/12/21,"1","11"
and I think that it is worse result that not getting coordinates at all.

Editing the csv file to present coordinates as numbers with point as a decimal 
separator gives correct result
my_file.csv
=========
CD_MES,store_id,date_id,ticket_id,hour_id,lat,lon
202112,101,04/12/21,1,11,19.38358,-99.183735
202112,101,25/12/21,31,15,19.38066,-99.183405
ogrinfo
======
"POINT (-99.183735 19.38358)","202112","101",04/12/21,"1","11"
"POINT (-99.183405 19.38066)","202112","101",25/12/21,"31","15"

-Jukka Rahkonen-

Lähettäjä: gdal-dev 
<gdal-dev-boun...@lists.osgeo.org<mailto:gdal-dev-boun...@lists.osgeo.org>> 
Puolesta Rahkonen Jukka
Lähetetty: maanantai 21. marraskuuta 2022 13.07
Vastaanottaja: Moises Calzado <mcalz...@carto.com<mailto:mcalz...@carto.com>>
Kopio: 'gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org>' 
(gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org>) 
<gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org>>
Aihe: Re: [gdal-dev] Latest GDAL version not transforming lat/lng into geom 
column

Hi,

I could reproduce with OSGeo4W version GDAL 3.6.0, released 2022/11/06.  I have 
also a bit older version GDAL 3.6.0dev from 
gisinternals.com<https://eur06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgisinternals.com%2F&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7Cd1b3cdc76e5f4ac1c4d508dacbb36468%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638046268606136045%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CdQC5ZIzPDzsMh1gVQLiIwTdFH1wy3ExoIa9dRPzhSg%3D&reserved=0>,
 probably installed 2022-05-16, and that version finds the geometries. So if it 
is not because of differences in build systems then something has happened 
after mid of May 2022.

-Jukka Rahkonen-


Lähettäjä: Moises Calzado <mcalz...@carto.com<mailto:mcalz...@carto.com>>
Lähetetty: maanantai 21. marraskuuta 2022 11.50
Vastaanottaja: Rahkonen Jukka 
<jukka.rahko...@maanmittauslaitos.fi<mailto:jukka.rahko...@maanmittauslaitos.fi>>
Aihe: Re: [gdal-dev] Latest GDAL version not transforming lat/lng into geom 
column

Hi Jukka,

Thanks so much for taking a look at this.

This is the result when running the command in the 3.5.1 version:

GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 
84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]
WKT,String,String,String,String,String
geom,CD_MES,store_id,date_id,ticket_id,hour_id
"POINT (-99 19)","202112","101",04/12/21,"1","11"
"POINT (-99 19)","202112","101",25/12/21,"31","15"

And this is what I obtained in the 3.6.0 version:

GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 
84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]
WKT,String,String,String,String,String
geom,CD_MES,store_id,date_id,ticket_id,hour_id
,"202112","101",04/12/21,"1","11"
,"202112","101",25/12/21,"31","15"

That's the file that I've used for testing: 
https://storage.googleapis.com/import-testing-stream/my_file.csv<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstorage.googleapis.com%2Fimport-testing-stream%2Fmy_file.csv&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7Cd1b3cdc76e5f4ac1c4d508dacbb36468%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638046268606136045%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=sdpdqcmMRLkwBoHKdEk0Ap%2BU%2Bkv%2FsqkoB%2BpG3%2B9FeQc%3D&reserved=0>



El lun, 21 nov 2022 a las 10:28, Rahkonen Jukka 
(<jukka.rahko...@maanmittauslaitos.fi<mailto:jukka.rahko...@maanmittauslaitos.fi>>)
 escribió:
Hi,

Please add a one line test file "my_file.csv" so we can try to reproduce. 
Confirm first that it fails with your GDAL version.

-Jukka Rahkonen-

Lähettäjä: gdal-dev 
<gdal-dev-boun...@lists.osgeo.org<mailto:gdal-dev-boun...@lists.osgeo.org>> 
Puolesta Moises Calzado via gdal-dev
Lähetetty: maanantai 21. marraskuuta 2022 11.21
Vastaanottaja: gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org>
Aihe: [gdal-dev] Latest GDAL version not transforming lat/lng into geom column

Hello everyone,

We've just updated to the latest GDAL version (v3.6.0) and it seems that 
something is not working correctly when trying to obtain a geom column from a 
CSV containing latitudes and longitudes.

This is the command that is being used:

ogr2ogr -f CSV -skipfailures -makevalid /vsistdout/ CSV:my_file.csv -simplify 
0.00001 -dim XY -t_srs EPSG:4326 -lco GEOMETRY=AS_WKT -lco GEOMETRY_NAME=geom 
-lco CREATE_CSVT=YES -s_srs EPSG:4326 -oo KEEP_GEOM_COLUMNS=NO -oo 
X_POSSIBLE_NAMES=point_longitude,longitude,longitud,lon,Lon,Longitude,longitudedecimal,decimallongitude,decimallong,lng,long,Lng
 -oo 
Y_POSSIBLE_NAMES=latitude,latitud,lati,lat,Latitude,decimallat,decimallatitude,latitudedecimal,point_latitude
 -oo 
GEOM_POSSIBLE_NAMES=geom,Geom,geometry,the_geom,wkt,wkb,wkt_geometry,wkb_geometry
 -oo EMPTY_STRING_AS_NULL=YES -oo QUOTED_FIELDS_AS_STRING=NO -lco PRECISION=NO 
-oo AUTODETECT_SIZE_LIMIT=500000

The file that is being processed contains a column called lat and another one 
called lon, and when I execute the same process on a docker container running 
the version 3.5.1 of GDAL it works like a charm. We've also tried to execute 
this process on the 3.5.3 version, and it also fails. Is that expected?

Looking forward to your response,
Regards!

--
Moises Calzado

Support Engineer

(US) +1 917 463 3232 | (ES) +34 911 165 823 | 
mcalz...@carto.com<mailto:mcalz...@carto.com>
[Lähettäjä poisti 
kuvan.]<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.carto.com%2F&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7Cd1b3cdc76e5f4ac1c4d508dacbb36468%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638046268606136045%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=mX7wdfy1GwL%2FArdFu81HrxNBU6UclvyOnWmhbet84Jk%3D&reserved=0>


--
Moises Calzado

Support Engineer

(US) +1 917 463 3232 | (ES) +34 911 165 823 | 
mcalz...@carto.com<mailto:mcalz...@carto.com>
[Lähettäjä poisti 
kuvan.]<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.carto.com%2F&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7Cd1b3cdc76e5f4ac1c4d508dacbb36468%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638046268606136045%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=mX7wdfy1GwL%2FArdFu81HrxNBU6UclvyOnWmhbet84Jk%3D&reserved=0>


--
Moises Calzado

Support Engineer

(US) +1 917 463 3232 | (ES) +34 911 165 823 | 
mcalz...@carto.com<mailto:mcalz...@carto.com>
[Lähettäjä poisti 
kuvan.]<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.carto.com%2F&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7Cd1b3cdc76e5f4ac1c4d508dacbb36468%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638046268606136045%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=mX7wdfy1GwL%2FArdFu81HrxNBU6UclvyOnWmhbet84Jk%3D&reserved=0>
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to