Tool Intersection Density - USEPA/ATtILA2 Wiki

Intersection Density


Estimates the intersection density of roads within a given search radius for any pixel in the output raster. Intersections are defined as any point where three or more roads meet and density is calculated using kernel density, where closer intersections are weighted higher than further intersections.

The kernel density operation uses the Planar option for calculations. For accurate results, the analysis should to be performed at a local scale with a projection that accurately maintains the correct distance and area.

Optionally, divided roads (i.e., roads of the same classification that run parallel for a significant distance) in the input feature class can be merged into single center lines before determining the number and location of intersections.


  • This tool is designed to use a vector line dataset that represent roads, but any vector line dataset may be used. Caution should be exercised when interpreting results, particularly when using line datasets that do not represent roads.

  • NOTE: To ensure desired results, the Road feature must be in a projected coordinate system with linear units of measure.

  • If no specific geoprocessing environment extent is set, ATtILA will temporarily set it to match the Road feature. It will be reset when the tool finishes.

  • When the optional Merge divided roads selection is checked, the tool allows the user to select a Merge field and a Merge distance to merge road segments that are close to and run parallel to each other into one center line. Merging close, parallel road segments may be desirable if the user wishes to count instances of a road crossing a feature such as a divided highway or boulevard as a single intersection instead of multiple ones. For more information about Merge Divided Roads, search on "How Merge Divided Roads works" in the ArcGIS help documentation.

    • Merge field is the field in the Road feature attribute table that contains road classification values. Only roads with the same classification value are available to be merged. A road segment with a classification of 0 in the Merge field is locked and will not be merged regardless of the presence of any neighboring, parallel segments.

    • If no Merge field is supplied, all parallel roads within the specified Merge distance will be merged.

    • Merge distance is the maximum separation distance for two parallel road segments of the same classification to be merged.

    • NOTE: If the input feature class for Road feature is the [prefix]_RdsIntDens feature class produced by ATtILA's Process NAVTEQ for EnviroAtlas Analyses utility, the road features have already been merged.

  • The parameters Output Coordinate System, Density raster cell size, Density raster search radius, and Density raster area units are used to control the Spatial Analyst Kernel Density function for generating the final Output raster. For more information about the Kernel Density operation, search on "How Kernel Density works" in the ArcGIS help documentation.

    • NOTE: The default values for Density raster cell size (10) and Density raster search radius (750) are the values used in EnviroAtlas's community-level 'Estimated Intersection Density of Walkable Roads' (Fact Sheet).
  • Final output is written to the location specified in the Output raster parameter. The Output raster may be saved in a file folder or a geodatabase.

    • NOTE: For most consistent results, It is highly recommended that tool output be saved to a file geodatabase.

    • When saving in a File Geodatabase, no extension is permitted for the Output raster name.

    • When saving in a file folder, the following extensions are allowed for the Output raster name:

      • .img for ERDAS IMAGINE

      • .tif for TIFF

      • No extension for Esri Grid

  • In Additional Options, the user may elect to 'Retain Intermediate Layers Generated During Metric Processing'.

    • Retain Intermediate Layers Generated During Metric Calculation

      • Choosing INTERMEDIATES retains several of the key intermediate products (e.g., rasters, feature classes, tables) used to generate the final tool output. By examining the intermediate products, the user can gain a better understanding how the metric is calculated. The following intermediate products are listed in the general order they are generated:

        • id_[Road_feature]_Prj_# - A copy of the Road feature projected into the Output Coordinate System. This feature class is only produced if the coordinate system for the Road feature is different than the Output Coordinate System.

        • id_[Road_feature]_SglPrt_# - A copy of the Road feature or id_[Road_feature]_Prj_# feature class with any multipart features separated into singlepart features. This feature class is only produced when the optional Merge divided roads selection is checked.

        • id_[Road_feature]_Merged_# - A copy of id_[Road_feature]_SglPrt_# where matched pairs of divided road lanes within the Merge distance are combined into single-line road features. If a Merge field was supplied, only parallel, proximate roads of equal classification were merged. Road features with a value of 0 (zero) in the Merge field are locked, and were not merged. If the Merge field parameter was left blank, all parallel roads within the specified distance were merged. This feature class is only produced when the optional Merge divided roads selection is checked.

        • id_[Road_feature]_UnSplit_# - A feature class where input line features with coincident endpoints are aggregated into a single unsplit line. Depending on the tool options selected, the input line source is one of the following: Road feature, id_[Road_feature]_Prj_#, or id_[Road_feature]_Merged_#.

        • id_[Road_feature]_Intersections_# - A point feature class showing locations of all road intersections. This feature class is produced by performing an Intersect operation on id_[Road_feature]_UnSplit_# with itself, and then deleting all identical points based on the "Shape" field.

        • NOTE: To ensure unique filenames, intermediate filenames are typically generated using the CreateScratchName ArcPy function. This function provides a unique name for the intermediate product by appending a number to a filename prefix. The number starts at 0 and is incremented until a unique filename for the output workspace is found. The generated number is represented in this manual by the hashtag (#) symbol.

        • NOTE: The appended number may not be the same for all intermediate products saved during a tool run. Running a tool with different input options can result in different intermediate products being produced. If a tool is run more than once using the same output workspace, different number suffixes may be generated depending on the files already present in the output workspace.

      • Intermediate products are saved to one of the following locations:

        • When the Output raster is saved in a File Geodatabase, intermediate products are placed in the same file geodatabase.

        • When the Output raster is saved in a file folder, a file geodatabase named "attilaScratchWorkspace" is automatically generated in the same output location specified for the Output raster. Intermediate products are placed in the attilaScratchWorkspace file geodatabase.

        • NOTE: ATtILA will report the location of the saved intermediate products in the Tool Details' Messages section.


ID (Road_feature, {Merge_divided_roads}, {Merge_field}, Merge_distance, Output_Coordinate_System, Density_raster_cell_size, Density_raster_search_radius, Density_raster_area_units, Output_raster, {Select_options})

Parameter Explanation Data Type
Road_feature The vector line dataset representing roads or other linear features to be measured. Feature Layer
Merge_divided_roads (Optional) Specifies whether to merge matched pairs of divided roads into single-line road features before calculating intersection points. Matched pairs of roads are merged if they are the same road class, trend generally parallel to one another, and are within the merge distance apart.

  • false - Divided roads will not be merged. This is the default.
  • true - Divided roads will be merged before intersections are located.
Merge_field (Optional) The field that contains road classification information. Only parallel, proximate roads of equal classification will be merged. A value of 0 (zero) locks a feature to prevent it from participating in merging.

This parameter may be left blank. If blank, all parallel roads within the specified distance will be merged.
Merge_distance The minimum distance apart, in the specified units, for equal-class, relatively parallel road features to be merged. This distance must be greater than zero. Linear Unit
Output_Coordinate_System The coordinate system used for the output data.

Its linear units are used to define the distance units in Merge distance, Density raster cell size, and Density raster search radius parameters.
Coordinate System
Density_raster_cell_size The cell size of the output raster that will be created.

Units use the linear unit of the Output Coordinate System.
Density_raster_search_radius The search radius within which to calculate density. Units are based on the linear unit of the projection of the output spatial reference.

For example, if the units are meters—to include all features within a one-mile neighborhood—set the search radius equal to 1609.344 (1 mile = 1609.344 meters).

The default search radius is computed specifically for the input dataset using a spatial variant of Silverman's Rule of Thumb (Silverman, 1986) that is robust enough for spatial outliers (points that are far away from the rest of the points). See the usage tips for a description of the algorithm.
Density_raster_area_units The area units of the output density values. String
Output_raster The output intersection density raster.

It is always a floating point raster.
Raster Dataset
Select_options (Optional) One tool option is available to provide additional information:

  • Retain Intermediate Layers Generated During Metric Calculation - Saves the intermediate data layers that are normally deleted after processing is complete.
Multiple Value

Code Samples

Intersection Density example 1 (Python window)

This example returns a raster with an estimate of the number of road intersections per square kilometer for every cell in the output raster. The option to merge roads of the same class in close proximity to each other was not selected. The option to retain the intermediate calculation products was selected.

import arcpy
arcpy.ImportToolbox(r"D:\Destination Folder\ATtILA v2.tbx")

Road_feature = r"D:\pyexamples\data.gdb\Roads"
Merge_divided_roads = False
Merge_field = None
Merge_distance = None
Output_Coordinate_System =  'PROJCS["Albers_Conical_Equal_Area",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Albers"],PARAMETER["false_easting",0.0],PARAMETER["false_northing",0.0],PARAMETER["central_meridian",-96.0],PARAMETER["standard_parallel_1",29.5],PARAMETER["standard_parallel_2",45.5],PARAMETER["latitude_of_origin",23.0],UNIT["Meter",1.0]]'
Density_raster_cell_size = 10
Density_raster_search_radius = 750
Density_raster_area_units = "SQUARE KILOMETERS"
Output_raster = r"D:\pyexamples\results.gdb\Road_Intersection_Hotspots2"
Select_options = "'INTERMEDIATES  -  Retain Intermediate Layers Generated During Metric Calculation'"


Intersection Density example 2 (Tool Details Messages)

This is a sample capture of the geoprocessing messages generated during a typical tool run. It is provided here to assist in the understanding of the tool's processing steps.

Start Time: Day, Month dd, yyyy hh:mm:ss AM/PM
Started: yyyy-mm-dd hh:mm:ss Setting up environment variables
Using Roads's extent for geoprocessing steps.
Time: yyyy-mm-dd hh:mm:ss Projecting Roads to Albers_Conical_Equal_Area. Intermediate: id_Roads_Prj_0
Time: yyyy-mm-dd hh:mm:ss Converting Multipart features to Singlepart. Intermediary output: id_Roads_SglPrt_0
Time: yyyy-mm-dd hh:mm:ss Merging divided road features. Intermediary output: id_Roads_Merged_0
Time: yyyy-mm-dd hh:mm:ss Unsplitting id_Roads_Merged_0. Intermediate: id_Roads_UnSplit_0
Time: yyyy-mm-dd hh:mm:ss Finding intersections. Intermediate: id_Roads_Intersections_0.
Time: yyyy-mm-dd hh:mm:ss Deleting identical intersections...
Time: yyyy-mm-dd hh:mm:ss Performing kernel density: Result saved as Road_Intersection_Hotspots2.
Adding output raster to Map view
Cleaning up intermediate datasets
Succeeded at Day, Month dd, yyyy hh:mm:ss AM/PM (Elapsed Time: ##.## units)


There are no tags for this item.


There are no credits for this item.

Use Limitations

There are no access and use limitations for this item.

arrow_up Page

⚠️ ** Fallback** ⚠️