[GIS] Manipulating mpk/gpk/tpk with ArcGIS Runtime WPF

arcgis-10.1arcgis-runtimegeoprocessing-packagemap-packagetile-package

Is there a way work with those package files within Runtime and NOT in arcmap. It seems very inconvenient for where we have to use these packages, especially for geoprocessing.

Also, is there a way to create/add/remove shape files within those packages?

If anyone has any references, please let me know. This seems to be the trickiest part about Runtime IMO.

Thanks and Regards,
Kev

Best Answer

My understanding is that ArcMap is the tool for authoring packages. The purpose of a package is to encapsulate maps, layers, and geoprocessing tools that are to be consumed by Runtime. Runtime is not intended to be an authoring or package manipulation SDK. So ... ArcMap = Author, Runtime = consumer.

That being said, packages are simply zip archives. You could do some investigation and experimentation to figure out the formats and probably build some packages by hand.

Adding a shapefile to a package can be done by adding it as a layer in ArcMap. Then you simply rebuild the package from your modified map. If you have collection of shapefiles that are related, you can put them all in one map document (as individual layers) and export as a package (now containing those shapefiles). In WPF Runtime, create a new layer in XAML for each shapefile/layer in your ArcMap doc. In the XAML, reference the package and the layer name that corresponds to a particular shapefile.

If you installed the WPF SDK in the normal location, you can go to this folder and find an interactive sample application:

C:\ArcGIS\WPF1.0\SDK\Samples\Sample Application\Sample Application.exe

Dig into the code behind to see how packages and layers are used to add data to the map.

Related Question