[gdal-dev] Convert OGRGeometry* to pointer to derived geometry type

Brook Milligan brook at nmsu.edu
Fri Aug 13 17:23:51 PDT 2021


I would like to convert a pointer to OGRGeometry into a pointer to the appropriate derived type based upon the result of wkbFlatten(geometry->getGeometryType()).  It used to be possible to do this with functions like geometry->toLineString().  However, it seems that those are all deleted with the OGR_FORBID_DOWNCAST_TO(name) macro, although the functions are listed in the API documentation.

How is this conversion supposed to be accomplished now?

Thanks for any pointers.

Cheers,
Brook



More information about the gdal-dev mailing list