[Gdal-dev] OGR - set layer's spatial reference
mateusz at loskot.net
Fri Nov 3 16:34:52 EST 2006
Frank Warmerdam wrote:
> Martin Dobias wrote:
>> I'm searching for a way how to change layer's spatial reference. It
>> seems that it can be set only when creating the layer with
>> OGRDataSource::CreateLayer(). Then, OGRLayer has function
>> GetSpatialRef(), but documentation says that the returned spatial
>> reference shouldn't be modified by application. Is there any way how
>> to modify it once layer has been created?
> No, I'm afraid not.
> In some cases you can go around OGR to modify it, for instance with direct
> SQL against postgis, or modifying the .prj for a shapefile.
Another, a kind of brute-force but not very fast solution
is to create new empty layer of the same geometry type, recreate
attributes schema, assign new SRS and rewrite all features from the
source layer to new one.
More information about the Gdal-dev