[postgis-users] Need some help with storing line segments

Ehud Shabtai eshabtai at gmail.com
Tue Jul 19 08:40:51 PDT 2005


On 7/19/05, Stephen Woodbridge <woodbri at swoodbridge.com> wrote:

> You are right but the idea still works, there should be a function that
> takes a list of points and makes a line from it. Assuming that a point
> can only belong to a single line then you need a track_id for all the
> points and a sequence field to order them. Then something like
> makeline((select point_geom from points where track_id=<track_id> order
> by seq) as points_collection)) should do the creation.

Thanks for the help, this is exactly what I needed.

Ehud.

> >
> >
> >>Ehud Shabtai wrote:
> >>
> >>>Hi,
> >>>
> >>>I'm new to postgis and this is my first usage of it. I read the
> >>>documentation, but I could not find a way to store the data I want (in
> >>>the way I want it).
> >>>
> >>>Here's the story:
> >>>
> >>>I got some GPS tracks which I want to store in postgis. Before I store
> >>>them, I do some processing and build line segments from the separated
> >>>GPS points. Now, I'd like to store these lines in postgis, but I'd
> >>>also like to keep attributes for each node of the line (node id, time,
> >>>direction for next node, etc').
> >>>
> >>>The only way I see it is to store each point twice, first as a point
> >>>with some attributes and then as a line. The problem with this
> >>>approach is that I'd like to be able to update the coordinates of a
> >>>specific point, which will result in searching for the line consisting
> >>>this point and then updating the line.
> >>>
> >>>Is there any better approach to sore my data?
> >>>Can I update a specific point of a line in postgis, or the only way is
> >>>to get all the points of a line and create a new one?
> >>>
> >>>Thanks,
> >>>
> >>>Ehud.
> >>>_______________________________________________
> >>>postgis-users mailing list
> >>>postgis-users at postgis.refractions.net
> >>>http://postgis.refractions.net/mailman/listinfo/postgis-users
> >>>
> >>
> >>
> >
> 
>



More information about the postgis-users mailing list