I have lines in shp representing buildings. Each line of the building has its own attributes, such as line type (in pic value 1,2,3...). In the same places, there are polygons that have no attributes. I need to find lines that overlap with polygons, but to take the line with the highest value of "type of line" and transfer all attributes from that line to polygon. In pic so,first upper polygon should have a value of 1, right polygon value 2, left 3, and the bottom 2.