[gdal-dev] Quete_string_fields creation option for CSV

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Quete_string_fields creation option for CSV

jratike80

Hi,

 

See this https://gis.stackexchange.com/questions/279960/ogr2ogr-create-csv-with-strings-wrapped-in-double-quotes

 

The GDAL CSV driver supports quoted string fields in reading but I suppose that data can’t be written like that.

 

-Jukka Rahkonen-


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Quete_string_fields creation option for CSV

Even Rouault-2
On mercredi 18 avril 2018 20:48:12 CEST Rahkonen Jukka (MML) wrote:
> Hi,
>
> See this
> https://gis.stackexchange.com/questions/279960/ogr2ogr-create-csv-with-stri
> ngs-wrapped-in-double-quotes
>
> The GDAL CSV driver supports quoted string fields in reading but I suppose
> that data can't be written like that.

Now it is possible:

[master 2a269ed] CSV: add a STRING_QUOTING=YES layer creation option to force
double-quoting of strings (and other non-numeric fields)

Even


--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Quete_string_fields creation option for CSV

Even Rouault-2

On mercredi 18 avril 2018 23:43:11 CEST Even Rouault wrote:

> On mercredi 18 avril 2018 20:48:12 CEST Rahkonen Jukka (MML) wrote:

> > Hi,

> >

> > See this

> > https://gis.stackexchange.com/questions/279960/ogr2ogr-create-csv-with-str

> > i

> > ngs-wrapped-in-double-quotes

> >

> > The GDAL CSV driver supports quoted string fields in reading but I suppose

> > that data can't be written like that.

>

> Now it is possible:

>

> [master 2a269ed] CSV: add a STRING_QUOTING=YES layer creation option to

> force double-quoting of strings (and other non-numeric fields)

 

Actually I've reworked this to be

 

STRING_QUOTING=IF_NEEDED/IF_AMBIGUOUS/ALWAYS (Starting with GDAL 2.3): whether to double-quote strings. IF_AMBIGUOUS means that string values that look like numbers will be quoted (it also implies IF_NEEDED). Defaults to IF_AMBIGUOUS (behaviour in older versions was IF_NEEDED)

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Quete_string_fields creation option for CSV

jratike80
In reply to this post by jratike80
Even Rouault wrote:
Re: [gdal-dev] Quete_string_fields creation option for CSV
 
> Actually I've reworked this to be
 
> STRING_QUOTING=IF_NEEDED/IF_AMBIGUOUS/ALWAYS (Starting with GDAL 2.3): whether to double-quote strings. IF_AMBIGUOUS means that string values that look like numbers will be quoted (it also implies IF_NEEDED). Defaults to IF_AMBIGUOUS (behaviour in older versions was IF_NEEDED)
 
Feels like a good set of options and I will probably enjoy IF_AMBIGUOUS myself sooner or later because we have IDs with leading zeroes here and there.

-Jukka-
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev