Limited type support in OGR CSV driver

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

Limited type support in OGR CSV driver

Sébastien Grignard-2
Hello.
I've added type support for the CSV driver.
With these patches you can now write a little csv help file to indicate
the columns types to OGR.
It works as follow :
  - suppose you have a foobar.csv file that looks like this :
    "ID","X","Y","AREA","NAME"
    "1","1023.5","243.56","675","FOOBAR"
    ...
  - now write a foobar.csvt file like this one :
    "Integer","Real","Real","Integer","String"
The driver will then use the types you specified for the csv columns.
The only types recognized are Integer,Real and String.

Cheers.

--
Sebastien Grignard
R&D Developer
Archivideo
40, rue des Veyettes - 35000 Rennes FRANCE
Phone: +033 2 99 86 30 20


_______________________________________________
Gdal-dev mailing list
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev

ogrcsvpatch.zip (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Limited type support in OGR CSV driver

Frank Warmerdam-2
On 6/17/05, Sebastien Grignard <[hidden email]> wrote:

> Hello.
> I've added type support for the CSV driver.
> With these patches you can now write a little csv help file to indicate
> the columns types to OGR.
> It works as follow :
>   - suppose you have a foobar.csv file that looks like this :
>     "ID","X","Y","AREA","NAME"
>     "1","1023.5","243.56","675","FOOBAR"
>     ...
>   - now write a foobar.csvt file like this one :
>     "Integer","Real","Real","Integer","String"
> The driver will then use the types you specified for the csv columns.
> The only types recognized are Integer,Real and String.

Sebastien,

I have applied this change.  There have been somewhat
similar proposals before, but what I like about yours is that it
depends on an optional external file so simple access still works
as it did.

Would you consider submitting a patch for drv_csv.html describing
the feature for users?  Does the csv driver write these files out too?
If you were feeling really ambitious you could even supply additions
to gdalautotest/ogr/ogr_csv.py testing the new capabilities.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent
_______________________________________________
Gdal-dev mailing list
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev