[Gdal-dev] How to custom my "Projected Coordinate Systems" in OGR
Frank Warmerdam
warmerdam at pobox.com
Thu Mar 15 11:46:53 EDT 2007
ÚO½¨Ã÷ wrote:
>
> I use the class in ogr_spatialref.h to build a system with graphic UI to
> fulfill corrdinate system transformtion,
> But i find the *.csv files in $GDAL_DATA$ is hard to extend or to add a
> new customed coordinate system to it.
> I know that i can call statements like following to complete this
> task,but how do i store this configuration to these csv files?then next
> time user can only call it by ImportFromXXX() function.
>
> -------------
> oTargetSRS.SetProjCS( "XIAN80 Albers" );
> oTargetSRS.SetWellKnownGeogCS("EPSG:4610");
> oTargetSRS.SetACEA(27,45,0,105,0,0);
> -------------
Hi,
The .csv files are primarily intended for EPSG coordinate systems,
so it isn't really appropriate to extend them manually.
But you can add your own custom dictionaries in a manner similar
to gdal/data/cubewerx_extra.wkt. These dictionary files consist
of lines with a short name, a comma and then the WKT definition of
the coordinate system.
You can reference such a definition from SetFromUserInput() and
programs that use that function (such as s_srs, a_srs, t_srs
for gdal_translate, ogr2ogr and gdalwarp) using the form:
gdal_translate -a_srs DICT:cubewerx_extra.wkt,41001
Programmatically you can use the importFromDict() method on
the OGRSpatialReference.
To get the WKT from an OGRSpatialReference, for appending to the
dictionary file, you can use the exportToWkt() method.
Best regards,
--
---------------------------------------+--------------------------------------
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 | President OSGeo, http://osgeo.org
More information about the Gdal-dev
mailing list