Select to view content in your preferred language

Converting between similar classes in ArcObjects and WPF runtime libraries (C#)?

2468
4
09-20-2012 01:03 PM
Labels (1)
KeithGemeinhart
Regular Contributor
There seems to be an "impedance mismatch" (if I can borrow the term) between similar classes in ArcObjects and the WPF runtime libraries. For example, there is a ESRI.ArcGIS.Client.Geometry.Polyline in the WPF runtime and a ESRI.ArcGIS.Geometry.IPolyline (and corresponding PolylineClass) in ArcObjects.

Is there an easy way to convert between the two? Or am I going to have to write some deep copy methods?

Thanks!
0 Kudos
4 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

The ArcGIS Runtime SDKs (WPF, WP, Java, Android, iOS, etc) all have new, native APIs and new architectures which are designed to take advantage of asynchronous programming patterns and modern multi-core computing platforms. These APIs will not necessarily have any direct correlation to ArcObjects. Therefore migrating from an ArcObjects-based solution to a solution based on, for example, the ArcGIS Runtime SDK for WPF will mean you need to redesign and rewrite.

But talk of converting between the two and deep copying sounds like you're considering a hybrid solution?

Cheers

Mike
0 Kudos
KeithGemeinhart
Regular Contributor

But talk of converting between the two and deep copying sounds like you're considering a hybrid solution?


I understand that the framework has been redesigned in the WPF runtime. The objects I'm mainly interested in (e.g. Polyline, Geometry, SpatialReference, etc) are essentially data containers, so I'm guessing somewhere down deep the objects with similar names are basically the same.

We are considering a hybrid solution. We have an existing ArcObjects/Engine application that uses the AxMapControl and we want to replace that with the WPF solution.

I asked this question here http://gis.stackexchange.com/questions/33941/ , and someone suggested serialization via json might work. I'm going to give that a try today, but I'm still looking for other suggestions.

Thanks!
-Keith
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

Yes, the fundamental geometry concepts are essentially the same: MapPoint, Polyline, Polygon, Envelope, Multi-point.

JSON is probably the best option - as long as you follow the ArcGIS REST specification: http://resources.arcgis.com/en/help/rest/apiref/index.html.

I believe you'll need to write the to/from JSON piece for the ArcObjects. In the WPF API we already have some to/from JSON methods - these operate at the level of the FeatureLayer (as opposed to being on individual geometries or graphics). However you may need to implement additional to/from JSON logic.

You should also take care over what functionality you use in the ArcGIS Runtime SDK otherwise you may need to purchase licenses for both parts of your application (an ArcGIS Engine license and an ArcGIS Runtime license). When you begin to use local layers which require your runtime deployment to include the LocalServer then you'll need a runtime Standard license. The lower level Basic license is free and covers you for all service-based layers plus local Tile Packages. The use of client-side GraphicsLayer is included with the Basic license.

Cheers

Mike
0 Kudos
KeithGemeinhart
Regular Contributor
Thanks for the guidance. I'll keep that stuff in mind as I move forward.

As far as licensing goes, it's not a problem. This is for a DoD client with a CJMTK license, so we've got both the engine and WPF runtime licenses covered.
0 Kudos