|
POST
|
Hi, We picked up on this yesterday again and made some further progress. We will have tio first initialize the outRaster as a none before with start with the Surface Generation function. After this, we can include a status variable #TODO: THIS IS Important part �?? setting outRaster to None initially outRaster=None �?� �?� #TODO: Check Count If cnt>0: #run The hotspot outRaster=�?� Status=�?�true�?� Else: Status=�?�false #assign Parameters If Status=�?�true�?�: arcpy.SetParameter(6,outRaster) else: arcpy.SetParameter(6,outRaster) Susan
... View more
11-15-2012
02:23 PM
|
0
|
0
|
1319
|
|
POST
|
That's correct. If the number of selected features is 0, Kernel Density will not run. Instead a null output is specified and the application bails when a null raster layer is being set as AGS Dynamic Map Service Layer. It is almost as if the default setting from the publsihing mxd is overriding the null output passed back to the AGS Dynamc Map Service Layer. I understand we are trialing the heat map sample using the javascript api and html5 framework. http://blogs.esri.com/esri/arcgis/2012/09/26/heat-up-your-webmaps/ This quite a big difference from the Geoprocessing Service. It is custom code with a mix of open source and ESRI technologies. It is very much a R&D exercise because we exhausted the Proof of Concept funding for the work. It's kind of scary resorting to a non-tested, non-supported solution though. Susan
... View more
10-23-2012
10:24 AM
|
0
|
0
|
1319
|
|
POST
|
HI, The issue is in setting the null derived output in a Geoprocessing Service. Neither ArcMap, or the AGS Map Service Layer knows about the null part of it and fails. The issue is not recreatable as a standalone tool (one that is not a service). It is just present in the Geoprocesing Service behaviour. Susan
... View more
10-21-2012
12:30 PM
|
0
|
0
|
1319
|
|
POST
|
Hi perhaps the best workaround is to put some error trapping in to check for the failed task by the calling applicaton, in this case the javascript API. It doesn't appear the GP Dynamic Map services can handle a null return. The tool works fine when it is not a Geoprocessing Service, even when a null output is returned. It fails with Geoprocessing Service.
... View more
10-17-2012
01:43 PM
|
0
|
0
|
1319
|
|
POST
|
Calling Script --start Here -- arcpy.AddMessage(sqlQuery) outRaster=arcpy.env.scratchGDB+os.path.sep+"heatMap" #outRaster=arcpy.GetParameterAsText(3) arcpy.MakeFeatureLayer_management(inFeatures,"inFeatures1",sqlQuery) arcpy.AddMessage("feature Count:"+str(arcpy.GetCount_management("inFeatures1"))) descFeatures=arcpy.Describe("inFeatures1") result=arcpy.GetCount_management("inFeatures1") count = int(result.getOutput(0)) arcpy.env.mask=descFeatures.extent arcpy.AddMessage(str(count)) #TODO: test For Selection if count==0: arcpy.AddMessage("Error") arcpy.SetParameter(6,"") else: arcpy.AddMessage("Continue") #TODO: process Kerenl Density processStart=datetime.datetime.now() arcpy.AddMessage("***generate Kernel Density Surface") arcpy.gp.KernelDensity_sa("inFeatures1", modelFld, outRaster, "", searchReadius, "SQUARE_MAP_UNITS") arcpy.AddMessage(str(datetime.datetime.now()-processStart)) #TODO: check In License arcpy.AddMessage("***check In Spatial Analyst") arcpy.CheckInExtension("spatial") #TODO: set Output arcpy.AddMessage("***set The Output Layer") arcpy.SetParameter(6,outRaster) Complete Messaging Job Messages: esriJobMessageTypeInformative: Submitted. esriJobMessageTypeInformative: Executing... esriJobMessageTypeInformative: Executing (MED_KDInterpolate_POC_withparameters): MEDKDInterpolatePOCwithparameters "Corinthian,Philip V" hok # # # Estimated_catch__gwt_ C:\Users\services\AppData\Local\Temp\med\medkdinterpolatepoc_demo_gpserver\je2f1a43da2ef49bc9585d464cf91e4c4\scratch\scratch.gdb\heatMap esriJobMessageTypeInformative: Start Time: Thu Oct 18 08:44:54 2012 esriJobMessageTypeInformative: Executing (MEDKDInterpolatePOCwithparameters): MEDKDInterpolatePOCwithparameters "Corinthian,Philip V" hok # # # Estimated_catch__gwt_ C:\Users\services\AppData\Local\Temp\med\medkdinterpolatepoc_demo_gpserver\je2f1a43da2ef49bc9585d464cf91e4c4\scratch\scratch.gdb\heatMap esriJobMessageTypeInformative: Start Time: Thu Oct 18 08:44:54 2012 esriJobMessageTypeInformative: Running script MEDKDInterpolatePOCwithparameters... esriJobMessageTypeInformative: *** Kernel Density Generator with Parameters *** esriJobMessageTypeInformative: ***check Out Spatial Analyst esriJobMessageTypeInformative: "Vessel_Name" IN ('Corinthian', 'Philip V') AND "Species" IN ('hok') esriJobMessageTypeInformative: feature Count:0 esriJobMessageTypeInformative: 0 esriJobMessageTypeInformative: Error esriJobMessageTypeInformative: completed esriJobMessageTypeInformative: 0:00:04.962000 esriJobMessageTypeInformative: Completed script MEDKDInterpolatePOCwithparameters... esriJobMessageTypeInformative: Succeeded at Thu Oct 18 08:45:00 2012 (Elapsed Time: 6.00 seconds) esriJobMessageTypeInformative: Succeeded at Thu Oct 18 08:45:00 2012 (Elapsed Time: 6.00 seconds) esriJobMessageTypeError: Invalid return value: C:\Users\services\AppData\Local\Temp\med\medkdinterpolatepoc_demo_gpserver\je2f1a43da2ef49bc9585d464cf91e4c4\scratch\scratch.gdb\heatMap esriJobMessageTypeError: Failed.
... View more
10-17-2012
11:51 AM
|
0
|
0
|
1319
|
|
POST
|
Just checked the arcpy.SetParameter(6,"") using your recommendations. The output still generates an invalid return value back to the AGS Dynamic Map Service Layer. Pretty sure that the Geoprocessing serivce is successfully execution as it fails after the task has finished. esriJobMessageTypeInformative: 0:00:02.254000 esriJobMessageTypeInformative: Completed script MEDKDInterpolatePOCwithparameters... esriJobMessageTypeInformative: Succeeded at Wed Oct 17 16:45:28 2012 (Elapsed Time: 3.00 seconds) esriJobMessageTypeInformative: Succeeded at Wed Oct 17 16:45:28 2012 (Elapsed Time: 3.00 seconds) esriJobMessageTypeError: Invalid return value:
... View more
10-16-2012
07:47 PM
|
0
|
0
|
1319
|
|
POST
|
Attached is the complete script. There is a toolbox which I have not attached becaus eit is probably not necessary. outRaster is a derived Raster Output Layer. We pass a load of comma separated strings in the beginning and spend a bit of time building up the sql expression for inFeatures1. Thanks for checking it out. Susan
... View more
10-10-2012
01:11 PM
|
0
|
0
|
1984
|
|
POST
|
We recently upgraded all the ArcGIS Infrastructure to ArcGIS 10.1 release. I am not sure if the issue is in the scripting,but rather the way the parameter is parsed into the AGS Dynamic Map Service Layer which is giving problems.
... View more
10-08-2012
11:43 AM
|
0
|
0
|
1984
|
|
POST
|
Hi and Thanks for this, We have been running with the derived output and then tried switching to the optional output with the same result. There is no problem when the feature selection is greater than 0. The raster layer returns nice and beautifully into the dynamic map service layer at the conclusion of the script. We have noticed that the following statement does not fire #TODO: wont Fire if arcpy.GetCount_management(lyr)==0: arcpy.SetParameter(6,"") sys.exit(0) However, casting the parameter as a string will fire, #TODO: will Fire if str(arcpy.GetCount_management(lyr))=="0": arcpy.SetParameter(6,"") sys.exit(0) It is probably another issue either with the syntax or the way the function is parsed through python. I didn't get a chance to test this with ArcGIS Server 10.0, so cannot sayif this is new behaviour. Susan
... View more
10-05-2012
02:20 PM
|
0
|
0
|
1984
|
|
POST
|
Thanks for getting back about this one. I have tried passing back a null string. The tool completes by first setting the environment by arcpy.SetSeverityLevel(0) #TODO: set Output arcpy.AddMessage("***set The Output Layer") if arcpy.GetCount_management("inFeatures1")>0: arcpy.AddMessage("SETTING VALID RASTER") arcpy.SetParameter(6,outRaster) else: arcpy.AddMessage("SETTING INVALID RASTER") arcpy.SetParameter(6,"") I am attaching the attached message when we run from the REST Endpoint.
... View more
10-04-2012
02:38 PM
|
0
|
0
|
1984
|
|
POST
|
Howzit Tanu - The Bug has been submitted against NIM085410. Susan
... View more
10-04-2012
01:56 PM
|
0
|
0
|
1061
|
|
POST
|
Yep, Trying a Terrain was a long shot as a potential workaround to a raster dataset (ArcSDE/FileGeodatabase,Tiff). We would love to get tool to work with a Raster Layer in a map service. A not-very-workable workaround is not to upgrade. But it is too late to revert.
... View more
10-03-2012
05:10 PM
|
0
|
0
|
1061
|
|
POST
|
Howzit All, I have created a Geoprocessing Service that creates a Heat Map using the Kernel Density Tool. The service works well, and quickly when a feature selection is given to it. However, the tool fails when the feature layer selection returns no records and a null Raster Layer is passed back to the AGS Dynamic Map Service Layer. Geoprocssing Overview: - create a Feature Layer from a sql expression - generate Kernel Density Layer - set Layer into resulting Dynamic Map Service Layer as a Raster Layer The task fails when a null Raster Layer does not exist and is passed back to the out Layer using. arcpy.SetParameterAsText(6,outRaster) The task succeeds when the heatMap is created from > 1 features in the selection. Setting arcpy.SetSeverityLevel(0) ensures the task completes. I think the problem occurs at the map services level because the task completes. Question: How can I pass a null Layer back to a Raster Layer in a AGS Dynmaic Map Service Layer from a Geoprocessing Result? Susan North South GIS Auckland, New Zealand
... View more
10-02-2012
10:23 PM
|
0
|
18
|
3675
|
|
POST
|
Howzit All, I have created a Geoprocessing Service that creates a Heat Map using the Kernel Density Tool. The service works well, and quickly when a feature selection is given to it. However, the tool fails when the feature layer selection returns no records and a null Raster Layer is passed back to the AGS Dynamic Map Service Layer. Geoprocssing Overview: - create a Feature Layer from a sql expression - generate Kernel Density Layer - set Layer into resulting Dynamic Map Service Layer as a Raster Layer The task fails when a null Raster Layer does not exist and is passed back to the out Layer using. arcpy.SetParameterAsText(6,outRaster) The task succeeds when the heatMap is created from > 1 features in the selection. Setting arcpy.SetSeverityLevel(0) ensures the task completes. I think the problem occurs at the map services level because the task completes. Question: How can I pass a null Layer back to a Raster Layer in a AGS Dynmaic Map Service Layer from a Geoprocessing Result? Susan North South GIS Auckland, New Zealand
... View more
10-02-2012
08:53 PM
|
0
|
0
|
593
|
|
POST
|
Howzit All; The Local ESRI Distributor in New Zealand has managed to recreate the issue of the Identify Task against REST with the Silverlight API at ArcGIS Server 10.1. Exact same code works with ArcGIS Server 10.0 and the Silverlight API. I guess my next question, does anyone have an alternate way of extracting the Values from a Terrain or Raster Layer? Susan North South GIS Auckland, New Zealand
... View more
10-02-2012
03:16 PM
|
0
|
0
|
1061
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-30-2015 05:37 PM | |
| 2 | 01-05-2015 12:03 PM | |
| 1 | 05-14-2015 08:36 PM | |
| 1 | 05-20-2015 04:31 PM | |
| 1 | 06-08-2015 03:20 PM |
| Online Status |
Offline
|
| Date Last Visited |
04-19-2021
01:25 PM
|