[postgis-users] multiline to linestring

Gustavo Ces g.ces at pettra.es
Wed Feb 6 09:23:18 PST 2008


thanks Kevin!

    Now i understand which was the problem!
    And you run faster, how to extract geometry from geometry_dump type (?) 
was the next question! :)
    It´s not documentated, so i supose it´s a composite type and you know 
how to access it after search that type in database, don´t you?



Gus
----- Original Message ----- 
From: "Kevin Neufeld" <kneufeld at refractions.net>
To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
Sent: Wednesday, February 06, 2008 5:22 PM
Subject: Re: [postgis-users] multiline to linestring


> Hi Gus,
>
> As noted from your error, ST_Dump() is a set returning function, ie. you 
> need to perform something like 'select * from dump(...)'
>
> Try this:
> select geom from dump(
>  (select linemerge(collect(the_geom)) from lines)
> );
>
> Cheers,
> -- Kevin
>
> Gustavo Ces wrote:
>> Hi all,
>>  i´ve got a problem with ST_Dump() ( well, actually this one doesn´t 
>> exist )
>> and dump() function. I´m working with
>>  "PostgreSQL 8.2.3 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 
>> 3.4.2 (mingw-special)"
>> "POSTGIS="1.2.1" GEOS="2.2.3-CAPI-1.1.1" PROJ="Rel. 4.5.0, 22 Oct 2006" 
>> USE_STATS"
>>  I want to convert linestrings from multilinestrings, with linemerge, to 
>> obtain united linestrings in overlapping points
>> with this sentence:
>>  select dump(linemerge(collect(the_geom))) from lines
>>  but i obtain:
>>  ERROR: set-valued function called in context that cannot accept a set
>> Estado SQL:0A000
>> The result of:
>>  select astext(LineMerge(Collect(the_geom))) from lines
>>  is:
>>
>> "MULTILINESTRING((4.8938679245283 46.3443396226415,33.313679245283 
>> 73.7028301886792,49.5872641509434 80.0707547169811,90.9583136792453 
>> 89.2813679245283,54.3363797169811 103.03608490566,29.0620872641509 
>> 103.293985849057,12.2125589622641 107.1625,11.1624233831055 
>> 106.590266209164,10.4214805264064 107.529010012923,11.2220067193803 
>> 108.417488521584,12.2326314413493 107.778056025276),(37.506947728971 
>> 97.6302534161404,12.1756482134062 82.9892270906306))"
>>  with numgeometries=2, the logic result with my original data.
>> How can i extract those linestrings separately?
>>  Gus
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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 




More information about the postgis-users mailing list