Display ENC data using QML

4860
9
11-18-2018 08:18 PM
StephenKrauss
New Contributor II

Hello,

I'm attempting to display ENC data using QML but being new to both Qt creator and the ArcGIS SDK, I'm having trouble following the sparse documentation. It's not clear to me if/when I'm supposed to be calling the component load functions, how to create an EncCell from an EncExchangeSet dataset, and how to add an EncLayer to a map view. I believe I have loaded an EncExchangeSet component, but I'm not sure where to go from there. Is there sample code that I can look at somewhere for displaying ENC data using QML?

Thanks in advance.

Tags (3)
9 Replies
EricBader
Occasional Contributor III

Hello Stephen,

While putting together an example for you, we've discovered a bug that needs to be addressed before it can work properly. We will try to address this as soon as possible. Thank you for your patience!

StephenKrauss
New Contributor II

Eric,

Thanks for the help, I look forward to the bugfix and example.

TMPTMP1
New Contributor II

Could you describe what the bug is? Will it completely prevent us form using the ENC, or does it cause some edge case crashes?

If it's a completely showstopper, what's the approximate ETA on the bugfix? 

KennSebesta
New Contributor III

Any update on this? I was using the ENC today and noticed that I get different results depending on whether I use QQuickView or QQMLApplicationEngine. 😮

In a nutshell, if I use QQuickView, then setting the map's extents works correctly. If I use QQMLApplicationEngine, then the extents are off by some skewing factor. It's almost as if the ENC layer draws itself into a separate larger bounding box. 


It'd be nice to know if this was related to the bug mentioned above. It's driving me crazy right now.

0 Kudos
LucasDanzinger
Esri Frequent Contributor

Could you please message me a simple project that demonstrates the issues you are seeing? Thanks!

0 Kudos
LucasDanzinger
Esri Frequent Contributor

The bug Eric was referring to was in the QML API only (no C++ issues). The issue was that the load cycle in QML was not working correctly which could cause the EncLayer to not display at all. 

0 Kudos
KennSebesta
New Contributor III

Just curious if there is any final resolution on whatever the bug was. I think it's resolved now because there's a QML example for the AddEncExchangeSet, but it would be nice to close out this topic since it still is at the top of the search engines.

0 Kudos
EricBader
Occasional Contributor III

If it helps at all, the C++ API is working brilliantly...

  // create EncExchangeSet using paths
 encExchangeSet = new EncExchangeSet(QStringList("D:\\Enc\\ExchangeSetwithoutUpdates\\ENC_ROOT\\CATALOG.031"), this);

 connect(encExchangeSet, &EncExchangeSet::doneLoading, this, [this]{

       // get the list of EncDataset
       QList<EncDataset*> EncDatasets = encExchangeSet->datasets();

       // display the names of EncDataset
       for (EncDataset* EncDataset: EncDatasets)
       {

          // Create the cell and layer
          myEncLayer = new EncLayer(new EncCell(EncDataset));

          // Add the layer to the map
          m_map->operationalLayers()->append(myEncLayer);

       }
 });

 // Load the EncExchangeSet
 encExchangeSet->load();

 // Set map to map view
 m_mapView->setMap(m_map);
0 Kudos
StephenKrauss
New Contributor II

Thanks Eric, I did manage to get it working with the C++ API and your example.

0 Kudos