Thursday 21 May 2015

arcmap - Getting nearest polygons in both sides of polyline with ArcPy?



I have polyline shapes representing roads and another shape layer with polygons that are representing buildings. I have to find some way with ArcPy to measure the distance from a point within the polyline road,usually in the middle, to the nearest buildings at both sides of the road. Graphically it would be something like this


enter image description here


In short, I'd need some way to use a kind of Near tool but with the functionality about measuring in the direction I want to.



Answer



Finally I got the way. What I did was to create perpendicular lines (Polylines) to roads and get the intersection (arcpy.Intersect_analysis) with buildings, then I calculate the distance between those points.


Result of the script. Each axis has information about the width and the road that are intersecting with


Script code is available in https://github.com/manuasir/Arcpy_Roads_Width for anyone that needs it.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...