Reading ShapeFiles and converting to CIM xml format using Qt SDK API

1472
2
Jump to solution
07-28-2021 09:57 PM
VikasGanesh
New Contributor II

Hi Team,

I am new to ArcGIS, I have few shapefiles now my task is to read the shapefiles contents and convert it to xml file (CIM format). I don't want to display this shapefiles in UI, I just need to read the contents of the shapefiles.  I am basically from C++ background, hence I prefer to use ArcGIS Runtime API  for Qt.

1. Can I able to read the shapefiles using ArcGIS Runtime API  for Qt ?

2. Is it possible to provide some hints or code snippets or API reference to achieve this task.

Any support in this regard is very helpful...

0 Kudos
1 Solution

Accepted Solutions
JamesBallard1
Esri Regular Contributor

Hi @VikasGanesh ,

I think some of this may be doable with the Runtime, but the workflow sounds better suited to ArcGIS Pro utilizing the export tools.

https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/export-data.htm

However, if you need a Runtime solution, you can use ShapefileFeatureTable class, and that will give you access to all the features in the Shapefile feature table.

https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-shapefilefeaturetable.html

Once it's loaded you can use the inherited methods from FeatureTable, like queryFeatures to find all features, read their info and write them out (somehow) directly to xml.

https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-featuretable.html#queryFeature...

When using queryFeatures, you can provide "1=1" as your whereClause to query all features.

https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-queryparameters.html#setWhereC...

I think that would get you there, but I still think ArcGIS Pro would be the best option is it is better suited to data export workflows.

I hope this helps.

View solution in original post

0 Kudos
2 Replies
JamesBallard1
Esri Regular Contributor

Hi @VikasGanesh ,

I think some of this may be doable with the Runtime, but the workflow sounds better suited to ArcGIS Pro utilizing the export tools.

https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/export-data.htm

However, if you need a Runtime solution, you can use ShapefileFeatureTable class, and that will give you access to all the features in the Shapefile feature table.

https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-shapefilefeaturetable.html

Once it's loaded you can use the inherited methods from FeatureTable, like queryFeatures to find all features, read their info and write them out (somehow) directly to xml.

https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-featuretable.html#queryFeature...

When using queryFeatures, you can provide "1=1" as your whereClause to query all features.

https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-queryparameters.html#setWhereC...

I think that would get you there, but I still think ArcGIS Pro would be the best option is it is better suited to data export workflows.

I hope this helps.

0 Kudos
VikasGanesh
New Contributor II

Thanks JamesBallard1, this is really a very useful information for me to start...🙂

0 Kudos