[gdal-dev] C++ interface to lists of coordinate systems in data dir ?

Lucena, Ivan ivan.lucena at pmldnet.com
Wed Sep 8 02:37:13 EDT 2010


Hi Alexandre,

Yes, that is an interesting idea. You can actually read the CSV files as OGR data source:

% ogrinfo gcs.csv -al | more
INFO: Open of `gcs.csv'
       using driver `CSV' successful.

Layer name: gcs
Geometry: None
Feature Count: 438
Layer SRS WKT:
(unknown)
COORD_REF_SYS_CODE: String (0.0)
COORD_REF_SYS_NAME: String (0.0)
DATUM_CODE: String (0.0)
DATUM_NAME: String (0.0)
GREENWICH_DATUM: String (0.0)
UOM_CODE: String (0.0)
ELLIPSOID_CODE: String (0.0)
PRIME_MERIDIAN_CODE: String (0.0)
SHOW_CRS: String (0.0)
DEPRECATED: String (0.0)
COORD_SYS_CODE: String (0.0)
COORD_OP_CODE: String (0.0)
COORD_OP_CODE_MULTI: String (0.0)
COORD_OP_METHOD_CODE: String (0.0)
DX: String (0.0)
DY: String (0.0)
DZ: String (0.0)
RX: String (0.0)
RY: String (0.0)
RZ: String (0.0)
DS: String (0.0)
OGRFeature(gcs):1
   COORD_REF_SYS_CODE (String) = 3819
   COORD_REF_SYS_NAME (String) = HD1909
   DATUM_CODE (String) = 1024
   DATUM_NAME (String) = Hungarian Datum 1909
   GREENWICH_DATUM (String) = 1024
   UOM_CODE (String) = 9122
   ELLIPSOID_CODE (String) = 7004
   PRIME_MERIDIAN_CODE (String) = 8901
   SHOW_CRS (String) = 1
   DEPRECATED (String) = 0
   COORD_SYS_CODE (String) = 6422
   COORD_OP_CODE (String) = 3817
   COORD_OP_CODE_MULTI (String) = 0
...

So Anders's application could browse those file using the GDAL/OGR C API and fill up his GUI. And 
that could be done in other wrappers too. Great.

Ivan

Alexandre Gacon wrote:
> The OGR CSV support is a supported driver and I think it will work 
> better than the built-in GDAL support (but perhaps it the same think).
> 
> Alexandre
> 
> On Tue, Sep 7, 2010 at 8:58 PM, Ivan Lucena <ivan.lucena at pmldnet.com 
> <mailto:ivan.lucena at pmldnet.com>> wrote:
> 
>      >  On Sep 7, 2010, at 8:59 AM, Anders Moe wrote:
>      >
>      >  >
>      >  > Hi everyone
>      >  >
>      >  > Creating a C++ enduser app I was wondering if there is a
>     programmatic way to read the various datums/projections etc. files
>     in the gdal data directory ? I would like to present these in the
>     interface if the user is to perform conversion, etc.
>      >
>      >  Anders,
>      >
>      >  There's no interfaces as far as I know.  People usually consume
>     the files in the GDAL_DATA directory using their favorite text
>     manipulation methods
> 
>     That is right, you can also the GDAL own CSV support:
> 
>     http://trac.osgeo.org/gdal/browser/trunk/gdal/port/cpl_csv.cpp
> 
>     Example of use are everywhere in the code, like here:
> 
>     http://trac.osgeo.org/gdal/browser/trunk/gdal/frmts/idrisi/IdrisiDataset.cpp#L2301
> 
>     I believe that CPL_CSV is not exposed on the GDAL API but it is
>     available for C  and C++ coders.
> 
>     Regards,
> 
>     Ivan
> 
>     _______________________________________________
>     gdal-dev mailing list
>     gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org>
>     http://lists.osgeo.org/mailman/listinfo/gdal-dev
> 
> 
> 
> 
> -- 
> Alexandre Gacon



More information about the gdal-dev mailing list