[gdal-dev] Assigning SpatialReference to OGRLayer

Anders Moe anders.moe at geocap.no
Mon Aug 23 14:41:55 EDT 2010


Hi everyone

I was wondering how I should assign a spatial reference to my OGRLayer.

virtual OGRSpatialReference<http://www.gdal.org/ogr/classOGRSpatialReference.html>
 * OGRLayer::GetSpatialRef<http://www.gdal.org/ogr/classOGRLayer.html#75c06b4993f8eb76b569f37365cd19ab>
 ()


There  seems to be no SetSpatialRef method. The current spatial reference is
null, since it was imported from a shapefile without spatial ref, so I can
not simply fill in the values of the existing sref object. I tried assigning
to each geometry, but this seems less than elegant, and the layer still
returns 0.

Thanks in advance,
Anders
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100823/db20d23c/attachment.html


More information about the gdal-dev mailing list