Select to view content in your preferred language

Reading a set of shp, shx, prj and png files with ArcGIS runtime Qt/QML

847
2
05-18-2021 04:49 PM
ChristopherProbst
New Contributor

Hello Everybody,

I am new to this so my ignorance will probably shine. I have a set of files on my local filesystem:
de_100km.png,
de_100km.prj,
de_100km.shp,
de_100km.shx

I believe they altogether represent the different regions of Germany. I am looking into reading these files into a ArcGIS runtime Qt/QML data structure. I would like to be able to color different regions of a map of Germany. What would be the best data-structure for this? Is there a Qt/QML/C++ example that does this?

Thank-you in advance,
Christopher

 

0 Kudos
2 Replies
LucasDanzinger
Esri Frequent Contributor

Hey Christopher-

 

Couple of suggestions.

 

1) First, to display the shapefile, you will need to create a ShapefileFeatureTable with the path to the .shp, and display that table with a FeatureLayer. Here is a sample for that - https://github.com/Esri/arcgis-runtime-samples-qt/tree/main/ArcGISRuntimeSDKQt_CppSamples/Layers/Fea... 

2) A shapefile is a data format that consists of multiple files. You mention the proj, shp, and shx, but you will also need a dbf, which contains your attribute information. Without it, your shapefile will likely not load correctly. More info on that here - https://desktop.arcgis.com/en/arcmap/10.3/manage-data/shapefiles/shapefile-file-extensions.htm 

 

3) For customizing the display of the layer, you'll first need to display a feature layer as described in step 1, which will give you some default symbology applied automatically. After your layer is created, you will need to create a UniqueValueRenderer, which allows you to display a unique symbol per unique value in your table (in your case, some region ID or code) as described in this sample - https://github.com/Esri/arcgis-runtime-samples-qt/tree/main/ArcGISRuntimeSDKQt_CppSamples/DisplayInf...  

ChristopherProbst
New Contributor

Thank-you so  much Lucas. We are going to explore your suggestions and come back here with our findings. But this is incredibly helpful. Thank-you again.

0 Kudos