[postgis-users] simplify creates geom collection?

Burgholzer,Robert rwburgholzer at deq.virginia.gov
Fri Oct 5 10:00:59 PDT 2007


I should note that the isSimple() qualification does not apply here.
The resulting geometries are in fact simple, at least according to the
isSimple() function.  

Viz.
This Fails with the error "ERROR: Relate Operation called with a
LWGEOMCOLLECTION type.  This is unsupported"

select a.groupname, b.fipscat 
from proj_seggroups as a, p5_va as b 
where a.gid = 35 
and contains(a.the_geom,
centroid(simplify(transform(setsrid(b.the_geom,26918), 4326),0.0025) )) 
AND isSimple(simplify(transform(setsrid(b.the_geom,26918),
4326),0.0025)) 
and a.projectid = 3 and a.ownerid = 1 ;

This succeeds:
select a.groupname, b.fipscat 
from proj_seggroups as a, p5_va as b 
where a.gid = 35 
and contains(a.the_geom,
centroid(simplify(transform(setsrid(b.the_geom,26918), 4326),0.002) )) 
AND isSimple(simplify(transform(setsrid(b.the_geom,26918), 4326),0.002))

and a.projectid = 3 and a.ownerid = 1 ;


I can post my shapes, they are quite complex, does anyone have a
suggestion as to the best way to do this?  As a zip attachment?

r.b.

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Kevin Neufeld
Sent: Friday, October 05, 2007 12:35 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] simplify creates geom collection?

Design flaw?  "simplify" does not maintain geometry validity.  
Self-intersections or geometry collapses can occur. The docs state this 
... well, that geometries may no longer be simple anyway.

I suppose we could change this so that a geometry clean-up is performed 
after the simplification ... but we would need to develop a proper 
geometry "rebuilder" function first :)

-------------
Kevin Neufeld
Software Developer
Refractions Research Inc.
300-1207 Douglas St.
Victoria, B.C., V8W 2E7

Phone: (250) 383-3022
Email: kneufeld at refractions.net



Martin Davis wrote:
> I think you'd call this a design flaw.  It sounds like JTS has a 
> similar problem.  Can you post your test cases?
>
> Burgholzer,Robert wrote:
>>
>> I have experienced an instance where using simplify, depending on the

>> threshold chose, creates a geometry collection, rather than a 
>> multipolygon (which was my source shape type).
>>
>>  
>>
>> I am unsure of exactly what is happening, but I know that with my 
>> particular shapes, a threshold of 0.0025 (dd) caused the problem, but

>> 0.002 was OK.
>>  
>>
>> Is this a bug, a feature, or operator error?
>>
>>  
>>
>> Robert W. Burgholzer
>>
>> Surface Water Modeler
>>
>> Office of Water Supply and Planning
>>
>> Virginia Department of Environmental Quality
>>
>> rwburgholzer at deq.virginia.gov <mailto:rwburgholzer at deq.virginia.gov>
>>
>> 804-698-4405
>>
>> Open Source Modeling Tools:
>>
>> http://sourceforge.net/projects/npsource/
>>
>> Web-Based Water Supply Planning Demo:
>>
>> http://soulswimmer.dynalias.net/models/wsdemo/demo_hsi.php
>>
>>  
>>
>>
------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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