POST
|
I am running 10.1 Arc Server and we have several services published to the service. Tools in arcGIS Explorer Desktop call these services and display the results. And....everyone that published the former services no longer work here and I wasn't working here when they did. So I'm shooting in the dark hoping to hit something. I have a service which runs in Arcmap without a problem. Once it finishes I publish the service to the server and push the new dll to the published library location. In the client I get only 3 messages from the server (even though I'm putting out a TON of messages) Running service. Executing... Failed. Thank you very much for such explicite data ESRI!! On the server I get a log message that looks like this: VERBOSE Jan 9, 2014 3:02:56 PM GPServerSync.Deactivate CalculateDistances.GPServer FINE Jan 9, 2014 3:02:56 PM String request successfully processed. Response size is 378 characters. CalculateDistances.GPServer VERBOSE Jan 9, 2014 3:02:56 PM Save job message type SOAP message size 378 CalculateDistances.GPServer VERBOSE Jan 9, 2014 3:02:56 PM Save job message type SOAP message size 374 CalculateDistances.GPServer FINE Jan 9, 2014 3:02:56 PM String request received. Request size is 433 characters. CalculateDistances.GPServer VERBOSE Jan 9, 2014 3:02:56 PM GPServerSync.Activate CalculateDistances.GPServer FINE Jan 9, 2014 3:02:56 PM String request successfully processed. Response size is 406 characters. CalculateDistances.GPServer FINE Jan 9, 2014 3:02:56 PM String request received. Request size is 384 characters. CalculateDistances.GPServer FINE Jan 9, 2014 3:02:56 PM String request successfully processed. Response size is 385 characters. CalculateDistances.GPServer FINE Jan 9, 2014 3:02:56 PM String request received. Request size is 380 characters. CalculateDistances.GPServer FINE Jan 9, 2014 3:02:55 PM String request successfully processed. Response size is 385 characters. CalculateDistances.GPServer FINE Jan 9, 2014 3:02:55 PM String request received. Request size is 380 characters. CalculateDistances.GPServer FINE Jan 9, 2014 3:02:55 PM String request successfully processed. Response size is 396 characters. CalculateDistances.GPServer VERBOSE Jan 9, 2014 3:02:55 PM Job jbbc989cb7b08467b9e57d7c4a21db9e2 is successfully submitted. CalculateDistances.GPServer So it looks like the job was successfully submitted, the parameters were received without a problem, the response appears to have been sent yet I see nothing that shows any failure! I added a reference so that I could access ServerLogger and add my own logging to the log. But my messages do not show up here. And there is no process that I can find that I can attach to that lets me enter debug mode to debug my server code. Thank you very much again ESRI. So how do I debug my service in this pile of failure that ESRI pretends is a server service??? How can I get my logging to work? How can I attach to something so I can debug my code and find out what is failing??? How can anyone publish a working service with so many roadblocks to debugging placed in front of us by ESRI???!!!! Thanks
... View more
01-09-2014
12:58 PM
|
0
|
9
|
928
|
POST
|
I have a tool which can also be used at the server. It currently has two inputs and one output. The two inputs are defined to use the Standard_Point schema we have defined in our dataset. I added two new parameters which I added as optional input: Blockage_Schema which is defined as just a polygon feature. The other one is Delay_Schema which is a polygon with an additional 2 fields added to the schema definition. The parameter definitions are as follows:
get
{
IArray parameters = new ArrayClass();
// origin point for all calls
IGPParameterEdit3 inputPoint =
GPUtilities.CreatePointRecordsetParameterEdit("StationPoint", "Station Point", "Standard_Point",
esriGPParameterDirection.esriGPParameterDirectionInput,
esriGPParameterType.esriGPParameterTypeRequired, new GPFeatureRecordSetLayerTypeClass(), true);
parameters.Add(inputPoint);
// target point array
IGPParameterEdit3 targetPoints =
GPUtilities.CreatePointRecordsetParameterEdit("TargetList", "Target List", "Standard_Point",
esriGPParameterDirection.esriGPParameterDirectionInput,
esriGPParameterType.esriGPParameterTypeRequired, new GPFeatureRecordSetLayerTypeClass(), true);
parameters.Add(targetPoints);
// blockages
IGPParameterEdit3 inputBlocks = GPUtilities.CreatePointRecordsetParameterEdit("InputBlocks",
"Input Blocks", "Blockage_Schema", esriGPParameterDirection.esriGPParameterDirectionInput,
esriGPParameterType.esriGPParameterTypeOptional, new GPFeatureRecordSetLayerTypeClass(), true);
parameters.Add(inputBlocks);
// delays
IGPParameterEdit3 inputDelays = GPUtilities.CreatePointRecordsetParameterEdit("InputDelays",
"Input Delays", "Delay_Schema", esriGPParameterDirection.esriGPParameterDirectionInput,
esriGPParameterType.esriGPParameterTypeOptional, new GPFeatureRecordSetLayerTypeClass(), true);
parameters.Add(inputDelays);
IGPParameterEdit3 outputPoints =
GPUtilities.CreatePolylineRecordsetParameterEdit("OutputList", "Output List", "Distance_Schema",
esriGPParameterDirection.esriGPParameterDirectionOutput,
esriGPParameterType.esriGPParameterTypeDerived, new GPFeatureRecordSetLayerTypeClass(), true);
parameters.Add(outputPoints);
return parameters;
}
When I run the tool I get this error for the optional fields: [ATTACH=CONFIG]29866[/ATTACH] When I track down the error it states that the input is an invalid geometry and only points, polylines, and polygons are allowed. WHY?
... View more
12-13-2013
09:52 AM
|
0
|
0
|
428
|
POST
|
Associated with my previous post I have a list of target points that I need to get the distance to. In all cases I have a single origin and multiple targets. I am getting the distance by creating a distance and backlink array and calling CostDistanceWithPolyline The problem is that with each successive call all I get is the polyline from the origin to the first target. Why???? My code:
for (int index = 0; index < targets.Count; index++)
{
IFeatureClass targetClass = (IFeatureClass) targets[index].Class;
IPoint targetPoint = (IPoint) targets[index].ShapeCopy;
if (!GPUtilities.CheckCoincidence(targetPoint, holdLayer, messages))
{
messages.AddMessage("Target is not coincident with the waterways and will be relocated.");
IFeature targetFeature = targets[index];
if (!RelocateToWaterway(ref targetFeature, rasterDataset, messages))
{
CreatePlaceholder(outputCursor, outputClass, messages);
continue;
}
targets[index] = targetFeature;
targetClass = (IFeatureClass)targetFeature.Class;
targetPoint = (IPoint) targetClass;
}
messages.AddMessage("Target is coincident with the hydrography map.");
IGeoDataset[] costSets = ComputeFullRaster(
targetClass, (RasterDataset) rasterDataset, messages);
// ** Temporary code for adding cost array to the map TOC
IApplication baseApp = (IApplication)Activator.CreateInstance(Type.GetTypeFromProgID("esriFramework.AppRef"));
IMxDocument doc = (IMxDocument) (baseApp.Document);
IMap activeMap = doc.ActiveView.FocusMap;
RasterLayer layer = new RasterLayerClass();
IRaster ds = (IRaster) costSets[0];
layer.CreateFromRaster(ds);
layer.Name = "Cost Array";
layer.Visible = true;
activeMap.AddLayer(layer);
IPointCollection points = new MultipointClass();
points.AddPoint(origin);
points.AddPoint(targetPoint);
messages.AddMessage(string.Format("Computing distance from origin to target {0}", index + 1));
IGeometryCollection result = distanceComputer.CostPathAsPolyline(points, costSets[0], costSets[1]);
if (result == null)
{
messages.AddMessage("No result was returned for this target.");
CreatePlaceholder(outputCursor, outputClass, messages);
continue;
}
for (int subindex = 0; subindex < result.GeometryCount; subindex++)
{
Polyline data = (Polyline) result.Geometry[subindex];
IPolyline idata = (IPolyline) data;
messages.AddMessage(string.Format("Their are {0} points on geometry {1} with length of {2}", data.PointCount, subindex, idata.Length));
messages.AddMessage("Saving geometry as new feature.");
IFeatureBuffer featureBuffer = outputClass.CreateFeatureBuffer();
IFeatureCursor cursor = outputClass.Insert(true);
featureBuffer.Shape = result.Geometry[subindex];
cursor.InsertFeature(featureBuffer);
cursor.Flush();
Marshal.FinalReleaseComObject(cursor);
}
}
... View more
12-11-2013
10:48 AM
|
0
|
0
|
492
|
POST
|
Okay...so ESRI has a major FAIL once again. We were monitoring results returned from CostDistanceWithPolyline and looking at the polyline length to determine that the call succeeded however that value isn't being set by the idiots. Looked at the map in one run and was shocked to see a line sitting there.
... View more
12-10-2013
04:08 AM
|
0
|
0
|
139
|
POST
|
This may provide you with what you need. In this example they are creating rasters from TIFF objects and assigning names.
... View more
12-06-2013
08:26 AM
|
0
|
0
|
259
|
POST
|
I had logic in place that returned a collection of PolyLines as the output feature. However the call we make is returning multiple polylines for a single set of points. I'm changing it now so that it sums the results and returns only a length of type double for each set of points. (which actually makes returning place holders for failed calls easier) When I go to establish my output cursor I get a null object exception. So the way I defined it is wrong. Here is how I'm defining it:
IArray parameters = new ArrayClass();
IGPParameterEdit3 inputPoint =
GPUtilities.CreatePointRecordsetParameterEdit("StationPoint", "Station Point", "Standard_Point",
esriGPParameterDirection.esriGPParameterDirectionInput,
esriGPParameterType.esriGPParameterTypeRequired, new GPFeatureRecordSetLayerTypeClass(), true);
parameters.Add(inputPoint);
IGPParameterEdit3 targetPoints =
GPUtilities.CreatePointRecordsetParameterEdit("TargetList", "Target List", "Standard_Point",
esriGPParameterDirection.esriGPParameterDirectionInput,
esriGPParameterType.esriGPParameterTypeRequired, new GPFeatureRecordSetLayerTypeClass(), true);
parameters.Add(targetPoints);
// The original output parameter setting code
//IGPParameterEdit3 outputPoints =
// GPUtilities.CreatePolylineRecordsetParameterEdit("OutputList", "Output List", "Standard_Polyline",
// esriGPParameterDirection.esriGPParameterDirectionOutput,
// esriGPParameterType.esriGPParameterTypeDerived, new GPFeatureRecordSetLayerTypeClass(), true);
IGPParameterEdit3 outputValues = new GPParameterClass();
outputValues.DataType = new GPFeatureRecordSetLayerTypeClass();
outputValues.Value = new DEFeatureClassClass();
outputValues.Direction = esriGPParameterDirection.esriGPParameterDirectionOutput;
outputValues.DisplayName = "Output Lengths";
outputValues.Name = "OutputLengths";
outputValues.ParameterType = esriGPParameterType.esriGPParameterTypeDerived;
IGPFeatureSchema outputSchema = new GPFeatureSchemaClass();
IGPSchema schema = (IGPSchema)outputSchema;
schema.CloneDependency = true;
outputValues.Schema = outputSchema as IGPSchema;
outputValues.AddDependency("StationPoint");
outputValues.AddDependency("TargetList");
parameters.Add(outputValues);
return parameters;
I'm also not sure if I'm setting the buffer correctly either. Here is how I'm handling the accumulation and setting of the return values:
double distanceCompute = 0;
for (int subindex = 0; subindex < result.GeometryCount; subindex++)
{
Polyline data = (Polyline) result.Geometry[subindex];
IPolyline idata = (IPolyline) data;
distanceCompute += idata.Length;
}
messages.AddMessage(String.Format("Saving distance of {0} as new feature for target {1}.", distanceCompute, index));
IFeatureBuffer featureBuffer = outputClass.CreateFeatureBuffer();
IFeatureCursor cursor = outputClass.Insert(true);
featureBuffer.set_Value(0, distanceCompute);
cursor.InsertFeature(featureBuffer);
cursor.Flush();
Marshal.FinalReleaseComObject(cursor);
The sooner I can get this fixed the better. 🙂 Thanks a ton everyone.
... View more
12-06-2013
08:11 AM
|
0
|
0
|
570
|
POST
|
We are using hydrography maps from NOAA since all our work is in the ocean and rivers of North America. I am getting my cost raster and backlink rasters generated. However the results seem to ignore land. [ATTACH=CONFIG]29623[/ATTACH] The values are listed for the cost array as 0 -> 6xxx and I wonder if the 0 values is the issue. Can't confirm but I think the land areas may have a value of 0 instead of NoData. Any suggestions?
... View more
12-05-2013
08:57 AM
|
0
|
1
|
583
|
POST
|
http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#/AppRefClass_Class/002300000006000000/ Do you know which DLL the AppRefClass lives in? I'm almost there!
... View more
12-04-2013
11:16 AM
|
0
|
0
|
417
|
POST
|
Yes, if you are creating the tool using COM then the hook parameter passed into ICommand.OnCreate is of type IApplication, you just need to cast it and keep up with it. If you're creating an add-in then there is a global object available that will give you the reference. I don't use add-ins so I can't tell you what it's called but I'm sure it's in the documentation. For tools we have a class that defines the parameters, value types, and the IGPEnvironmentManager along with the IGPMessages object. I think that it would make sense that it is in the IGPEnvironmentManager but I'll have to start search on that to find out. Thanks.
... View more
12-04-2013
10:10 AM
|
0
|
0
|
417
|
POST
|
Neil, Yes it is a service, however for testing we are running it as a tool inside ArcMap. Since I am running inside the context of ArcMap can I still get a way to gain access to IApplication?
... View more
12-04-2013
09:54 AM
|
0
|
0
|
417
|
POST
|
I'm working on a server component that is being run and tested in ArcMap as a tool. The code is running and we are getting results but not expected results. Part of the process creates a cost array which we want to add to the map. I have the basics ONCE I HAVE A MAP, but to get the map I need to create the IApplication object. So running as a tool without any ESRI templates in my code...how do I create the IApplicationObject for accessing the maps in ArcMap??? Thanks
... View more
12-03-2013
12:30 PM
|
0
|
8
|
785
|
POST
|
I evntually found the answer to my question. The answer is yes, I set the value of the coordinate system to 3857.
... View more
10-25-2013
01:13 PM
|
0
|
0
|
133
|
POST
|
I have tried a million things to get this to work. However when I set the results that are returned I get an error thrown. (displayed further down in the message list) My function:
internal static void GetDistanceBetweenPoints(IFeatureClass stationClass, List<IFeature> targets,
IFeatureClass outputClass, IGPMessages messages)
{
messages.AddMessage("Creating the cost array from hydrography");
IFeatureCursor outputCursor = outputClass.Insert(true);
try
{
// First get the origin point for computing distances
IFeature originFeature = stationClass.Search(null, false).NextFeature();
Point origin = originFeature.Shape as Point;
IRasterWorkspaceEx rasterWorkspace = GPDatabase.GetRasterWorkspace();
IRasterCatalog hydrographyCatalog = rasterWorkspace.OpenRasterCatalog("Hydrography");
messages.AddMessage("Hydrography opened.");
IFeatureClass hydrographyFeatureClass = (IFeatureClass) hydrographyCatalog;
IFeatureCursor stationCursor = stationClass.Search(null, false);
IFeature stationFeature = stationCursor.NextFeature();
messages.AddMessage("Station feature defined.");
int rasterObjectId = GPUtilities.CheckCoincidence(stationFeature.ShapeCopy, hydrographyCatalog, messages);
if (rasterObjectId == -1)
{
messages.AddMessage("Station is not coincident with the waterways and will be relocated.");
if (!RelocateToWaterway(ref originFeature, hydrographyFeatureClass, messages))
{
messages.AddMessage("Station could not be relocated to water within 4 nautical miles.");
return;
}
else
{
origin = originFeature.Shape as Point;
}
}
messages.AddMessage("Station is coincident with the hydrography map.");
IRasterCatalogItem hydrographyCatalogItem =
(IRasterCatalogItem) hydrographyFeatureClass.GetFeature(rasterObjectId);
messages.AddMessage(string.Format("Hydrography CatalogItem created : {0}",
hydrographyCatalogItem.RasterDataset.CompleteName));
IGeoDataset hydrographyRasterDataset = (IGeoDataset) hydrographyCatalogItem.RasterDataset;
IGeoDataset hydrographyBackTrack = (IGeoDataset) hydrographyCatalogItem.RasterDataset;
messages.AddMessage("Cost array construction completed.");
IDistanceOp2 distanceComputer = new RasterDistanceOpClass();
messages.AddMessage(string.Format("Beginning process of {0} targets", targets.Count));
for (int index = 0; index < targets.Count; index++)
{
int targetObjectId = GPUtilities.CheckCoincidence(targets[index].ShapeCopy, hydrographyCatalog,
messages);
if (targetObjectId == -1)
{
messages.AddMessage("Target is not coincident with the waterways and will be relocated.");
IFeature targetPoint = targets[index];
if (!RelocateToWaterway(ref targetPoint, hydrographyFeatureClass, messages))
{
CreatePlaceholder(outputCursor, outputClass, messages);
return;
}
targets[index] = targetPoint;
}
messages.AddMessage("Target is coincident with the hydrography map.");
IPointCollection points = new MultipointClass();
points.AddPoint(origin);
points.AddPoint(targets[index].Shape as Point);
messages.AddMessage(string.Format("Computing distance from origin to target {0}", index + 1));
IGeometryCollection result = distanceComputer.CostPathAsPolyline(points,
hydrographyRasterDataset, hydrographyBackTrack);
if (result == null)
{
messages.AddMessage("No result was returned for this target.");
CreatePlaceholder(outputCursor, outputClass, messages);
continue;
}
messages.AddMessage("Saving geometry as new feature.");
IFeatureBuffer buffer = outputClass.CreateFeatureBuffer();
IFeature feature = (IFeature) buffer;
feature.Shape = (IGeometry) result;
outputCursor.InsertFeature(buffer);
}
System.Runtime.InteropServices.Marshal.ReleaseComObject(outputCursor);
}
catch (Exception ex)
{
messages.AddMessage(string.Format("Process failed: {0}", ex.Message));
System.Runtime.InteropServices.Marshal.ReleaseComObject(outputCursor);
throw;
}
}
Eight minutes later...the results: Process failed: This spatial reference object cannot be defined from the available information. I have the points coming in from ArcMAP and I assume that the interface defines the points with the same coordinate system as the map itself. And I'm creating the hydrography map from the same map. And I'm passing one point for station and one point for target. And every attempt to get a fracking polyline returned has failed. This is frustrating. So the exception is thrown right after I write the message : "Saving geometry as new feature."
... View more
10-22-2013
12:48 PM
|
0
|
0
|
646
|
POST
|
I watched the entire video and there is nothing in it that answers the question. There is Developers Part of the Conference which just talks about there "fantastic" SDK however they are constantly using VS 2010. I suppose the answer to that question is: they have to do 2012 first!!! 🙂
... View more
10-22-2013
09:56 AM
|
0
|
0
|
558
|
POST
|
Under normal circumstances, you need Mono to run .NET applications on a Linux server. But this is a component running under ArcGIS which is not a normal circumstance and I doubt that they would support execution of Mono-based code on Linux.
... View more
10-21-2013
01:42 PM
|
0
|
0
|
148
|
Title | Kudos | Posted |
---|---|---|
1 | 06-02-2015 01:26 PM | |
1 | 09-30-2014 12:33 PM | |
1 | 08-13-2014 12:01 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|