[gdal-dev] C++ Getting OGRGeometry out of GDALDataset

Johannes Paul johannespaul92 at gmail.com
Fri Oct 14 00:51:32 PDT 2022


Hello,
Is there a way to get the OGRGeometry object out of a GDALDataset object in
c++?
My GDALDataset is a raster and i would like to get the associated
OGRPolygon out of it.
I've used:
srcDataset->GetLayer(0)->GetNextFeature()->GetGeometryRef()->toPolygon()
However i keep getting segmentation faults error.
Any help would be appreciated.
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221014/fc22b12a/attachment.htm>


More information about the gdal-dev mailing list