[postgis-users] Move road lines to pavement lines?

James David Smith james.david.smith at gmail.com
Fri Oct 25 05:33:29 PDT 2013


Hi there,

Just looking for some general thoughts and guidance on the best way to
do this please. What I have is about 50,000 linestrings of varying
length. They are in a projected coordinate system (OSGB36). They
represent people walking around a city. The routing however has been
done as road centrelines. So what I would like to do, is to move each
line 3 metres to the left so that it gives a better representation of
where they actually walked. I realise this is very inexact, but it
will do for my purposes.

So does anyone have any thoughts about how to do this? Obviously
'left' is a relative term as it will depend on the direction of
travel.

I think maybe I need to break apart the linestring into collections of
two points. XY_start and XY_end. Then calculate the angle between
them. The add or subtract 3 metres onto one of the sets of coordinates
in one direction, depending on what the result of the angle
calculation was. Once I've done this, I could then recombine all the
sets of points back into linestrings. Does this sound like a
reasonable approach? (Whether I'll actually be able to do it or not is
another thing).

Thanks

James


More information about the postgis-users mailing list