[postgis-devel] Minimum number of points in a POLYGON ring?

David Fuhry dfuhry at acm.org
Fri Sep 19 17:01:09 PDT 2008


Mark,

> Oracle Spatial

> So wow. While some behaviour can be implied from the documentation, the 
> point at which validation occurs is such a grey area that all I can 
> suggest is that we actually try some non-closed polygons in different 
> databases and see what happens. Any volunteers? ;)

Oracle Spatial itself does no validity checks:

SQL> create table tt as select sdo_geometry(2003, null, null, 
sdo_elem_info_array(1,1003,3), sdo_ordinate_array(0,0, 0,1, 1,1, 1,0, 
0,0)) as geom from dual;

Table created.

SQL> update tt a set a.geom.sdo_ordinates = sdo_ordinate_array(0,1,2);

1 row updated.

SQL> commit;

Commit complete.

SQL> select geom from tt;

SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 3), 
SDO_ORDINATE_ARRAY(0, 1, 2))

> Then again, it seems a few people are interested in being able to 
> brute-force bad things into the database to fix them up later. I think 
> that integrating liblwgeom into shp2pgsql/pgsql2shp would allow some 
> kind of --force option that would by-pass the parser checks by calling a 
> stored procedure such as "SELECT postgis_parser_check(0)" which would 
> turn off the checks for the duration of that session. Does that sound 
> like a reasonable compromise?

Yes, that approach sounds very reasonable.

Thanks,

Dave



More information about the postgis-devel mailing list