Re: [postgis-users] Check and validate directionality of road lines

2023-04-25 Thread Richard Greenwood
First you would have to define what valid directionality is.

In some cases valid directionality might be that all roads project outward
in a cardinal direction from an origin. For example, city blocks running
north-south or east-west. In that case you could compare the X or Y
coordinates of the start and end points of a linestring to verify that they
were larger or smaller as appropriate. e.g. that a north bound road's end
point Y was greater than its starting Y. Obviously your data would have to
have an attribute that identified if a road was designated north-south or
east-west.

Another definition of a valid road direction is that it is always radiating
out like branches on a tree. This is more common in rural addressing
systems. If that's your definition of "valid" then you need to create nodes
at the forks, compare these to your linestring starting points and verify
that a fork node is not at the end of a linestring.

I'm sure there are other definitions of valid directionality, these are
just two that I have come across in my work.

Rich


On Tue, Apr 25, 2023 at 4:10 AM Shaozhong SHI 
wrote:

> How best to check and validate directionality of road lines?
>
> Regards,
>
> David
> ___
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>


-- 
Richard W. Greenwood
www.greenwoodmap.com
___
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users


[postgis-users] Check and validate directionality of road lines

2023-04-25 Thread Shaozhong SHI
How best to check and validate directionality of road lines?

Regards,

David
___
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users