Geographic Information Systems Asked by khajlk on January 19, 2021
Well, this seems pretty simple but haven’t been answered cleanly in previous relevant questions for example:
I have a large dataset of road network (multi-linestrings
) of an area of interest converted to linestrings using ST_Dump()
. For each linestring
, I would like to estimate “the direction of travel” (north to south, east to west and vice versa) based on extracted X,Ys. Two sample linestrings are shown below.
For the above sample linestrings, ST_StartPoint()
and ST_EndPoint()
return the start and end points (Xs
, Ys
) of the same. Based on these X
,Ys
(long/lat), how do I estimate the direction of travel of these linestrings?
UPDATE
Assuming that I have my area of interest in the northern hemisphere. Following diagram may “represent” the “direction of travel” (from north to south).
You are looking for ST_Azimuth
Answered by Nicklas Avén on January 19, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP