[postgis-users] I'm missing something

Kevin Neufeld kneufeld at refractions.net
Tue May 20 14:07:15 PDT 2008


I don't receive an error when merging your geometries together.

create table tmp (geom geometry);
insert into tmp values ('MULTILINESTRING((46 34.25,80 34.25))'::geometry);
insert into tmp values ('MULTILINESTRING((80 34.25,80 60))'::geometry);
insert into tmp values ('MULTILINESTRING((46 60,46 34.25))'::geometry);
select astext(st_union(geom)) from tmp;

                                  astext
------------------------------------------------------------------------
  MULTILINESTRING((46 60,46 34.25),(80 34.25,80 60),(46 34.25,80 34.25))
(1 row)

-- Kevin

Bob Pawley wrote:
> I've attached an sql dump of the table tank_lin.
> 
> Hope this helps.
> 
> Bob
> 
> 
> 
> ----- Original Message ----- From: "Paul Ramsey" 
> <pramsey at cleverelephant.ca>
> To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
> Sent: Tuesday, May 20, 2008 1:21 PM
> Subject: Re: [postgis-users] I'm missing something
> 
> 
>> Attach the shape file to a bug in the bug tracker and I will have a look.
>>
>> http://code.google.com/p/postgis/issues/list
>>
>> P
>>
>> On Tue, May 20, 2008 at 1:12 PM, Bob Pawley <rjpawley at shaw.ca> wrote:
>>> They are three lines that, on Quantum GIS, display as a flat U - a 
>>> simple
>>> tank. Using either tank_lin or process_dgn tables - exactly what I 
>>> imported
>>> using dxf2postgis.
>>>
>>> 'Select as text' returns three rows each with the expression
>>> "Multilinestrings" followed by brackets and coordinates.
>>>
>>> 'Select St_Union' returns - unknown geometry error.
>>>
>>> Are you thinking there is something wrong with the installation?
>>>
>>> Bob
>>>
>>>
>>> ----- Original Message ----- From: "Obe, Regina" 
>>> <robe.dnd at cityofboston.gov>
>>> To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
>>> Sent: Tuesday, May 20, 2008 11:51 AM
>>> Subject: RE: [postgis-users] I'm missing something
>>>
>>>
>>> Are these big geometries?  What does
>>>
>>> SELECT ST_AsText(the_geom)
>>>   FROM tank_lin;
>>>
>>> Also just to rule out its the table you are inserting into  - does the
>>> Union without inserting work?
>>>
>>> Select   ST_Union(the_geom)
>>> from tank_lin;
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> ________________________________
>>>
>>> From: postgis-users-bounces at postgis.refractions.net
>>> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Bob
>>> Pawley
>>> Sent: Tuesday, May 20, 2008 2:11 PM
>>> To: PostGIS Users Discussion
>>> Subject: Re: [postgis-users] I'm missing something
>>>
>>>
>>> Hi Regina
>>>
>>> It gives me three rows each with the expression "ST_MultiLineString"
>>> with nothing else.
>>>
>>> Bob
>>>
>>> ----- Original Message ----- From: Obe, Regina
>>> <mailto:robe.dnd at cityofboston.gov>
>>> To: PostGIS Users Discussion
>>> <mailto:postgis-users at postgis.refractions.net>
>>> Sent: Tuesday, May 20, 2008 10:56 AM
>>> Subject: RE: [postgis-users] I'm missing something
>>>
>>> Bob,
>>>
>>> Strange. I don't think I have ever seen quite that error before.
>>> What does
>>>
>>> SELECT ST_GeometryType(the_geom)
>>> FROM tank_lin;
>>>
>>> give you?
>>>
>>> Regina
>>>
>>> ________________________________
>>>
>>> From: postgis-users-bounces at postgis.refractions.net on behalf of
>>> Bob Pawley
>>> Sent: Tue 5/20/2008 1:07 PM
>>> To: PostGIS Users Discussion
>>> Subject: Re: [postgis-users] I'm missing something
>>>
>>>
>>>
>>> I tried this -
>>>
>>> Insert into graphics.process_dgm(the_geom)
>>> Select   ST_Union(the_geom)
>>> from tank_lin;
>>>
>>> and got the error "Unknown geometry type: 0"
>>>
>>> Bob
>>> ----- Original Message -----
>>> From: "Paul Ramsey" <pramsey at cleverelephant.ca>
>>> To: "PostGIS Users Discussion"
>>> <postgis-users at postgis.refractions.net>
>>> Sent: Tuesday, May 20, 2008 9:51 AM
>>> Subject: Re: [postgis-users] I'm missing something
>>>
>>>
>>>> You don't want the GROUP BY. It is grouping the union op on
>>>
>>> distinct
>>>>
>>>> geometry... ie, one per row. Remove it and you'll get what you
>>>
>>> want,
>>>>
>>>> one output row.
>>>>
>>>> P
>>>>
>>>> On Tue, May 20, 2008 at 8:49 AM, Bob Pawley <rjpawley at shaw.ca>
>>>
>>> wrote:
>>>>>
>>>>> Hi
>>>>>
>>>>> I am attemptijng to use the ST_Union function to collapse
>>>
>>> three rows from
>>>>>
>>>>> a
>>>>> table called tank_lin into one row in table called
>>>
>>> process_dgm.
>>>>>
>>>>> Here's what I used -
>>>>> Insert into graphics.process_dgm(the_geom)
>>>>> Select   ST_Union(the_geom)
>>>>> from tank_lin
>>>>> Group by tank_lin.the_geom;
>>>>>
>>>>> The result is three rows inserted into process_dgm, each row
>>>
>>> appearing to
>>>>>
>>>>> be
>>>>> simple copies of each of the original rows.
>>>>> I also attempted group by another column but received error
>>>
>>> 'unknown
>>>>>
>>>>> geometry'.
>>>>>
>>>>> I also tried STR_LineMerge with similar results.
>>>>>
>>>>> What am I not considering?
>>>>>
>>>>> Bob
>>>>> _______________________________________________
>>>>> 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
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at postgis.refractions.net
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>
>>>
>>> ________________________________
>>>
>>> The substance of this message, including any
>>> attachments, may be confidential, legally privileged and/or exempt from
>>> disclosure pursuant to Massachusetts law. It is intended solely for the
>>> addressee. If you received this in error, please contact the sender and
>>> delete the material from any computer.
>>>
>>> ________________________________
>>>
>>> Help make the earth a greener place. If at all possible
>>> resist printing this email and join us in saving paper.
>>>
>>> ________________________________
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at postgis.refractions.net
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>
>>>
>>> -----------------------------------------
>>> The substance of this message, including any attachments, may be
>>> confidential, legally privileged and/or exempt from disclosure
>>> pursuant to Massachusetts law. It is intended
>>> solely for the addressee. If you received this in error, please
>>> contact the sender and delete the material from any computer.
>>>
>>> _______________________________________________
>>> 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
>>>
>> _______________________________________________
>> 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