<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>RE: [postgis-devel] isvalid(geom), but st_ashexewkb(geom,'NDR')::geometry fails</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>David,<BR>
<BR>
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.<BR>
<BR>
It should be<BR>
<BR>
 SELECT ST_GeomFromText('MULTIPOLYGON EMPTY');<BR>
<BR>
<BR>
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.<BR>
<BR>
 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 ;<BR>
 st_isvalid |        st_astext         | st_isempty |        st_asewkt        <BR>
------------+--------------------------+------------+--------------------------<BR>
 t          | GEOMETRYCOLLECTION EMPTY | t          | GEOMETRYCOLLECTION EMPTY<BR>
(1 row)<BR>
<BR>
Hope that helps,<BR>
Regina<BR>
-----Original Message-----<BR>
From: postgis-devel-bounces@postgis.refractions.net on behalf of David Fuhry<BR>
Sent: Thu 10/23/2008 11:28 PM<BR>
To: PostGIS Development Discussion<BR>
Subject: [postgis-devel] isvalid(geom), but st_ashexewkb(geom,'NDR')::geometry fails<BR>
<BR>
I have an empty multipolygon which isvalid(), but which the parser<BR>
throws "ERROR:  geometry requires more points" on.  Is this a bug in<BR>
isvalid(), or in the parser?  Interestingly, st_isempty() returns false.<BR>
<BR>
db=> select geom from tt;<BR>
                          geom<BR>
------------------------------------------------------<BR>
  0106000020C90E00000100000001030000000100000000000000<BR>
(1 row)<BR>
<BR>
db=> select st_astext(geom) from tt;<BR>
        st_astext<BR>
------------------------<BR>
  MULTIPOLYGON(( EMPTY))<BR>
(1 row)<BR>
<BR>
db=> select isvalid(geom) from tt;<BR>
  isvalid<BR>
---------<BR>
  t<BR>
(1 row)<BR>
<BR>
db=> select st_ashexewkb(geom,'NDR')::geometry from tt;<BR>
ERROR:  geometry requires more points<BR>
<BR>
db=> select st_isempty(geom) from tt;<BR>
  st_isempty<BR>
------------<BR>
  f<BR>
(1 row)<BR>
<BR>
db=> select version(), postgis_version();<BR>
                                         version<BR>
                  |            postgis_version<BR>
-----------------------------------------------------------------------<BR>
-----------------+---------------------------------------<BR>
  PostgreSQL 8.3.1 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.3<BR>
(Debian 4.2.3-4) | 1.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1<BR>
(1 row)<BR>
<BR>
Thanks,<BR>
<BR>
Dave<BR>
_______________________________________________<BR>
postgis-devel mailing list<BR>
postgis-devel@postgis.refractions.net<BR>
<A HREF="http://postgis.refractions.net/mailman/listinfo/postgis-devel">http://postgis.refractions.net/mailman/listinfo/postgis-devel</A><BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>
<HTML><BODY><P><hr size=1></P>
<P><STRONG>
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.
</STRONG></P></BODY></HTML>

<P><hr size=1></P>
<P><STRONG><font size="2" color="339900"> Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper. </p> <p> </font></STRONG></P>