Hello all,
I am using the runtime SDK for Qt to display the content of a shapefile on a map. I am first creating a ShapefileFeatureTable from the shapefile, and then a FeatureLayer.
ShapefileFeatureTable* featureTable = new ShapefileFeatureTable(dataPath, this);
FeatureLayer* layer = new FeatureLayer(featureTable, this);
All works correctly and I see the region boundaries contained in the shapefile when I append the layer to the map. I can also choose the type of renderer to display the data.
What I want to do is find the center or centroid of each of these regions, maybe using the Envelope returned from an extent() function, and then connect different center points with custom polylines.
The problem is that I don't know how to get to the drawn data (points/polylines/polygons) contained in the shapefile. I tried using member functions from the FeatureTable class with no success. For example FeatureTable::numberOfFeatures() returns 0, and FeatureTable::fields() returns an empty list.
How can I access the region boundaries data that is drawn to be able to process it?
If possible, I would like to to everything in the runtime SDK.
Thank you very much for your help!
Jean-Philippe