[postgis-devel] isvalid() error

Carl Anderson carl.anderson at vadose.org
Fri Jan 14 19:44:09 PST 2005


strk at refractions.net wrote:

>I personally use 3points polygon in visualizzatio apps, as
>collapsed polygons still tell us where the original geometry
>was, so they actually carry valid information (extent basicaly).
>
>  
>
<devils advocate>
    is not this a case where a Geometry Collection would be useful.
      collection(POLYGON, LINESTRING, POLYGON,...)
   you seemed to be argueing for it in the prcision reduction case .......

 of course almost no clients support that kind of thing.... ;)
 
</devils advocate>

C.

>So, what we could do is have isvalid() handle number of
>polygon ring points itself before attempting to convert to GEOS.
>If < 4 return FALSE, else continue to GEOS conversion ...
>
>--strk;
>
>On Fri, Jan 14, 2005 at 10:40:44AM -0500, Carl Anderson wrote:
>  
>
>>strk at refractions.net wrote:
>>
>>    
>>
>>>PostGIS always allowed polygon rings with 3 points.
>>>In this case it disagrees with GEOS about this.
>>>Also, PostGIS does not allow 0 points.
>>>
>>>Should we enforce GEOS constraints or just have isvalid
>>>return FALSE in these cases ?
>>>
>>>
>>>
>>>      
>>>
>>a LINESTRING with 3 points is not simple (passes though the same point 
>>in space twice) and cannot be a LINEARRING. Hence it cannot be part of a 
>>valid POLYOGN
>>
>>C.
>>
>>    
>>
>>>--strk;
>>>
>>>On Thu, Jan 13, 2005 at 05:07:59PM -0500, Carl Anderson wrote:
>>>
>>>
>>>      
>>>
>>>>need to test for ring counts prior to sending to GEOS
>>>>
>>>>select  isvalid(geometry('POLYGON((0 0,0 1,0 0))'));
>>>>NOTICE:   IllegalArgumentException: Number of points must be 0 or >3
>>>>ERROR:      POSTGIS2GEOS conversion failed
>>>>
>>>>
>>>>-- 
>>>>Carl Anderson
>>>>GIS Manager Fulton County, Georgia
>>>>carl.anderson at co.fulton.ga.us
>>>>404.730.8026
>>>>
>>>>
>>>>-----------------------------------------------------
>>>>This message has been scanned for viruses and
>>>>dangerous content for Fulton County by DefendMail, and is
>>>>believed to be clean.
>>>>
>>>>_______________________________________________
>>>>postgis-devel mailing list
>>>>postgis-devel at postgis.refractions.net
>>>>http://postgis.refractions.net/mailman/listinfo/postgis-devel
>>>>  
>>>>
>>>>        
>>>>
>>>
>>>      
>>>
>>-- 
>>Carl Anderson
>>GIS Manager Fulton County, Georgia
>>carl.anderson at co.fulton.ga.us
>>404.730.8026
>>
>>
>>-----------------------------------------------------
>>This message has been scanned for viruses and
>>dangerous content for Fulton County by DefendMail, and is
>>believed to be clean.
>>
>>_______________________________________________
>>postgis-devel mailing list
>>postgis-devel at postgis.refractions.net
>>http://postgis.refractions.net/mailman/listinfo/postgis-devel
>>    
>>
>
>  
>




More information about the postgis-devel mailing list