I have line features (streets) and polygons (air quality raster). I need to transfer the air quality attributes into the lines. However, some lines are part of two or more polygons (e.g. the selected feature below).

enter image description here

I am looking for a way to transfer the attributes of the polygons onto the lines weighted by the length of the part of a line feature within each polygon.

The tool Spatial join only allows for a simple average in its merge rules (mean) giving equal weights for both parts of the selected line in the picture above.

An alternative idea was to split line features at intersections with polygon boundaries and have the air quality attributes assigned to the two or more new features. In a second step, I could then unsplit those split features using an ID. Lastly, I could use the field calculator to calculate a new weighted average air quality field, like: Air Quality = (Shape_Length A * Air Quality A) + (Shape_Length B * Air Quality B)/(Shape_Length A + Shape_Length B)

I am using ArcGIS Desktop 10.5.

  • Have you tried one of the Analysis Overlays such as an identity (lines) or a union or intersect? These will split the lines at the polygons edges and assign the poly attributes. You will need to recalculate lengths. Due this with a unique attribute for each line if you want to analyze the data and add it back into your original layer via a join by attributes. – johns Jul 30 '18 at 13:03
  • @johns I just tried identity to split the features and assign the poly attributes. I still have the problem of merging them together so that the attributes are weighted by their length. Wenn joining the tables by attribute, arcgis picks one of the attributes of the split features with the same ID and "joins" it with the original feature. I guess the merge rule here is "First—Use the input fields' first value.", which is the default in spatial join as well. – jpg Jul 30 '18 at 16:08
  • The overlay and recalculated lengths just gets things split and assigned with the attributes. That will be a many to one situation so you can't join that back. You still have to do some analysis of the table data to get relative percentages, and then join that work back to your original. Look at this gis.stackexchange.com/questions/95433/… – johns Jul 30 '18 at 16:50
  • To do something similar to the accepted answer in the link I gave you, you could copy and paste into a spreadsheet like Excel, create a pivot table, and then set it so it calculates relative vales for you by adding the length field into the values box twice, and then having it show values as a percentage of the appropriate total. support.office.com/en-us/article/… – johns Jul 30 '18 at 17:40
  • thx @johns, you got me thinking and I found a way. I split the street features using identity as you suggested. Added new fields to calculate the length and "air quality * feature length". Unsplit the features using an ID field and summed the new fields up. than added another field in the new output to calculate the average air quality per street feature by dividing the summed up "air quality * feature length" through the original length. voila! Thanks! – jpg Aug 2 '18 at 13:47

Your Answer

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

Browse other questions tagged or ask your own question.