I have two files. A polyline shapefile of highways and a spreadsheet that contains beginning and ending coordinates with descriptions of segments of the highways. For example:
BegX, BegY, EndX, EndY, DescriptionField1, DescriptionField2
-80.0, 30.0, -80.1, 30.1, Hwy1Partial, 1
-80.1, 30.1, -80.2, 30.2, Hyw1Partial, 2
I need to create a new polyline shapefile that breaks up the highway segments from the original polyline file into a new one that has the beginning and ending coordinates from the spreadsheet.
I've attempted to join the data but can't figure out how to get it to extract the polyline that starts at the begin coordinate and ends at the end coordinate. I've used the XY to Line tool, but that just gives me a line connecting the begin coordinate to the end coordinate. I need to match it up with the polyline from the highway shapefile.
The shapefile I am using does not have M values. The spreadsheet I have contain latitude/longitude coordinates that look to have originally came from the shapefile (they fall directly on top of it when plotted). I need a polyline file that matches the spreadsheet exactly. Meaning the spreadsheet would become the new shapefiles attribute table, and each record would represent a polyline that was extracted between the beginning coordinate and end coordinate.
The black line represents the shapefile that I have. The two coordinates are examples of beginning and ending lat/lon coordinates that are in the spreadsheet. What I want is to extract the blue line from the shapefile into a new polyline file with the attributes of the original spreadsheet.
I have played around with making XY point layers out of my beginning and ending coordinates then splitting the file based on those new points. The problem is that my shapefile has more lines than I actually need. The resulting file doesn't split it completely the way I need, and I cannot find a way to relate my attributes from the original spreadsheet back to it. What I really need is a custom query that takes in a begin lat/lon, then an end lat/lon and queries the shapefile to get the resulting line. After it finds the new line it would take it to a new shapefile; copying the attributes over from the spreadsheet to be associated with the newly created line.
Intersect
or similar operation to break the lines where your points are located (which I'm just noticing @radouxju has suggested)...