Network Analyst のライセンスで利用可能。
サマリー
指定したネットワーク ロケーションとプロパティに基づいて、ネットワーク解析レイヤーを実行します。
使用法
- 解析が失敗すると、警告およびエラー メッセージにより失敗の原因に関する有用な情報が表示されます。 
- このツールを実行する前に、解析の実行に必要なネットワーク解析レイヤーのすべてのパラメーターを必ず指定してください。 
構文
Solve_na (in_network_analysis_layer, {ignore_invalids}, {terminate_on_solve_error}, {simplification_tolerance})| パラメーター | 説明 | データ タイプ | 
| in_network_analysis_layer | 解析が実行されるネットワーク解析レイヤー。 | Network Analyst Layer | 
| ignore_invalids (オプション) | 
 | Boolean | 
| terminate_on_solve_error (オプション) | 
 | Boolean | 
| simplification_tolerance (オプション) | 出力ジオメトリの単純化の度合いを決定する許容値。許容値を指定する場合、0 (ゼロ) より大きい値を指定する必要があります。単位は自由に選択できます。デフォルトの単位は 10 進度です。 単純化許容値を指定すると、ルートまたは到達圏のレンダリングが高速化する傾向があります。ただし、その欠点は、ジオメトリの単純化によって頂点が削除され、大きいスケールで出力の空間的な正確性が低下する可能性があることです。 頂点が 2 つしかないラインはそれ以上単純化できないため、このパラメーターは、直線ルート、OD コスト マトリックス ライン、ロケーション-アロケーション ラインなどの単一セグメント出力の描画時間には影響を与えません。 | Linear unit | 
コードのサンプル
Solve (解析の実行) の例 1 (Python ウィンドウ)
すべてのパラメーターを使用してツールを実行します。
arcpy.na.Solve("Route", "HALT", "TERMINATE", "10 Meters")
Solve (解析の実行) の例 2 (ワークフロー)
次のスタンドアロン Python スクリプトは、Solve (解析の実行) ツールを使用して最寄り施設解析を実行し、結果をレイヤー ファイルに保存する方法を示しています。
# Name: Solve_Workflow.py
# Description: Solve a closest facility analysis to find the closest warehouse 
#              from the store locations and save the results to a layer file on 
#              disk.
# Requirements: Network Analyst Extension 
#Import system modules
import arcpy
from arcpy import env
try:
    #Check out the Network Analyst extension license
    arcpy.CheckOutExtension("Network")
    #Set environment settings
    env.workspace = "C:/data/Paris.gdb"
    env.overwriteOutput = True
    
    #Set local variables
    inNetworkDataset = "Transportation/ParisMultimodal_ND"
    outNALayerName = "ClosestWarehouse"
    impedanceAttribute = "Drivetime"
    accumulateAttributeName = ["Meters"]
    inFacilities = "Analysis/Warehouses"
    inIncidents = "Analysis/Stores"
    outLayerFile = "C:/data/output" + "/" + outNALayerName + ".lyr"
    
    #Create a new closest facility analysis layer. Apart from finding the drive 
    #time to the closest warehouse, we also want to find the total distance. So
    #we will accumulate the "Meters" impedance attribute.
    outNALayer = arcpy.na.MakeClosestFacilityLayer(inNetworkDataset,outNALayerName,
                                                   impedanceAttribute,"TRAVEL_TO",
                                                   "",1, accumulateAttributeName,
                                                   "NO_UTURNS")
    
    #Get the layer object from the result object. The closest facility layer can 
    #now be referenced using the layer object.
    outNALayer = outNALayer.getOutput(0)
    
    #Get the names of all the sublayers within the closest facility layer.
    subLayerNames = arcpy.na.GetNAClassNames(outNALayer)
    #Stores the layer names that we will use later
    facilitiesLayerName = subLayerNames["Facilities"]
    incidentsLayerName = subLayerNames["Incidents"]
    
    #Load the warehouses as Facilities using the default field mappings and 
    #search tolerance
    arcpy.na.AddLocations(outNALayer, facilitiesLayerName, inFacilities, "", "")
    
    #Load the Stores as Incidents. Map the Name property from the NOM field
    #using field mappings
    fieldMappings = arcpy.na.NAClassFieldMappings(outNALayer, incidentsLayerName)
    fieldMappings["Name"].mappedFieldName = "NOM"
    arcpy.na.AddLocations(outNALayer, incidentsLayerName, inIncidents,
                          fieldMappings,"")
    
    #Solve the closest facility layer
    arcpy.na.Solve(outNALayer)
    
    #Save the solved closest facility layer as a layer file on disk with 
    #relative paths
    arcpy.management.SaveToLayerFile(outNALayer,outLayerFile,"RELATIVE")
    
    print "Script completed successfully"
except Exception as e:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    print "An error occurred on line %i" % tb.tb_lineno
    print str(e)
環境
ライセンス情報
- ArcGIS Desktop Basic: 次のものが必要 Network Analyst
- ArcGIS Desktop Standard: 次のものが必要 Network Analyst
- ArcGIS Desktop Advanced: 次のものが必要 Network Analyst