[Gdal-dev] why I can't use the method CSVGetField()?

Frank Warmerdam warmerdam at pobox.com
Tue Nov 8 10:32:20 EST 2005


On 11/8/05, lky <moon_inwell at 163.com> wrote:
>
> Hello,everyone:
>     I use the method to read ellipsoid data from "data\ellipsoid.csv".I
> include the "cpl_csv.h",but there are so many build error after I include
> the header file.
...
> so I have two questions:
> 1.Why I can't use the method CSVGetField()?

Kunyang,

I see that CSVGetField was not declared to be exported from
the DLL (no CPL_DLL attribute).  I have corrected this in CVS.
If you change the cpl_csv.h to declare it as:


const char CPL_DLL *CSVGetField( const char *, const char *, const char *,
                                 CSVCompareCriteria, const char * );

And rebuild GDAL completely you might find you can use the method.

I don't know why you are getting some many other conflicts.

> 2.If I want to read the ellipsoid data from "data\ellipsoid.csv", how I can
> do?

I believe you could call CSVScanFile() to fetch batch the line
matching a given ellipsoid code in a single call.

eg.
char **fields = CSVScanFile( "ellipsoid.csv", 0, "7001", CC_ExactString );

Good luck,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list