reg : Geoprocessing Service

2354
11
09-27-2010 09:52 AM
VikramS
Occasional Contributor
I am having problem with geoprocessing service . Below is my code behind . As soon as my MyMap_Mouseclick event is complete there is no response after tat . My browser is idle displaying the map point . Can anybody tell me what could be the problem . I have attached the JPG of my model as well

Private Sub MyMap_MouseClick(ByVal sender As System.Object, ByVal e As ESRI.ArcGIS.Client.Map.MouseEventArgs)
        _processingTimer.Start()
        Dim graphicsLayer As GraphicsLayer = TryCast(MyMap.Layers("MyGraphicsLayer"), GraphicsLayer)
        MyMap.Cursor = System.Windows.Input.Cursors.Wait
        Dim mapPoint As ESRI.ArcGIS.Client.Geometry.MapPoint = e.MapPoint
        mapPoint.SpatialReference = MyMap.SpatialReference

        Dim graphic As New Graphic() With {.Symbol = DefaultFillSymbol, .Geometry = mapPoint}
        graphicsLayer.Graphics.Add(graphic)

        Dim geoprocessorTask As New Geoprocessor("http://epps65335.campus.ad.utdallas.edu/arcgis/rest/services/test/GPServer/Model")
        geoprocessorTask.UpdateDelay = 5000
        AddHandler geoprocessorTask.JobCompleted, AddressOf GeoprocessorTask_JobCompleted
        'AddHandler geoprocessorTask.ExecuteCompleted, AddressOf GeoprocessorTask_ExecuteCompleted

        Dim parameters As New List(Of GPParameter)()
        parameters.Add(New GPFeatureRecordSetLayer("Feature_Set", e.MapPoint))
        'parameters.Add(New GPLinearUnit("Linear_unit", esriUnits.esriFeet, Double.Parse("20000")))
        'geoprocessorTask.OutputSpatialReference = MyMap.SpatialReference

        geoprocessorTask.SubmitJobAsync(parameters)
    End Sub

Private Sub GeoprocessorTask_JobCompleted(ByVal sender As Object, ByVal e As JobInfoEventArgs)
        Dim geoprocessorTask As Geoprocessor = TryCast(sender, Geoprocessor)
        AddHandler geoprocessorTask.GetResultDataCompleted, AddressOf GeoprocessorTask_GetResultDataCompleted
        geoprocessorTask.GetResultDataAsync(e.JobInfo.JobId, "Output_Feature_Class", e.JobInfo.JobId)
    End Sub
0 Kudos
11 Replies
VikramS
Occasional Contributor
In my Model the ouput is having a geometry type of Point . How can i change the geometry of output .
That really depends on how you configured your service and what it expects (look at the previous page that describes the service metadata for specific details on the parameters). Next click the "Help" link in the upper right to read about the expected syntax.

Make sure that when you execute your GP tool from Silverlight, that the parameters you provided is of the same type as the Input parameters specify in the mentioned metadata.
0 Kudos
Reynaldde_Castro
Occasional Contributor
How was your issue resolved?
0 Kudos