TransWikia.com

Web tool Network Analysis (Service Area)

Geographic Information Systems Asked by Rocco on June 22, 2021

Has anyone tried publishing Network Analysis Service Area to create a Web Tool?
It works fine locally, but it cannot be published as Web Tool with Staging Failed.

While Portal only supports 1 network dataset at a time, I want to allow the user to select different network dataset in a local folder in the server as InputNetwork, I loop through the folder and check how many network dataset is present and create a dropdown list for selection, it works perfect in ArcGIS Pro.

We have project planning that requires network dataset comparison (before and after), does anyone have similar experience?
If this doesn’t work, I will have to make this happen using JavaScript instead.

        facilities = parameters[0].value
        inputNetwork = parameters[1].valueAsText
        impedanceAttribute = parameters[2].valueAsText
        oType = parameters[3].valueAsText
        cutoffs = parameters[4].valueAsText
        spread = parameters[5].valueAsText
        outputLayer = parameters[6].valueAsText
        spread = spread + ' Meters'
        
        cutoffList = []
        cutoffSplit = cutoffs.split(',')
        for c in cutoffSplit:
            if c.strip().isdigit():
                cutoffList.append(int(c.strip()))

        output_type = {'POLYGONS':'POLYGONS',
                       'LINES':'LINES',
                       'POLYGONS and LINES':'POLYGONS_AND_LINES'}
        
        oType = output_type[oType]
        outNALayer=arcpy.na.MakeServiceAreaAnalysisLayer(inputNetwork, "output", impedanceAttribute, "FROM_FACILITIES", cutoffList, None, "LOCAL_TIME_AT_LOCATIONS", oType, "STANDARD", "OVERLAP", "RINGS", spread, None, None)
        outNALayer = outNALayer.getOutput(0)
        subLayerNames = arcpy.na.GetNAClassNames(outNALayer)
        facilitiesLayerName = subLayerNames["Facilities"]
        arcpy.na.AddLocations(outNALayer, facilitiesLayerName, facilities, "", "")
        arcpy.na.Solve(outNALayer)

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP