Hi OrlaHammond,
If you are looking for the a "Northern facing" line, you need to check each polygon geometry line segment's orthogonal vector in combination with the gradient of the line segment.
The orthogonal vector can be solved using the cross product. You can calculate the bearing by adding the gradient of the line segment. Also be careful of the direction of the gradient as this will affect the calculation of bearing.
I am assuming some of your parcels may not be always rectangular e.g. more than 4 lines. The condition to fine the most "Northern facing" line would be:
- The line segment's orthogonal vector's angle +- gradient (depending on direction) is between 315 and 45 bearing,
- The line segment's orthogonal vector angle is the minimum (closest to 0 bearing) of all line segment orthogonal vector angles.
- The line segment's vector coordinates are max of other line segment vectors.