[gdal-dev] OGR Field Types?

Stefan Keller sfkeller at gmail.com
Thu May 21 14:17:26 PDT 2015


Hi Even

I just see some type mod and subtype definitions for .csvt files in
the CSV docs [1] :
<<
In a single line the types for each column have to be listed with
double quotes and be comma separated (e.g., "Integer","String"). It is
also possible to specify explicitly the width and precision of each
column, e.g. "Integer(5)","Real(10.7)","String(15)". The driver will
then use these types as specified for the csv columns. Starting with
GDAL 2.0, subtypes can be passed between parenthesis, such as
"Integer(Boolean)", "Integer(Int16)" and "Real(Float32)"
<<

Following questions and suggestions about .csvt:
1. Do type names really have to be in double quotes?
2. Is the separator always comma or can it also be a semicolon?
3. What about a Geometry type with subtypes? I suggest to add
4. "Geometry(Easting)","Geometry(Northing)"
5. "Geometry" -- encoded in WKT; having subtype values WKT (default),
Point, LineString, Polygon.

What do you think?
This could also make QGIS "Add Delimited Text Layer..." even better.

--S.

[1] http://www.gdal.org/drv_csv.html

2015-04-29 22:57 GMT+02:00 Stefan Keller <sfkeller at gmail.com>:
> Salut Even,
>
> Merci!
>
> 2015-04-29 20:35 GMT+02:00 Even Rouault <even.rouault at spatialys.com>:
>> Stefan
>>>
>>> Questions:
>>> 1. How is 'binary' encoded? E.g. when defining binary in a CSV file,
>>> how is it encoded? Hex?
>>
>> There's no support in the CSV driver for binary data
>>
>>> 2. Can a field in a CSV input files have a IntegerList or a Binary?
>>
>> No. Well on writing, the IntegerList will be serialized as a string. But not
>> recognized as IntegerList on reading
>>
>>> 3. What is the value delimiter in a field of type IntegerList,
>>> Integer64List, RealList, StringList?
>>
>> The default serializatoin will be (number_of_elements:val1,val2,...,valn), but
>> currently it is truncated to 80 chracters
>>
>>> 4. "Boolean, Int16, Float32" are mentioned as subtypes. Are there more
>>> subtypes?
>>
>> Not currently. See https://trac.osgeo.org/gdal/wiki/rfc50_ogr_field_subtype
>>
>> Even
>>
>> --
>> Spatialys - Geospatial professional services
>> http://www.spatialys.com


More information about the gdal-dev mailing list