Hi all, I hope this e-mel finds you well.
I am trying to read a shapefile layer from OGR from a C++ application following the tutorial found here: https://gdal.org/tutorials/vector_api_tut.html#reading-from-ogr We have difficulties with a layer containing PolyLines with several parts. The pre-existing code works fine for polylines having a unique part. Do you have any example or advice to help me implement a version that works for polylines containing several parts. My intention is to display each shape on a map, so I need to retrieve the coordinates of points and draw segment between points when relevant. Thanks a lot for your help. Kind regards, Roland //// CODE THAT WORKS for "simple" polylines but fails when dealiing with a polyline containing several parts int o = 0; for(auto y : poGeometry->toLineString()) { if (o == 0) { line.mInCoord = QGeoCoordinate(y.getX(), y.getY()); } else if (o == (poGeometry->toLineString()->getNumPoints() - 1)) { line.mOutCoord = QGeoCoordinate(y.getX(), y.getY()); } else { line.mPath.addCoordinate(QGeoCoordinate(y.getX(), y.getY())); } qDebug() << o; o++; }
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev