I've a dataset of polygons representing buildings and a dataset of polylines representing buildings. The dataset with lines has a Z value for each line, the polygon dataset doesn't. There are several lines of different object types that make up a building, each with different z values at they're a different part of the building.

I want to find the one line with the highest Z value for each building so I can then transfer the Z attribute of the highest line to the polygon file and visualise the max height of all buildings in 2D. So far I've tried just doing a one to many spatial join of lines within a building polygon to each building polygon, choosing max on the Z attribute as a merge rule without luck. Any ideas for how this can be done?

Polygons in gray, lines in red

  • 2
    Can you explain what didn't work in your case ? Are your layers in the same projection? A spatial join should be the correct way to do it, see example here: i.imgur.com/tV8ZsFP.png
    – Léo M
    Commented Oct 11, 2019 at 9:08
  • It worked doing this in ArcGIS desktop. I was working in ArcGIS Pro and the options for spatial join are different. Doesn't seem to be an option for choosing how all attributes are summarised.
    – user74862
    Commented Oct 11, 2019 at 11:19

1 Answer 1


I would do it in this way:

  1. Assign all polygons a unique building_id
  2. Do a Spatial Join so each polyline is assigned the building_id it's associated with
  3. In the new sj_polyline table, Summarize on the building_id and chose the Z attribute to perform Statistics on with the "Maximum" Statistic Type
  4. Join the new summarize_sj_polyline table to your building polygon table to associate the maximum Z value from all associated polylines the corresponding building feature

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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