[postgis-devel] isvalid(geom), but st_ashexewkb(geom, 'NDR')::geometry fails

Obe, Regina robe.dnd at cityofboston.gov
Thu Oct 23 23:00:15 PDT 2008


David,

I don't think that is valid WKT syntax for an EMPTY multipolygon. If I try to stuff that in via ST_GeomFromText it returns invalid geometry. Not sure how you got that in there.

It should be

 SELECT ST_GeomFromText('MULTIPOLYGON EMPTY');


On 1.3.3 and 1.3.4SVN - when I do this - I get the below which is also kind of odd.  I would have expected it to maintain the empty polygon.

 SELECT ST_IsValid(the_geom), ST_AsText(the_geom), ST_IsEmpty(the_geom), ST_AsEWKT(the_geom)  FROM (SELECT ST_GeomFromText('MULTIPOLYGON EMPTY') As the_geom) As foo ;
 st_isvalid |        st_astext         | st_isempty |        st_asewkt         
------------+--------------------------+------------+--------------------------
 t          | GEOMETRYCOLLECTION EMPTY | t          | GEOMETRYCOLLECTION EMPTY
(1 row)

Hope that helps,
Regina
-----Original Message-----
From: postgis-devel-bounces at postgis.refractions.net on behalf of David Fuhry
Sent: Thu 10/23/2008 11:28 PM
To: PostGIS Development Discussion
Subject: [postgis-devel] isvalid(geom), but st_ashexewkb(geom,'NDR')::geometry fails
 
I have an empty multipolygon which isvalid(), but which the parser 
throws "ERROR:  geometry requires more points" on.  Is this a bug in 
isvalid(), or in the parser?  Interestingly, st_isempty() returns false.

db=> select geom from tt;
                          geom
------------------------------------------------------
  0106000020C90E00000100000001030000000100000000000000
(1 row)

db=> select st_astext(geom) from tt;
        st_astext
------------------------
  MULTIPOLYGON(( EMPTY))
(1 row)

db=> select isvalid(geom) from tt;
  isvalid
---------
  t
(1 row)

db=> select st_ashexewkb(geom,'NDR')::geometry from tt;
ERROR:  geometry requires more points

db=> select st_isempty(geom) from tt;
  st_isempty
------------
  f
(1 row)

db=> select version(), postgis_version();
                                         version 
                  |            postgis_version
-----------------------------------------------------------------------
-----------------+---------------------------------------
  PostgreSQL 8.3.1 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.3 
(Debian 4.2.3-4) | 1.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
(1 row)

Thanks,

Dave
_______________________________________________
postgis-devel mailing list
postgis-devel at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-devel




-----------------------------------------
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20081024/aa9fe886/attachment.html>


More information about the postgis-devel mailing list