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?