Tag Archives: arcgis runtime

DevSummit presentation: Lessons learned: Three years of ArcGIS Runtime for WPF

Thank you for attending my presentation. It should be available through the Esri Website sometime in the near future. In the meantime you can get the slides and pseudo code examples from here.

THE PRESENTATION (.pdf) (12MB)

Date: Wednesday March 12th
Time: 2:30pm – 3:00pm
Location: Mesquite B

Lessons learned: Three years of ArcGIS Runtime for WPF
This presentation will focus on lessons learned with regards to ArcGIS Runtime for WPF. We have been using ArcGIS Runtime for WPF in two different projects that span nearly three years, starting with ArcGIS Runtime for WPF BETA 2 release. During the presentation we will talk about: 1) the current benefits and limitations of ArcGIS Runtime for WPF; 2) the different tools we have developed to improve usage – including a layer manager, saving and retrieving layers from our own database instead of SDE, custom attributes pane and identify tool, setting rendering properties on layers; 3) tips and tricks when working with ArcGIS Runtime.

Pseudo code examples:

C#

using System;

namespace TipsAndTricks.RuntimeFolders
{
    public class Example
    {
        ArcGISRuntime.AppDataPath = Path.Combine(@"C:\Temp\", "AppDataPath");
        ArcGISRuntime.TempPath = Path.Combine(@"C:\Temp\", "TempPath");
    }
}

namespace TipsAndTricks.MEF
{
    public enum GISFramework
    {
        ArcObjects,
        GPK,
    }

    public interface IGIS
    {
        /* placeholder for GISFrameworkAttribute */
        GISFramework Framework { get; }
    }

    public interface IGeodatabase
    {
        void DoGISStuff();
    }

    public class Example
    {
        [ImportMany]
        private Lazy<IGeodatabase, IGIS>[] geodatabase = null;

        public void DoSomeGISStuff()
        {
            IGeodatabase Geo = geodatabase.Get(GISFramework.GPK);
            Geo.DoGISStuff();
        }
    }

    public static class ExtensionMethods
    {
        public static IGeodatabase Get(this Lazy<IGeodatabase, IGIS>[] items, GISFramework framework)
        {
            foreach (var item in items)
            {
                if (item.Metadata.Framework == framework)
                {
                    return item.Value;
                }
            }

            throw new ArgumentOutOfRangeException("No implementation found for: " + framework);
        }
    }
}

namespace TipsAndTricks.RuntimeServices {

    public class Example{

        /// 
        /// Open ArcGIS Runtime Webservice site in browser
        /// 
        /// command parameter
        private void ExecuteOpenArcGISRuntimeWebservice(object parameter)
        {
            if (LocalServer.IsRunning)
            {
                Thread t = new Thread(new ThreadStart(() =>
                {
                    Process.Start(LocalServer.Url);
                }));
                t.Start();
            }
        }

        /// 
        /// Open ArcGIS Runtime Webservice Admin site in browser
        /// 
        /// command parameter
        private void ExecuteOpenArcGISRuntimeWebserviceAdmin(object parameter)
        {
            if (LocalServer.IsRunning)
            {
                Thread t = new Thread(new ThreadStart(() =>
                {
                    Process.Start(LocalServer.Url.Replace("services", "admin"));
                }));
                t.Start();
            }
        }
    }
}

Python

# Tips and Tricks / Python exception handling

def handleExceptions(e):
    msgs = arcpy.GetMessages(2)
    arcpy.AddError(msgs)
    arcpy.AddError(e.message)
    arcpy.AddMessage(" ! Exception Message: " + e.message)
    print " ! Exception Message: " + e.message
    sys.exit()
    return

def main():
    fileToDelete = arcpy.GetParameterAsText(0)

    arcpy.AddMessage(" + fileToDelete" + str(fileToDelete))

    try:
        arcpy.Delete_management(fileToDelete)
    except Exception as e:
        handleExceptions(e)

    arcpy.AddMessage(" = Finished")

if __name__ == '__main__':

    main()

DevSummit Presentation on ArcGIS Runtime WPF SDK (BETA 2)

My DevSummit presentation is online!

Starting with ArcGIS Runtime SDK for WPF

ArcGIS Runtime is the new lightweight easy to deploy cross platform GIS framework to host your maps, Geoprocessing services and other services. As of this writing, the ArcGIS Runtime SDK for WPF is in BETA 2, but the future for ArcGIS Runtime is bright and it will probably play a big role in stand-alone client applications in the near future. We have been using the ArcGIS Runtime SDK for WPF since November 2011 (Beta 1), and are one of the first groups to actively use it in a project to move an existing Esri-based Win-Forms application to the new Runtime. In this presentation, you will learn how to get started with ArcGIS Runtime and see what we have learned so far. Topics covered include:

  • A (very) short introduction into the ArcGIS Runtime and how to obtain ArcGIS Runtime
  • How the ArcGIS Runtime works (behind the scenes)
  • Debugging approach
  • Demonstrate an application using ArcGIS Runtime
  • Executing a Geoprocessing Task (hosted within a GP package) and displaying the results
  • Current known limitations (due to BETA status)
  • Tips and Tricks

The presentation can be viewed on the Esri website.

Source-code

A big part of the presentation is still valid on the latest release of the ArcGIS Runtime SDK for WPF, which is currently Prerelease.

ESRI DevSummit presentation from Bjorn Kuiper on Vimeo.