[gdal-dev] How to set an OGRLayer's OGRSpatialReference?

Frank Warmerdam warmerdam at pobox.com
Wed Apr 2 23:12:52 EDT 2008


古荣彬 wrote:
> Hi,
>  
> We can get the OGRSpatialReference from OGRLayer,but can't set 
> OGRSpatialReference to OGRLayer.
>  
> When I changed the OGRSpatialReference of an OGRLayer, what should I do 
> to save that?

Gu Rongbin,

Currently the OGR model does not provide for changing the spatial
reference of an existing layer. It can only be established at
layer creation time (and is passed into the CreateLayer() function).

So, if you really want to change it through OGR you basically need
to copy the whole layer to a newly created layer.

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