Skip to main content
Notice added Needs detailed answers by PolyGeo
deleted 2586 characters in body
Source Link

I'm aware that this is quite an old question, but as this post is one of the top search results for this topic, I thought I'd post mya link to a workflow for producing polyline heat maps in ArcGIS that answers this question, as there is currently no answersolution for ArcGIS in this post.

This technique requires the polylines to be coincident, i.e. exactly overlaying each other. If your data does not match this criteria it is easily fixed using Integrate (if your lines are dense with points, running Simplify Line first, will produce better results but may reduce line accuracy). Once your data is prepared follow these steps:

  1. Run the Split Line At Vertices tool.

  2. Create two additional attribute fields, one will be an identifying field "ID" and another to count coincident line segments "Count". "ID" should be text, "Count" either a Short or Long integer depending on how dense your dataset is.

  3. Using the Field Calculator populate the "ID" field, ensuring the expression type is set to Python, the "ID" needs to be unique to the line segment but the same as coincident lines. The following expression is suitable:

    ID = "{0}{1}{2}{3}".format(!Shape.firstpoint.x!, !Shape.firstpoint.y!, !Shape.lastpoint.x!, !Shape.lastpoint.y!)
    

    It is possible to use other Geometry objects to create a unique identifier but this should suffice.

  4. Next to populate the "Count" field, run the following code in the Python window, changing the appropriate variables:

    import arcpy
    
    feature_class = "Polylines_FeatureClass"
    id_field = ["ID"]
    count_fields = ["ID", "Count"]
    
    id_list = []
    
    with arcpy.da.SearchCursor(feature_class, id_field) as cursor:
        for row in cursor:
            id_list.append(row[0])
    
    with arcpy.da.UpdateCursor(feature_class, count_fields) as cursor:
        for row in cursor:
            row[1] = id_list.count(row[0])
            cursor.updateRow(row)
    

    While adequate, this technique is definitely not optimised for large datasets, it's more of a guide on the workflow.

  5. Lastly run the Delete Identical tool, selecting the "ID" field for comparison. Warning this tool has no output and modifies the input data in place!

This process results in coincident lines being resolved to a single line, with the attribute "Count" representing how many lines were coincident, "Count" can then be used to represent the density through symbology. Whilst this process is more convoluted than overlaying semi-transparent lines, because the 'density' is quantified by "Count" other statistical techniques can now be applied, or just visualised using multiple-colour colour ramps which is not possible using the overlay technique.https://luke-webber.github.io/polyline-heatmap/

I'm aware that this is quite an old question, but as this post is one of the top search results for this topic, I thought I'd post my workflow for producing polyline heat maps in ArcGIS, as there is currently no answer for ArcGIS in this post.

This technique requires the polylines to be coincident, i.e. exactly overlaying each other. If your data does not match this criteria it is easily fixed using Integrate (if your lines are dense with points, running Simplify Line first, will produce better results but may reduce line accuracy). Once your data is prepared follow these steps:

  1. Run the Split Line At Vertices tool.

  2. Create two additional attribute fields, one will be an identifying field "ID" and another to count coincident line segments "Count". "ID" should be text, "Count" either a Short or Long integer depending on how dense your dataset is.

  3. Using the Field Calculator populate the "ID" field, ensuring the expression type is set to Python, the "ID" needs to be unique to the line segment but the same as coincident lines. The following expression is suitable:

    ID = "{0}{1}{2}{3}".format(!Shape.firstpoint.x!, !Shape.firstpoint.y!, !Shape.lastpoint.x!, !Shape.lastpoint.y!)
    

    It is possible to use other Geometry objects to create a unique identifier but this should suffice.

  4. Next to populate the "Count" field, run the following code in the Python window, changing the appropriate variables:

    import arcpy
    
    feature_class = "Polylines_FeatureClass"
    id_field = ["ID"]
    count_fields = ["ID", "Count"]
    
    id_list = []
    
    with arcpy.da.SearchCursor(feature_class, id_field) as cursor:
        for row in cursor:
            id_list.append(row[0])
    
    with arcpy.da.UpdateCursor(feature_class, count_fields) as cursor:
        for row in cursor:
            row[1] = id_list.count(row[0])
            cursor.updateRow(row)
    

    While adequate, this technique is definitely not optimised for large datasets, it's more of a guide on the workflow.

  5. Lastly run the Delete Identical tool, selecting the "ID" field for comparison. Warning this tool has no output and modifies the input data in place!

This process results in coincident lines being resolved to a single line, with the attribute "Count" representing how many lines were coincident, "Count" can then be used to represent the density through symbology. Whilst this process is more convoluted than overlaying semi-transparent lines, because the 'density' is quantified by "Count" other statistical techniques can now be applied, or just visualised using multiple-colour colour ramps which is not possible using the overlay technique.

I'm aware that this is quite an old question, but as this post is one of the top search results for this topic, I thought I'd post a link to a workflow for producing polyline heat maps in ArcGIS that answers this question, as there is currently no solution for ArcGIS in this post.

https://luke-webber.github.io/polyline-heatmap/

Post Undeleted by bendycat_bumbersplat
Post Deleted by bendycat_bumbersplat
Source Link

I'm aware that this is quite an old question, but as this post is one of the top search results for this topic, I thought I'd post my workflow for producing polyline heat maps in ArcGIS, as there is currently no answer for ArcGIS in this post.

This technique requires the polylines to be coincident, i.e. exactly overlaying each other. If your data does not match this criteria it is easily fixed using Integrate (if your lines are dense with points, running Simplify Line first, will produce better results but may reduce line accuracy). Once your data is prepared follow these steps:

  1. Run the Split Line At Vertices tool.

  2. Create two additional attribute fields, one will be an identifying field "ID" and another to count coincident line segments "Count". "ID" should be text, "Count" either a Short or Long integer depending on how dense your dataset is.

  3. Using the Field Calculator populate the "ID" field, ensuring the expression type is set to Python, the "ID" needs to be unique to the line segment but the same as coincident lines. The following expression is suitable:

    ID = "{0}{1}{2}{3}".format(!Shape.firstpoint.x!, !Shape.firstpoint.y!, !Shape.lastpoint.x!, !Shape.lastpoint.y!)
    

    It is possible to use other Geometry objects to create a unique identifier but this should suffice.

  4. Next to populate the "Count" field, run the following code in the Python window, changing the appropriate variables:

    import arcpy
    
    feature_class = "Polylines_FeatureClass"
    id_field = ["ID"]
    count_fields = ["ID", "Count"]
    
    id_list = []
    
    with arcpy.da.SearchCursor(feature_class, id_field) as cursor:
        for row in cursor:
            id_list.append(row[0])
    
    with arcpy.da.UpdateCursor(feature_class, count_fields) as cursor:
        for row in cursor:
            row[1] = id_list.count(row[0])
            cursor.updateRow(row)
    

    While adequate, this technique is definitely not optimised for large datasets, it's more of a guide on the workflow.

  5. Lastly run the Delete Identical tool, selecting the "ID" field for comparison. Warning this tool has no output and modifies the input data in place!

This process results in coincident lines being resolved to a single line, with the attribute "Count" representing how many lines were coincident, "Count" can then be used to represent the density through symbology. Whilst this process is more convoluted than overlaying semi-transparent lines, because the 'density' is quantified by "Count" other statistical techniques can now be applied, or just visualised using multiple-colour colour ramps which is not possible using the overlay technique.