I have a point geom feature (in wkb) in a PostgreSQL database table (with postGIS extension). There is also an azimuth value (degrees), as float, in an other field of the same table.
How to perform, as simple as it would be to cut a part of a cake, an intersection between a x[m] buffer around the point and a 20° angle around the azimuth (±10° on both side, the azimuth should be the bisecting line of the angle)?
From now I've calculated the buffer as an other geom (as a polygon also in wkb) which is stored in an other field of the table.
I wonder what would be the faster and more CPU effective calculation to intersect this circle with the angle?
The only postGIS function I have found yet is ST_azimuth
:
http://www.postgis.org/docs/ST_Azimuth.html
but it may be rather "complicated" to implement as it would need to calculate two "virtual secondary points" that are "far enough" from the buffer and apart respectively from -10 and +10° from the existing azimuth and then make the difference between these two new azimuth angles...
And after, I really can't figure out how to intersect an angle, which is some kind of "not clearly defined" geometry, with the circular buffer.
An other point; at the end I would need to implement this in a Python script (I'm basically using shapely
and psycopg2
modules yet).
But for now it could be done in an SQL query directly on the postgreSQL DB.
--