Generate Network Spatial Weights (Räumliche Statistiken)
Zusammenfassung
Constructs a spatial weights matrix file (.swm) using a Network dataset, defining feature spatial relationships in terms of the underlying network structure.
Abbildung
Verwendung
-
Output from this tool is a spatial weights matrix file (.swm). Tools that require you to specify a Conceptualization of Spatial Relationships option will accept a spatial weights matrix file; select GET_SPATIAL_WEIGHTS_FROM_FILE for the Conceptualization of Spatial Relationships parameter and, for the Weights Matrix File parameter, specify the full pathname to the spatial weights file created using this tool.
-
This tool was designed to work with point Input Feature Class data only.
-
A spatial weights matrix quantifies the spatial relationships that exist among the features in your dataset. Many tools in the Spatial Statistics Toolbox evaluate each feature within the context of its neighboring features. The spatial weights matrix file defines those neighbor relationships. For this tool, neighbor relationships are based on the time or distance between features, in the case where travel is restricted to a network. For more information about spatial weights and spatial weights matrix files, see Spatial_weights.
-
Das Feld Eindeutige ID ist mit Feature-Beziehungen verknüpft, die von der Ausführung dieses Werkzeugs abgeleitet werden. Infolgedessen müssen die Werte unter Eindeutige ID für jedes Feature eindeutig sein und in einem permanenten Feld vorgehalten werden, das bei der Feature-Class verbleibt. Falls Sie kein Feld "Eindeutige ID" verwenden, können Sie dieses auf einfache Weise erstellen. Fügen Sie der Feature-Class-Tabelle ein neues Ganzzahlfeld hinzu, und berechnen Sie die Feldwerte so, dass Sie dem Feld "FID/OID" entsprechen. Sie können das Feld "FID/OID" nicht direkt für den Parameter Eindeutige ID verwenden.
-
The Maximum Number of Neighbors parameter for this tool specifies the exact number of neighbors that will be associated with each feature. The Impedance Cutoff overrides the number of neighbors parameter, so that some features may have fewer neighbors if the number of neighbors specified cannot be found within the cutoff distance/time.
-
You can define spatial relationships using the hierarchy in the network dataset, if it has one, by checking the Use Hierarchy in Analysis parameter. The hierarchy classifies network edges into primary, secondary, and local roads. When using the hierarchy of the network to create spatial relationships among features, preference will be given to travel on primary roads more than secondary roads and secondary roads more than local roads.
This tool does not honor the Environment output coordinate system. All feature geometry is projected to match the spatial reference associated with the Network Dataset prior to analysis. The resultant spatial weights matrix file created by this tool will reflect spatial relationships defined using the Network Dataset spatial reference. It is recommended that when performing analyses using a network spatial weights matrix file, the input feature class be projected to match the coordinate system of the network dataset used to create the network swm.
ESRI Data & Maps, free to ArcGIS users, contains StreetMap data including a prebuilt network dataset in SDC format. The coverage for this dataset is the United States and Canada. These network datasets can be used directly by this tool.
Denken Sie beim Verwenden von Shapefiles daran, dass diese keine Nullwerte speichern können. Werkzeuge oder andere Verfahren, die Shapefiles aus Nicht-Shapefile-Eingaben erstellen, speichern bzw. interpretieren Nullwerte ggf. als Wert 0. Dies kann zu unerwarteten Ergebnissen führen. Weitere Informationen finden Sie unter Überlegungen zur Geoverarbeitung für die Shapefile-Ausgabe.
Syntax
Parameter | Erläuterung | Datentyp |
Input_Feature_Class |
The point feature class for which Network spatial relationships among features will be assessed. | Feature Layer |
Unique_ID_Field |
Ein Ganzzahlfeld, das für jedes Feature in der Eingabe-Feature-Class einen anderen Wert enthält. | Field |
Output_Spatial_Weights_Matrix_File |
Der vollständige Pfad der erstellten Datei mit der räumlichen Gewichtungsmatrix des Netzwerkes (.swm). | File |
Input_Network |
The network dataset for which spatial relationships among features in the input feature class will be defined. | Network Dataset Layer |
Impedance_Attribute |
The type of cost units to use as impedance in the analysis. | String |
Impedance_Cutoff (optional) |
Specifies a cutoff value for Inverse and Fixed conceptualizations of spatial relationships. Enter this value using the units specified by the Impedance Attribute parameter. A value of zero indicates that no threshold is applied. When this parameter is left blank, a default threshold value is computed based on input feature class extent and the number of features. | Double |
Maximum_Number_of_Neighbors (optional) |
An integer reflecting the maximum number of neighbors to find for each feature. | Integer |
Barriers (optional) |
The name of a point feature class with features representing blocked intersections, road closures, accident sites, or other locations where travel is blocked along the network. | Feature Class |
U-turn_Policy (optional) |
Specifies optional U-turn restrictions.
| String |
Restrictions [Restriction,...] (optional) |
A list of restrictions. Check ON the restrictions to be honored in spatial relationship computations. | String |
Use_Hierarchy_in_Analysis (optional) |
Specifies whether or not to use a hierarchy in the analysis.
| Boolean |
Search_Tolerance |
The search threshold used to locate features in the Input Feature Class onto the Network Dataset. This parameter includes a search value and the units for the tolerance. | Linear Unit |
Conceptualization_of_Spatial_Relationships |
Specifies how the weighting associated with each spatial relationship is specified. For INVERSE, features farther away have a smaller weight than features nearby. For FIXED, features within the Impedance Cutoff of a target feature are neighbors (weight of 1); features outside the Impedance Cutoff of a target feature are not (weight of 0). | String |
Exponent (optional) |
Parameter for the INVERSE Conceptualization of Spatial Relationships calculation. Typical values are 1 or 2. Weights drop off quicker with distance as this exponent value increases. | Double |
Row_Standardization (optional) |
Row standardization is recommended whenever feature distribution is potentially biased due to sampling design or to an imposed aggregation scheme.
| Boolean |
Codebeispiel
The following Python Window script demonstrates how to use the GenerateNetworkSpatialWeights tool.
import arcpy arcpy.env.workspace = "c:/data" arpcy.GenerateNetworkSpatialWeights_stats("Hospital.shp", "MyID","network6Neighs.swm", "Streets_ND","MINUTES", 10, 6, "#", "ALLOW_UTURNS","#", "USE_HIERARCHY", "#", "INVERSE", 1,"ROW_STANDARDIZATION")
The following stand-alone Python script demonstrates how to use the GenerateNetworkSpatialWeights tool.
# Create a Spatial Weights Matrix based on Network Data # Import system modules import arcpy # Set the geoprocessor object property to overwrite existing output arcpy.gp.overwriteOutput = True # Check out the Network Analyst extension (required for the Generate Network Spatial Weights tool) arcpy.CheckOutExtension("Network") # Local variables... workspace = r"C:\Data" try: # Set the current workspace (to avoid having to specify the full path to the feature classes each time) arcpy.env.workspace = workspace # Create Spatial Weights Matrix based on Network Data # Process: Generate Network Spatial Weights... nwm = arcpy.GenerateNetworkSpatialWeights_stats("Hospital.shp", "MyID", "network6Neighs.swm", "Streets_ND", "MINUTES", 10, 6, "#", "ALLOW_UTURNS", "#", "USE_HIERARCHY", "#", "INVERSE", 1, "ROW_STANDARDIZATION") # Create Spatial Weights Matrix based on Euclidean Distance # Process: Generate Spatial Weights Matrix... swm = arcpy.GenerateSpatialWeightsMatrix_stats("Hospital.shp", "MYID", "euclidean6Neighs.swm", "K_NEAREST_NEIGHBORS", "#", "#", "#", 6) # Calculate Moran's Index of Spatial Autocorrelation for # average hospital visit times using Network Spatial Weights # Process: Spatial Autocorrelation (Morans I)... moransINet = arcpy.SpatialAutocorrelation_stats("Hospital.shp", "VisitTime", "NO_REPORT", "GET_SPATIAL_WEIGHTS_FROM_FILE", "EUCLIDEAN_DISTANCE", "NONE", "#", "network6Neighs.swm") # Calculate Moran's Index of Spatial Autocorrelation for # average hospital visit times using Euclidean Spatial Weights # Process: Spatial Autocorrelation (Morans I)... moransIEuc = arcpy.SpatialAutocorrelation_stats("Hospital.shp", "VisitTime", "NO_REPORT", "GET_SPATIAL_WEIGHTS_FROM_FILE", "EUCLIDEAN_DISTANCE", "NONE", "#", "euclidean6Neighs.swm") except: # If an error occurred when running the tool, print out the error message. print arcpy.GetMessages()