0

I have a process I use QGIS/mmqgis for. I have a hex grid that I use for binning large data, and I have that hex grid overlaying a road network. I use the "Join Attributes by Location (Summary)" tool to generate a new road network that has a series of statistics derived from all the cells a line traverses. Maybe more helpful to see the principle:

road statistics from hex grid

QGIS will give me a new road network and each feature has a min, max, mean, sum, range, etc derived from all the hex cells that feature intersects. In the example graphic, the processed top line would have a sum of 500 and the tributary line would have a sum of 495.

I have tried to reproduce this analysis in ArcGIS Pro for a series of users who only have Esri tools, and have not been able to do so. I have tried using Summarize Within, and this "sort of" works, but it creates a duplicate of each feature (line) for each hex cell it traverses and thus gives me no statistics.

How would I go about accomplishing this?

Pythonic solutions are fine as long as there is an explanation of which method to use in particular.

5
  • What precisely have you tried with ArcGIS Pro? Where precisely are you stuck?
    – PolyGeo
    Commented Mar 26, 2019 at 18:57
  • 1
    Intersect and summarise using unique line id.
    – FelixIP
    Commented Mar 26, 2019 at 19:43
  • I have the polyline layer loaded, I have the hex bins that contain a 'count' field. I have tried: Spatial Join, and have tried setting the point count field (from the hex cells) to "mean" to run an average; I've also tried using Summarize Within, but both of these approaches leave me with duplicate geometry with no summarized point count statistics. So regarding the example i posted, Arc gives me 4 duplicate lines, each with an attribute of 150, 175, 150, and 25, respectively.
    – auslander
    Commented Mar 26, 2019 at 19:48
  • Use summary statistics tool on that and perhaps read my 1st comment again.
    – FelixIP
    Commented Mar 26, 2019 at 19:59
  • @FelixIP that worked, thanks! If you want to flesh it out and put it as an answer I'll mark it correct.
    – auslander
    Commented Mar 26, 2019 at 20:51

1 Answer 1

1

Input:

enter image description here

Workflow that will handle overlaps:

arcpy.Intersect_analysis("LINES #;POLYGONS #", "./intersect.shp")
arcpy.DeleteIdentical_management("intersect", "LINE_ID;PGON_ID")
arcpy.Statistics_analysis("intersect", "./intersect_Statistics", "W SUM", "LINE_ID")

Output:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.