1

I've got two polyline shapefiles; one showing the location of cross sections taken across a river and the other containing the river centre line that has been split by the cross section layer to create multiple features. Each cross section contains a unique ID along with some additional information in the attribute table (most of which isn't too important - mainly the ID). Each river centre line feature also contains a unique ID.

I'd like to spatially join the river centre line features to both the upstream and downstream cross section features - the result being that each centre line feature now contains information on the upstream and downstream cross section IDs, The output shapefile needs to contain a single feature for each river channel with the connected upstream and downstream section names in the attributes.

Using the detailed MS Paint example image below, channel 1 should show it is connected to A and B, channel 2 connected to B and C, channel 3 connected to C and D etc.

Example layout

I have access to ArcMap 10.2.

I had previously attempted to use the spatial join tool as suggested by @mmoore, however this tool creates a duplicate of each river channel polyline in the output. Each feature then contains either the upstream or downstream section name. Is there a way to either produce the required output using the join tool, or maybe by dissolving the output somehow?

  • I have removed QGIS and MapInfo from your question to prevent it being closed as too broad. If you still need to ask the same question about either of those products then just ask a new question. – PolyGeo Sep 7 '16 at 20:24
  • Thanks PolyGeo. I'd seen questions on here before where people had been told off for not giving enough information. I suppose I was too broad! – davehughes87 Sep 8 '16 at 8:30
  • It is not intended in any way to be a telling off, but our volunteers have only so much time to donate and we not only have a backlog but we also get many new questions each day. The aim is to try and get questions arriving in good shape, or getting them into good shape very quickly. Any time multiple questions are embedded in a question and they start to get cross answered it takes time to disentangle them. – PolyGeo Sep 8 '16 at 8:43
3

You can do this in ArcMap using the Spatial Join tool. Use your centerlines shapefile as your Target Features, your transects shapefile as your Join Features, make sure that the Join Operation is one to many and your match option is intersect. This will join the attributes from any transect that is intersecting your centerline. Here is what a rough output will look like: enter image description here

The first testing field is the centerline segments and the second testing field is transect segments. For centerline segments that intersect two transects, you can see two identical numbers in different rows along with the different transect attributes.

If you then want to collapse the one to many relationship in your table, I would recommend using the Pivot Table tool (http://resources.arcgis.com/en/help/main/10.1/index.html#//0017000000n8000000). If you have a large number of transect properties, you may have to create several pivot tables and join them to your original centerlines shapefile via your unique ID.

  • Thanks mmoore. Please see the edits to my question. Do you know of a way to end up with a single feature for each river channel showing upstream and downstream connections? Using the spatial join tool appears to create a second feature with each feature containing information on upstream OR downstream sections. Thanks! – davehughes87 Sep 8 '16 at 8:28
  • I assume that you want one feature for each centerline segment and perhaps different fields for your upstream and downstream values? I would check out the pivot table tool in ArcMap (resources.arcgis.com/en/help/main/10.1/index.html#//…) to see if it can do what you need it to do. I have had a lot of success in using it to collapse one to many relationships. Depending upon how many different transect properties you have, you may have to create multiple pivot tables and join them to your original centerlines shapefile. – mmoore Sep 8 '16 at 12:48
0

There's probably a much more efficient solution, but I ended up solving the problem using the methodology below:

  • Extract the start and end points of each river channel feature using field calculator to store the X/Y values into four new attributes; StartX, StartY, EndX and EndY. Use these attribute values to create two new point shapefiles containing just start and just end points.
  • Generate a points shapefile of the vertices from the cross section polylines, deleting all that don't intersect with the two new start/end points shapefiles. You're left with the intersection points containing cross section IDs. Also store the X/Y coordinates of these points in attributes.
  • Use attribute joins based on coordinates to connect the cross section names to the upstream and downstream point shapefiles.
  • More attribute joins based on coordinates to reconnect these upstream/downstream points back to the polylines in separate attributes of a single feature.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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