3

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.

3
  • Have a look at this thread for identifying if a point on left or right side of a straight line. Also this tool might help?
    – Hornbydd
    Commented May 3, 2016 at 11:24
  • 1
    Linear Referencing is what I would use, since it has tools like a Near analysis that tells the side of the line a point is on. However, I am curious to know why you think you need this information. It seems oddly specific and not very relevant to geocoding. Understanding why you want to know this could lead in a different direction that solves your real problem better. Also, is each segment with a point independent of all other segments for determining the side of the line, or do you have to respect the entire zig-zag path for determining the side that your building falls on? Commented May 3, 2016 at 14:36
  • I'm explaining better: I need to get the two closest shapes to both sides of a road (polyline) from the middle and measure the size between those points in order to finally get an average width. Thank you for your response.
    – manuasir
    Commented May 4, 2016 at 8:19

1 Answer 1

3

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.

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