Qt and ArcGIS Runtime SDK - Help, Advice and Best Practices

1066
5
11-02-2017 10:59 AM
KevinWebster
New Contributor II

I'm looking to upgrade an existing Qt Widgets application which allows the end user to track sub-sea assets, displaying the tracking data on a display supporting ENC nautical charts (S-57 and S-63).

Having downloaded and installed the ArcGIS  Runtime SDK for Qt as well as reading through the comprehensive development guides and SDK reference, I'm looking for some help and advice with various features and aspects of the existing application which I want to migrate across to ArcGIS.

Also, as this is my first foray into the ArcGIS world, I'd be grateful of best practice advice where possible.

The features I'm looking to implement are:

1. Allowing the end user to measure distances on the ArcGIS map. The user presently clicks on the display (capturing the starting coordinate) and drags (capturing the end coordinate) the mouse which then draws a line on the display with an indication of the distance this line represents (in metres or some other unit) as well as bearing from the start to the end points. 

Q: What would be the best way of capturing the mouse positions, converting to a WGS-84 (or other spatial reference) and then working out distances as well as drawing the measurement line? Would this need to be done in a layer?

2. The end user can place many geographically position "markers" or a "waypoints" which are saved to a local settings file and loaded and drawn when the application starts.

Q: Presumably, this is done using the SimpleMarkerSymbol class and I would need to add these "markers" to their own layer?

3. Drawing of ENC nautical charts (vector, raster or GeoTIFF) onto an ArcGIS map. We have any existing 3rd party software package responsible for the drawing of the ENC chart onto a Windows device context. Presently, the chart is drawn onto a HBITMAP which is then drawn onto a surface via QPainter.

Q: Is there an ENC aspect to ArcGIS which we could make use of within the Qt Runtime SDK? This would at least mean we do not need a 3rd party module. If not, I would need to render the ENC chart onto a bitmap and presumable, this would also be done on another graphical layer? Would there be a better way to do this?

4. Rather than use a MapGraphicsView (inheriting from QGraphicsView), I'd look to implement a MapGraphicsWidget (inheriting from QWidget) and I've seen reference to this in the documentation somewhere but can't actually find anything more concrete. This would help with our internal Widget framework and support libraries we have.

Q: No idea where to start with this. 

Obviously, I'm not looking for source code or fully worked examples for the above. For example, I have found a way of capturing the mouse cursor position as a Point and then converting it to a WGS-84 latitude longitude.

What I ultimately need is a bit of advice with regards to the "best way" to implement these features in ArcGIS. Like I mentioned at the start, I'm very new to ArcGIS (like 2 days worth of experience) and having sifted through the many examples, I'm trying to figure out what I need to do to make ArcGIS work for me in the best possible way.

Thanks in advance for any advice or tips.

5 Replies
KevinWebster
New Contributor II

Ok, maybe I was asking for a bit too much help in this post. I’ll close this one down and ask more simple, structured questions.

0 Kudos
DanPatterson_Retired
MVP Emeritus

Kevin, you have identified several possible applications for development and apparently they all need to be interactive with the dataframe.  That is not a short order given the time you have been working with Arc* software.  You might have better luck if you examine code samples that exist on geonet or on the ArcGIS Code Sharing site to see if bits could fit

0 Kudos
KevinWebster
New Contributor II

Hi Dan, thanks for the link - I'll have a browse for equivalent code which I can tailor for my needs.

0 Kudos
EricBader
Occasional Contributor III

Hi Kevin,

To speak for the ENC data support, our Update 2 release (mid December) will support the reading of native ENC data files. These can be visualized as layers in your map.

I'll try to help with your questions:

#1: You can create point objects with projected or non-projected real world coordinates and measure the distance between them using GeometryEngine. You don't need a layer to do this.

#2: Yes. There are a few ways to persist these markers in their own layer. For one, you can use a Feature Service to persist, track, update waypoints as Point features in a feature service layer and symbolize these with whatever Marker symbols you need to use. This works great while connected to a network, but also if you want to go offline from a network, you can do the same workflow. The feature service is added to the map and the map can be stored in your Portal (on-prem or ArcGIS Online). When the app restarts, it reloads the Map, which contains your waypoints layer, for example. You can start reading more about working with feature services here: Features and graphics—ArcGIS Runtime SDK for Qt | ArcGIS for Developers  . And here: Editing—ArcGIS Runtime SDK for Qt | ArcGIS for Developers   

Sorry for this clunky sort of answer, but I hope it helps as a starter.

#3: As I mentioned, coming in Update 2 this December.

#4: Yes, you should be able to extend MapView.

0 Kudos
KevinWebster
New Contributor II

Hi Eric,

Thanks for your comprehensive response.

Regarding the Update 2 release and the ENC data files, do you have any insight as to the integration of this in an end application? We already have an existing ENC user permit, presumably this can be assigned to the ArcGIS runtime via a member function?

Some additional information or questions based on your comments:

#1 - I will need a visual representation of the measurement line. Would a GraphicsOverlay be more suitable for this kind of function rather than a Layer? 

#2 - This sounds like a great solution. For the majority of the time, the application will be run "offline" with the marker details (geographic position, colour, etc) being stored in a local settings file and recalled when the application starts.

#3 - Looking forward to this update.

#4 - Any hints on extending MapView please? Do you know of any specific functions that need to be overridden in order to ensure correct operation? Unfortunately I've not seen much in the way of documentation regarding derived MapViews.

Thanks again,

Kevin

0 Kudos