I would like to know the azimuth and tilt of a polygon / surface in a PostGIS database. The azimuth should be given e.g. from 0° to 360° degrees. The altitude should be between 0° to 90°. An example result table:
sid | azimuth | tilt | geom --------------------------- 0 | 0 | 0 | ... 1 | 90 | 45 | ...
sid 0 would represent a north facing wall and
sid 1 a East facing roof with a 45° degree slope.
I guess the typical approach would look as follows:
- Find the surface's centroid
- Project a point North of it
- Measure the azimuth and angle between the centroid and the projected point
After giving it some more thought and taking into account that all of the involved functions (
ST_Azimuth) are not 3D capable, I feel like this may currently not be possible in PostGIS.