POST
|
After reading through the documentation of the new arcpy.nax library, specifically ODCostMatrix and related objects, I attempted to port over a script that was using arcpy.na. Unfortunately the Lines output remains stubbornly blank using mostly default inputs, and I am having trouble diagnosing why that is. I've tried changing several of the inputs but none of them seem to fill the Lines output. Here is the portion of my script using ODCostMatrix: od = arcpy.nax.OriginDestinationCostMatrix(NETWORK) od.distanceUnits = arcpy.nax.DistanceUnits.Meters od.defaultDestinationCount = 1 # CENT_TEMP is a feature class of points, drawn from the centroids of polygons # DESTS is also a feature class of points od.load(arcpy.nax.OriginDestinationCostMatrixInputDataType.Origins, CENT_TEMP) od.load(arcpy.nax.OriginDestinationCostMatrixInputDataType.Destinations, DESTS) od_result = od.solve() arcpy.management.Delete(CENT_TEMP) # later on in the code... orig_dist = {} line_search = arcpy.nax.OriginDestinationCostMatrixOutputDataType.Lines OD_LINES = arcpy.env.workspace + r"/od_lines" od_result.export(line_search, OD_LINES) with arcpy.da.SearchCursor(OD_LINES, ["OriginOID", "DestinationOID", "Shape_Length", "Total_Distance"]) as sCursor: # ... does not work because OD_LINES is empty Here is the description of my network. It was a pre-existing network, and I added the "Basic" travel mode so it would work with arcpy.nax. Data Type: File Geodatabase Network Dataset Database: [REDACTED] Feature Dataset: RDIDataSet1 Network: RDINetwork1 Dataset Version: 10.0 Build Status: Built The network dataset has been built. Build Time: Fri Aug 30 18:39:27 2019 Edges: 5460 Junctions: 2179 Sources: Edge Sources: Streets1 Junction Sources: RDINetwork1_Junctions Connectivity: Policies: Streets1 edges use End Point connectivity policy. Elevation Model: Elevation Fields Travel Attributes: Travel Modes: Default Travel Mode: Basic Travel Mode: Basic Description: Collection of network dataset settings that define actions that are allowed on the network and how the actions can be performed. Type: Automobile Uses Costs: Impedance: RouteDistance Allowed U-Turns: All Costs: Cost: RouteDistance Units: Meters Data Type: double Used By Travel Modes: Impedance: Basic Evaluators: Streets1 (Bi-Directional): Field Script (VBScript) Value: [Shape_Length] The full script is attached. Any help is appreciated!
... View more
08-30-2019
06:52 PM
|
0
|
0
|
421
|
POST
|
Hello Melinda, I did not see the ability to create a new network dataset in ArcGIS Pro 2.4. Did I just miss it or has it been pushed back to 2.5? Also, will its API be available in arcpy when it is released? Thank you for your help!
... View more
07-26-2019
11:07 AM
|
0
|
6
|
2879
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|