nqazi

Network Analyst in geo processing service

Discussion created by nqazi on Jul 3, 2013
I have used network analyst tool box  as can be seen in attached model. This model is working fine. when i run it under ArcMAp it gives me routes and stop and also draws routes between two given point. I published it as synchronous geoprocessing service and accessed it in flex application. I provide the required parameter and execute the task using execute method. it returns me the length of the route. however i also want to draw the route between two points in my flex application. Please see the attached model and below is the geoprocessing detail. Now is there any suggestion how i can draw the route in my flex application:
thanks.

code that I using in the flex web application to read the route length is  :

private function SolveRoutes_Complete(event:GeoprocessorEvent):void
   {
   
    parameterValue = event.executeResult.results[0];
    fset = FeatureSet(parameterValue.value);
    for each ( var myfset:Graphic in fset.features) //event.parameterValues[0].value.features )
    {
     Alert.show("Rname"+  myfset.attributes.RouteName + "Clength"+ myfset.attributes.Cumul_Length);
    }
  
   }



Detail of Geoprocessing service:



Execution Type: esriExecutionTypeSynchronous

Parameters:

    Parameter: Expression
        Data Type: GPString
        Display Name Expression
        Direction: esriGPParameterDirectionInput
        Default Value: ObjectID= 82949 or ObjectID =78012
        Parameter Type: esriGPParameterTypeOptional
        Category:

    Parameter: Stops
        Data Type: GPFeatureRecordSetLayer
        Display Name Stops
        Direction: esriGPParameterDirectionOutput
        Default Value:
            Geometry Type: esriGeometryPoint
            HasZ: true
            HasM: false
            Spatial Reference: 29900  (29902)

            Fields:
                OBJECTID ( type: esriFieldTypeOID , alias: OBJECTID )
                Name ( type: esriFieldTypeString , alias: Name , length: 128 )
                RouteName ( type: esriFieldTypeString , alias: RouteName , length: 128 )
                Sequence ( type: esriFieldTypeInteger , alias: Sequence )
                TimeWindowStart ( type: esriFieldTypeDate , alias: TimeWindowStart , length: 8 )
                TimeWindowEnd ( type: esriFieldTypeDate , alias: TimeWindowEnd , length: 8 )
                ArriveCurbApproach ( type: esriFieldTypeInteger , alias: ArriveCurbApproach )
                DepartCurbApproach ( type: esriFieldTypeInteger , alias: DepartCurbApproach )
                SourceID ( type: esriFieldTypeInteger , alias: SourceID )
                SourceOID ( type: esriFieldTypeInteger , alias: SourceOID )
                PosAlong ( type: esriFieldTypeDouble , alias: PosAlong )
                SideOfEdge ( type: esriFieldTypeInteger , alias: SideOfEdge )
                CurbApproach ( type: esriFieldTypeInteger , alias: CurbApproach )
                Status ( type: esriFieldTypeInteger , alias: Status )
                Attr_Length ( type: esriFieldTypeDouble , alias: Attr_Length )
                Cumul_Length ( type: esriFieldTypeDouble , alias: Cumul_Length )
            Features: None.


        Parameter Type: esriGPParameterTypeDerived
        Category:

    Parameter: Routes
        Data Type: GPFeatureRecordSetLayer
        Display Name Routes
        Direction: esriGPParameterDirectionOutput
        Default Value:
            Geometry Type: esriGeometryPolyline
            HasZ: true
            HasM: true
            Spatial Reference: 29900  (29902)

            Fields:
                OBJECTID ( type: esriFieldTypeOID , alias: OBJECTID )
                Name ( type: esriFieldTypeString , alias: Name , length: 128 )
                FirstStopID ( type: esriFieldTypeInteger , alias: FirstStopID )
                LastStopID ( type: esriFieldTypeInteger , alias: LastStopID )
                StopCount ( type: esriFieldTypeInteger , alias: StopCount )
                Total_Length ( type: esriFieldTypeDouble , alias: Total_Length )
                Shape_Length ( type: esriFieldTypeDouble , alias: Shape_Length )
            Features: None.


        Parameter Type: esriGPParameterTypeDerived
        Category:

Attachments

Outcomes