Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-08 Thread Moises Calzado via gdal-dev
t; >> >> >> -Jukka Rahkonen- >> >> >> >> *Lähettäjä:* gdal-dev *Puolesta *Moises >> Calzado via gdal-dev >> *Lähetetty:* perjantai 5. toukokuuta 2023 12.32 >> *Vastaanottaja:* gdal-dev@lists.osgeo.org >> *Aihe:* Re: [gdal-dev

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-05 Thread Robert Hewlett
* gdal-dev@lists.osgeo.org > *Aihe:* Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line > breaks inside columns > > > > Hi Even! > > > > I've just created the two issues: > > - https://github.com/OSGeo/gdal/issues/7699 > > - https://github.co

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-05 Thread Rahkonen Jukka
Lähetetty: perjantai 5. toukokuuta 2023 12.32 Vastaanottaja: gdal-dev@lists.osgeo.org Aihe: Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns Hi Even! I've just created the two issues: - https://github.com/OSGeo/gdal/issues/7699 - https://github.com/OSGeo/gdal

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-05 Thread Moises Calzado via gdal-dev
Hi Even! I've just created the two issues: - https://github.com/OSGeo/gdal/issues/7699 - https://github.com/OSGeo/gdal/issues/7700 Robert, as I explained before, we need the `/vsistdout/` driver as we're processing the file in streaming mode, so we can't save the result to the storage.

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-04 Thread Even Rouault
Moises, please fild 2 issues in the github issue tracker: - one about /vsistdout/ where .csvt and .prj content shouldn't be emitted - one about decoupling the layer GEOMETRY_NAME creation option with CREATE_CSVT=YES Even Le 04/05/2023 à 13:58, Moises Calzado via gdal-dev a écrit : Hi

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-04 Thread Robert Hewlett
Hi. Here is an image of your dataframe.shp converted to CSV displayed in QGIS: https://i.imgur.com/6f6VFNf.png The dot CSV file in Excel and Calc https://i.imgur.com/twmfIPp.png On Thu, May 4, 2023 at 6:07 AM Robert Hewlett wrote: > Hi, > > Traced back through the thread and found your

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-04 Thread Robert Hewlett
Hi, Traced back through the thread and found your sample data set and was able to convert it to a CSV file that both Calc, Excel and QGIS loaded without issue. The command I used the three files ogr2ogr -f CSV df.csv dataframe.shp -lco CREATE_CSVT=YES -lco GEOMETRY=AS_WKT -lco GEOMETRY_NAME=geom

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-04 Thread Moises Calzado via gdal-dev
Hi Robert! I think that we're losing a bit the main issue that we reported, as in fact the problem is related with line breaks in the output generated while using /vsistdout and the CREATE_CSVT=YES option. Even pointed out that avoiding that flag it works as expected, but when it's used the

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-03 Thread Robert Hewlett
Hi, I just tested with : GDAL 3.6.4, released 2023/04/17 Using the ogr2ogr as follows: ogr2ogr -f CSV poi_out.csv poi.shp -lco CREATE_CSVT=YES I get three files but no geometry ogr2ogr -f CSV poi_out.csv poi.shp -lco CREATE_CSVT=YES -lco GEOMETRY=AS_WKT I get three file with the geometry as WKT

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-03 Thread Robert Hewlett
Hi, Not to start a controversy but it feels like the standard hints at three files. Did the standard change? If it is three files which works for me in QGIS and geopandas i.e. data lands where it is suppose to, then more layer creations options are needed to handle the SRID/CRS

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-03 Thread Moises Calzado via gdal-dev
Hi Robert, Yes, we're getting one with all the info! El mié, 3 may 2023 a las 18:14, Robert Hewlett () escribió: > Just to clarify, instead of getting three files you are getting one with > all the info: types, projection, data? > > https://giswiki.hsr.ch/GeoCSV > > On Wed, May 3, 2023 at 8:57 

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-03 Thread Robert Hewlett
Just to clarify, instead of getting three files you are getting one with all the info: types, projection, data? https://giswiki.hsr.ch/GeoCSV On Wed, May 3, 2023 at 8:57 AM Moises Calzado via gdal-dev < gdal-dev@lists.osgeo.org> wrote: > We're also specifying the GEOM_POSSIBLE_NAMES, so it

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-03 Thread Moises Calzado via gdal-dev
We're also specifying the GEOM_POSSIBLE_NAMES, so it would be great if with that option we could use the GEOMETRY_NAME without using the CREATE_CSVT=YES option. Regarding emitting the .prj and .csvt in /vsistdout mode, that's why I'm saying that there is an issue while generating the resultant

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-03 Thread Robert Hewlett
The .CSVT and .PRJ help to make a proper geocsv dataset. Helps with QGIS And geopandas. The column name that I use in the CSV is usually geom and WKT shows up in the CSVT file which seems to be a one line file that hints at the data types in the CSV file. I hope that makes sense. CSVT Integer,

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-03 Thread Even Rouault
Le 03/05/2023 à 14:22, Moises Calzado via gdal-dev a écrit : Hi Even, Thanks so much for taking a look into that one! I have one doubt regarding the CSVT content, as we're not really using it, but it's required when using the GEOMETRY_NAME layer creation option, as can be checked in the CSV

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-05-03 Thread Moises Calzado via gdal-dev
Hi Even, Thanks so much for taking a look into that one! I have one doubt regarding the CSVT content, as we're not really using it, but it's required when using the GEOMETRY_NAME layer creation option, as can be checked in the CSV driver documentation: >- > >GEOMETRY_NAME=name

Re: [gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-04-29 Thread Even Rouault
Moises, as far as I can see with your example, the CSV driver behaves "properly" in reading and writing of field values with line breaks. It follows the "Fields with embedded line breaks must be quoted" rule of https://en.wikipedia.org/wiki/Comma-separated_values $ ogr2ogr out.csv

[gdal-dev] Ogr2ogr CSV driver not handling correctly line breaks inside columns

2023-04-24 Thread Moises Calzado via gdal-dev
Hello! We're trying to convert a Shapefile into a CSV using ogr2ogr and we're having some issues while dealing with some columns that contain line breaks inside their values. If we have a line with the following string, ogr2ogr detects that the line break is a new line and it returns two lines.