<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi Mike,<br><br>Look at "case" in your SQL, might meet your needs & if the ST_contains()/ST_covers() function reuslt is cached in a select statement, which I think it is now, will be reasonably effective.<br><br>http://www.postgresql.org/docs/9.0/interactive/plpgsql-control-structures.html<br><br>select case when ST_contains(poly, point) then point_name<br> else 'sorry, nothing matches' end as my_name,<br> case when ST_contains(poly, point) then point_desc<br>
else 'there is no description' end as my_desc,<br> ...<br><br>HTH,<br><br> Brent Wood<br><br>--- On <b>Fri, 5/27/11, Michael Welter <i><mike@introspect.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Michael Welter <mike@introspect.com><br>Subject: Re: [postgis-users] polygon of sphere<br>To: "PostGIS Users Discussion" <postgis-users@postgis.refractions.net><br>Date: Friday, May 27, 2011, 7:16 AM<br><br><div class="plainMail">Thanks, Paul,<br><br>I have a database of country borders. If the point lies within a particular border then the query will return country-specific information. If the point doesn't lie within a border then I would like to return some default information.<br><br>Mike<br><br>On May 26, 2011, at 12:42 PM, Paul
Ramsey wrote:<br><br>> Nope, there isn't. In fact, such a thing will give us the shakes as<br>> our code for determining in/out status of an object depends on first<br>> being able to generate one point that is definitively outside the<br>> containing area. Maybe there is some other way to skin your cat, what<br>> is the higher level problem you are trying to solve?<br>> <br>> P.<br>> <br>> On Thu, May 26, 2011 at 11:05 AM, Michael Welter <<a ymailto="mailto:mike@introspect.com" href="/mc/compose?to=mike@introspect.com">mike@introspect.com</a>> wrote:<br>>> Hello,<br>>> <br>>> Using type GEOGRAPHY, is there a polygon such that ST_COVERS(Polygon,Point) returns true for every point? Something like -180˚ to +180˚ longitude and -90˚ to +90˚ latitude?<br>>> <br>>> Thanks,<br>>> <br>>> _______________________________________________<br>>> postgis-users
mailing list<br>>> <a ymailto="mailto:postgis-users@postgis.refractions.net" href="/mc/compose?to=postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>>> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>>> <br>> _______________________________________________<br>> postgis-users mailing list<br>> <a ymailto="mailto:postgis-users@postgis.refractions.net" href="/mc/compose?to=postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>> <br><br>_______________________________________________<br>postgis-users mailing list<br><a ymailto="mailto:postgis-users@postgis.refractions.net"
href="/mc/compose?to=postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br></div></blockquote></td></tr></table>