On 1 March 2017 at 17:26, Ahmed Tolba <[email protected]> wrote: > Hi All, > > I’m trying to get the multi points out of a geometry, how would I retrieve > the points ? > > // Variable initialised to contain Geometry point data for the field at the > current index of i > > OGRGeometry *Geometry = Feature->GetGeometryRef(); > if(Geometry != NULL && > wkbFlatten(Geometry->getGeometryType()) == wkbMultiPoint) > { > OGRMultiPoint *poMultipoint = ( OGRMultiPoint * > )Geometry; > int NumberOfGeometries = > poMultipoint->getNumGeometries(); > > // get points > }
"Look at the code, Luke!" Namely, check implementation of the OGRMultiPoint::exportToWkt() method in http://svn.osgeo.org/gdal/trunk/gdal/ogr/ogrmultipoint.cpp There, you will find this loop: for( int i = 0; i < getNumGeometries(); i++ ) { OGRPoint *poPoint = (OGRPoint *) getGeometryRef( i ); .... } Best regards, -- Mateusz Loskot, http://mateusz.loskot.net _______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
