[postgis-users] creating linestrings from points, complexish linestrings

Martin Davis mbdavis at refractions.net
Thu Apr 5 08:43:23 PDT 2007


Hmm, that is complexish.  I see now that pointnumber can be used as the 
ordering, so that's good.  But it looks like you might have to do an 
arbitrary-depth self-join to chain all the points in a particular list 
together - ugly.  'Fraid I don't have any good ideas about how to 
aggregate the sequences of points into linestrings.  Perhaps someone 
else on the list will.

Rhys Stewart wrote:
> here is an excerpt from the table:
>
>
> parish | pointnumber | parent |  devicetype
> --------+-------------+--------+--------------
> KSAS   |           3 |        | START
> KSAS   |           4 | 3      | INTER
> KSAS   |           5 | 4      | INTER
> KSAS   |           6 | 5      | END
> KSAS   |           7 | 3      | INTER
> KSAS   |           8 | 7      | END
> KSAS   |           9 | 7      | END
> KSAS   |          10 |        | START
> KSAS   |          11 | 10     | INTER
> KSAS   |          12 | 11     | INTER
> KSAS   |          13 | 12     | END
> KSAS   |          14 |        | START
> KSAS   |          15 | 14     | END
>
>
>
> On 4/4/07, Martin Davis <mbdavis at refractions.net> wrote:
>> First of all, don't you need some kind of ordering attribute on the
>> points?  Otherwise how would you determine the order the points occur in
>> the linestring?
>>
>> Rhys Stewart wrote:
>> > Hi all,
>> >
>> > I have the following table:
>> >
>> > CREATE TABLE tmp.children
>> > (
>> >  parish character varying(50),
>> >  pointnumber numeric(18),
>> >  parent character varying(254),
>> >  devicetype character varying(50),
>> >  coordfix geometry
>> > )
>> >
>> > The table holds a parent-child relationship in columns pointnumber and
>> > parent.
>> > i.e., if a point has a parent the pointnumber  for that parent is in
>> > the parent field.
>> > The devicetype can either be Start, Inter or End. The only time a row
>> > has no parent is when its devicetype is start. There can be any number
>> > of inters.
>> >
>> > I would like to create one linestring encompassing an entire
>> > start-inter-end sequence and am having trouble wrapping my brain
>> > around it.
>> >
>> >
>> > Any suggestions?
>> >
>> >
>> > Thanks
>> > _______________________________________________
>> > postgis-users mailing list
>> > postgis-users at postgis.refractions.net
>> > http://postgis.refractions.net/mailman/listinfo/postgis-users
>> >
>>
>> -- 
>> Martin Davis
>> Senior Technical Architect
>> Refractions Research, Inc.
>> (250) 383-3022
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>

-- 
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022




More information about the postgis-users mailing list