I have a shapefile with a regional travel model comprised of straight line features (model.shp, blue in the image). These lines roughly match the actual paths of the roadways they represent (road.shp, magenta in the image). I need to copy traffic volume data from road.shp to the model.shp.
Some of the issues I see right away are:
- There is no attribute data (roadway name, segment, intersection, etc) to compare between the two datasets. This means the comparison will have to be done based on their spatial relationship to one another
- Single lines in model.shp are often comprised of multiple segments in road.shp. This means that many segments in model.shp will have multiple attribute matches (one for each segment in road.shp that falls along the path of a feature in model.shp), and the locations of the beginning and end of each segment will sometimes be very different.
- The paths of the lines are not very close to each other. This means that there is no simple spatial query that can be done to select by the relationship of their locations to one another.
The locations of the intersections is the areas that are the closest between the two datasets, and I think that is the best way to go about linking the two together. My initial thought is that the best way to go about this is to make a tool to:
- Calculate the coordinates of the beginning and end of each line in road.shp.
- Create a straight line segment from that coordinate information in a new shapefile (roadstraight.shp, carrying over the traffic count number we want to copy to model.shp
- This should result in a dataset comprised of straight lines which should be closer to the model.shp data
- For each line segment in roadstraight.shp, conduct a spatial search for each model.shp line segment within X feet (or the closest X number of lines)
- Calculate the slope of each line that was selected to determine which line follows the closest path to the segment in question
Does it seem like I am on the right track with this?
tldr: need help to match lines from one shapefile to another based on how similar they are in shape and path.