I'm trying to add attributes to a field in a polylines attribute table according to directly adjacent polygons....

Copy attributes adjacent polys

In the pic, the purple line has an empty field labelled 'FG' and I'd like to fill it with whatever is in the 'FVG' field in the adjacent polygon that shares the boundary ie. 'Rf'.. 'Mit'...'Con'. The purple polyline is split into segments at each polygon boundary.

This should be quite simple but can't for the life of me figure it out. Is it spatial join I'm after? Haven't had much experience with that

  • What software are you using Op.Ivy? – Michael Stimson Aug 8 '14 at 1:09
  • Oops.. ArcMap 10.2 with advanced license – Op.Ivy Aug 8 '14 at 1:12
  • Well, that gives you some options. If you do Polygon to Line using the "neighborhood information" set that will give you the polygons' bounding line with the IDs of the contributing polygons, select the ones that only have an ID on one side and those are your edges. Using the adjacent ID you can join the polygons to the lines to get the required attribute. Now the only thing that's left is to transfer the attributes from those lines to the purple lines - unless you don't mind regenerating them. How does that sound? – Michael Stimson Aug 8 '14 at 1:16
  • Sorry, don't quite understand. I did as suggested- found the sides of the polygons I need (as lines) and joined back to the polygon table but I'm not sure how to transfer the 'FVG' field from the polygon table. There are other fields in the polyline (the purple line) I need to preserve, so this method seems to just recreate the line segments... – Op.Ivy Aug 8 '14 at 1:52
  • For now it does. Add your field(s) to the regenerated lines, also a tip add a join-id field and calculate the left_id where present and right_id where present into join-id (joins can only be done on one field), do the join and calculate the field(s) from the polygons to the regenerated lines. Now you have one bounding line with the fields to retain and another with the fields to copy - we're heading in the right direction... When you've done that you should be able to spatial join the purple line to the regenerated lines. If not I will come up with something! – Michael Stimson Aug 8 '14 at 1:57

Long, but robust:

  1. Add 2 fields to line table X, Y
  2. Calculate geometry midpoint X and Y
  3. Convert table to table and use it for Add XY data
  4. Convert XY to points
  5. Spatial join points and polygons

In points table populate FG by FGV values. Transfer results back to your lines. I assume you have UniqID field in their table

  • Dude, that's a lot of effort to get to feature vertices to points with the midpoint option.. that's where I was going next if the lines could't be joined.. BTW. if the line is 'c' shaped the point will fall off the line, using the feature vertices to points it will be on the line - guaranteed! – Michael Stimson Aug 8 '14 at 2:59
  • 2
    Your solutions is elegant as always. My one is easier to understand. Disagree that point will be out for twisted line. Actually Spatial Join with SHARE_A_LINE_SEGMENT_WITH option will do the job, providing segments are split as mentioned – FelixIP Aug 8 '14 at 3:12
  • Forgot to mention: I have no luxury of advanced license:) – FelixIP Aug 8 '14 at 3:25
  • Tip: you can do it in python by breaking down the line into points... for simplicity use vertex 2 or a midpoint only if there is only two vertices in the line; that would solve your point-off-line problem. I sometimes forget about the licensing limitations - sorry. I've had issues with spatial join and "share a line segment", the geometries have to be exactly snapped or no luck; on that note look up the snap tool resources.arcgis.com/en/help/main/10.1/index.html#//… - Standard and advanced only. – Michael Stimson Aug 8 '14 at 3:31
  • Of course I don't do it myself the way I described. Wrote script ages ago which does whatever you want from features to point.. and much more, e.g. points at given interval. BTW I didn't say that points are falling off the line – FelixIP Aug 8 '14 at 3:38

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.