<HTML dir=ltr><HEAD><TITLE>Re: [postgis-devel] ST_MakePolygon returns null geometrywhen passedNULL or empty array</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2900.3354" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText31577 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Well on the list of priorities, its pretty low on the totem pole at least for me and I'm not even sure its a desirable thing to do without some configuration switch if there is a cost penalty.  I think a simple note in the docs that these functions will not guarantee validity is sufficient and if they want to throw out invalid results they should do an after processing ST_IsValid check.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>I think as long as people are aware of it, that's probably good enough.  Just don't want people thinking because PostGIS lets you do it, then it is valid.  </FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Its actually kind of perversely comforting to know that I can create creatures that can't sustain life.  Almost as fun as working in a molecular biology lab again, but less dangerous.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>Regina</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> postgis-devel-bounces@postgis.refractions.net on behalf of Kevin Neufeld<BR><B>Sent:</B> Wed 7/9/2008 12:11 PM<BR><B>To:</B> PostGIS Development Discussion<BR><B>Subject:</B> Re: [postgis-devel] ST_MakePolygon returns null geometrywhen passedNULL or empty array<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>As a geometry constructor, this method is similar to the WKT or WKB<BR>parser which don't currently test for validity.  As MarkC pointed out a<BR>few emails ago (in the "Removing geometry parsing checks" thread),<BR>isvalid() calls are heavyweight and expensive to make.<BR><BR>Oh the other hand, this method is fundamentally different than the WKT/B<BR>parser in that it's highly unlikely to be used in any sort of bulk<BR>loading.  So maybe the performance hit for testing for validity (and<BR>throwing a NOTICE if necessary) is not so bad?  It would probably be the<BR>only geometry constructor that tests for validity though.<BR><BR>Cheers,<BR>Kevin<BR><BR>Obe, Regina wrote:<BR>> On the robust side of things should we be concerned that if we feed it<BR>> closed line strings that are not contained in the shell (or is the<BR>> shell) and/or overlap each other.  The function happily returns you an<BR>> invalid geometry.<BR>><BR>>  SELECT ST_IsValid(the_geom), ST_AsText(the_geom)<BR>> FROM (<BR>>    SELECT ST_MakePolygon(<BR>>      'LINESTRING(0 0, 0 8, 8 8, 8 0, 0 0)'::geometry,<BR>>      ARRAY['LINESTRING(0 0, 0 8, 8 8, 9 0, 0 0)'::geometry]) AS the_geom<BR>>    ) AS foo;<BR>><BR>> seems like it should give you a NOTICE or something.<BR>><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></FONT></P></DIV></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>