I want to calculate the general orientation of a multilinestring, I used this script to compute the orientation of a linestring :
ST_Azimuth( ST_Transform(ST_SetSRID(ST_Point(ST_XMax(OSM_geom),ST_YMax(OSM_geom)),2154),432), ST_Transform(ST_SetSRID(ST_Point(ST_XMin(OSM_geom),ST_YMin(OSM_geom)),2154),4326)));
but I don't know how to generate the global orientation of a multilinestring.
Simple Orientation :
Global Orientation :