ArcGIS Engine: CreateRuntimeContent - TPKs Not Matching is Size & Events Not Firing

2830
0
07-24-2015 12:48 PM
JimFiddes
Occasional Contributor

I have been designing a tool which allows my clients to take their mxd and within our ArcGis Engine application and produce a TPK which can further be used within our newest ArcGIS Runtime map product. I have completed the code (thanks to Freddie) to execute the GeoProcessing command; however the completed size of the TPK does not match what ArcMap is producing (the mxd being used is the same for comparison reasons).

Any ideas on why the file sizes differ (ArcMap 1Gb in size, ArcGis Engine 12.5mb)? GP command being executed:

var gp = new Geoprocessor { OverwriteOutput = true };

gp.ProgressChanged +=GpOnProgressChanged;

gp.ToolExecuted += GpOnToolExecuted;

try

{

var tool = new CreateMapTilePackage
{
in_map = mapProjectTxt.Text,
service_type = "ONLINE",
output_file = mapProjectTxt.Text.Replace(".mxd", ".tpk"),
format_type = "PNG",
level_of_detail = System.Convert.ToInt32(levelofDetailsNum.Text),
summary = summaryTxt.Text,
tags = tagsTxt.Text,
};
......

Another thing I 'm trying to do is provide the end user with information on where this process is at so they don't think the applicaiton has hung or crashed. I've wired up events from code examples (see below) but they aren't triggering.

private void GpOnProgressChanged(object sender, ProgressChangedEventArgs progressChangedEventArgs)

{

  switch (progressChangedEventArgs.ProgressChangedType)

  {

  case (ProgressChangedType.Show):

  //The tool that is running reports progress or has stopped reporting progress; make the

  // progress bar visible if appropriate.

  progressBar.Visible = progressChangedEventArgs.Show;

  break;

  case (ProgressChangedType.Message):

  statusTxt.Text = progressChangedEventArgs.Message;

  break;

  case (ProgressChangedType.Percentage): progressBar.Value = (int)

  progressChangedEventArgs.ProgressPercentage;

  break;

  default:

  statusTxt.Text= @"unexpected ProgressChangedEventsArgs.ProgressChangedType";

  break;

  }

}

Tags (1)
0 Kudos
0 Replies