<html><body><div style="color:#000; background-color:#fff; font-family:garamond, new york, times, serif;font-size:14px"><div id="yiv6695718167"><div id="yui_3_16_0_1_1422892475699_90264"><div id="yui_3_16_0_1_1422892475699_90263" style="color:#000;background-color:#fff;font-family:garamond, new york, times, serif;font-size:14px;"><div id="yui_3_16_0_1_1422892475699_90262">Regina:</div><div id="yui_3_16_0_1_1422892475699_90265" dir="ltr"><div id="yui_3_16_0_1_1422892475699_90327" dir="ltr"> That was the fix! I'm still trying to get this all figured out, but I'm slowly making progress. I used 10 instead of 1, which seemed like a fair guess. This eliminated my border match.</div><div id="yui_3_16_0_1_1422892475699_90328" dir="ltr"><br></div></div><div id="yui_3_16_0_1_1422892475699_90322" dir="ltr"><br clear="none"></div><div id="yui_3_16_0_1_1422892475699_90321" dir="ltr">Thanks for the help!</div><div id="yui_3_16_0_1_1422892475699_90303" dir="ltr"><br clear="none"></div><div id="yui_3_16_0_1_1422892475699_90302" dir="ltr">Regards,</div><div dir="ltr" id="yiv6695718167yui_3_16_0_1_1422892475699_82367">Joseph Spenner</div><div dir="ltr" id="yiv6695718167yui_3_16_0_1_1422892475699_82368"><br clear="none"></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_82347"><span></span></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_82366"> </div><div id="yiv6695718167yui_3_16_0_1_1422892475699_82348"><div id="yiv6695718167yui_3_16_0_1_1422892475699_82365">If life gives you lemons, keep them-- because hey.. free lemons.
</div><br clear="none"><br clear="none"><div id="yiv6695718167yui_3_16_0_1_1422892475699_82349">
<br clear="none">"~heart~ Sticker" fixer: http://microflush.org/stuff/stickers/heartFix.html
</div><br clear="none"><br clear="none"><div id="yui_3_16_0_1_1422892475699_90304">
<br clear="none"></div></div><br clear="none"> <div id="yiv6695718167yui_3_16_0_1_1422892475699_82371" style="font-family:garamond, new york, times, serif;font-size:14px;"> <div id="yiv6695718167yui_3_16_0_1_1422892475699_82370" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div class="qtdSeparateBR"><br><br></div><div class="yiv6695718167yqt7130377812" id="yiv6695718167yqt19777"><div dir="ltr" id="yiv6695718167yui_3_16_0_1_1422892475699_82369"> <hr id="yui_3_16_0_1_1422892475699_90320" size="1"> <font id="yui_3_16_0_1_1422892475699_90305" face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Paragon Corporation <lr@pcorp.us><br clear="none"> <b><span style="font-weight:bold;">To:</span></b> 'PostGIS Users Discussion' <postgis-users@lists.osgeo.org> <br clear="none"> <b><span style="font-weight:bold;">Sent:</span></b> Monday, February 2, 2015 11:58 AM<br clear="none"> <b><span style="font-weight:bold;">Subject:</span></b> Re: [postgis-users] Possible for ST_Intersects to not include the perimeter?<br clear="none"> </font> </div> <div id="yui_3_16_0_1_1422892475699_90306" class="yiv6695718167y_msg_container"><br clear="none"><div id="yiv6695718167"><style>#yiv6695718167 --
filtered {font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;}
#yiv6695718167 filtered {panose-1:2 4 5 3 5 4 6 3 2 4;}
#yiv6695718167 filtered {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}
#yiv6695718167 filtered {font-family:Garamond;panose-1:2 2 4 4 3 3 1 1 8 3;}
#yiv6695718167
p.yiv6695718167MsoNormal, #yiv6695718167 li.yiv6695718167MsoNormal, #yiv6695718167 div.yiv6695718167MsoNormal
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}
#yiv6695718167 a:link, #yiv6695718167 span.yiv6695718167MsoHyperlink
{color:blue;text-decoration:underline;}
#yiv6695718167 a:visited, #yiv6695718167 span.yiv6695718167MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
#yiv6695718167 span.yiv6695718167EmailStyle17
{color:#1F497D;}
#yiv6695718167 .yiv6695718167MsoChpDefault
{font-size:10.0pt;}
#yiv6695718167 filtered {margin:1.0in 1.0in 1.0in 1.0in;}
#yiv6695718167 div.yiv6695718167WordSection1
{}
#yiv6695718167 </style><div id="yui_3_16_0_1_1422892475699_90310"><div id="yui_3_16_0_1_1422892475699_90309" class="yiv6695718167WordSection1"><div id="yui_3_16_0_1_1422892475699_90308" class="yiv6695718167MsoNormal"><span id="yui_3_16_0_1_1422892475699_90307" style="font-size:11.0pt;">What is the spatial reference system of your data. If it’s in degrees, your areas are all going to be all < 1. You’d have to go with something like 0.0001 or cast your data to geography when you do the check</span></div><div id="yui_3_16_0_1_1422892475699_90311" class="yiv6695718167MsoNormal"><span style="font-size:11.0pt;"> </span></div><div id="yui_3_16_0_1_1422892475699_90313" class="yiv6695718167MsoNormal"><span id="yui_3_16_0_1_1422892475699_90312" style="font-size:11.0pt;">e.g. assuming your srid is 4326 </span></div><div id="yui_3_16_0_1_1422892475699_90314" class="yiv6695718167MsoNormal"><span style="font-size:11.0pt;"> </span></div><div id="yui_3_16_0_1_1422892475699_90316" class="yiv6695718167MsoNormal" style="background:white;"><span id="yui_3_16_0_1_1422892475699_90315" style="font-size:10.5pt;">select ST_Asgeojson( geom ) from table where ST_Intersects(ST_GeomFromGeoJSON('$state'), geom)=TRUE and ST_Area(ST_Intersection(ST_GeomFromGeoJSON('$state')::geography, geom::geography))>1</span></div><div id="yui_3_16_0_1_1422892475699_90317" class="yiv6695718167MsoNormal"><span style="font-size:11.0pt;"> </span></div><div class="yiv6695718167MsoNormal"><span style="font-size:11.0pt;">Hope that helps,</span></div><div class="yiv6695718167MsoNormal"><span style="font-size:11.0pt;"> </span></div><div class="yiv6695718167MsoNormal"><span style="font-size:11.0pt;">Regina</span></div><div class="yiv6695718167MsoNormal"><span style="font-size:11.0pt;"><a rel="nofollow" shape="rect" target="_blank" href="http://www.postgis.us/">http://www.postgis.us</a></span></div><div class="yiv6695718167MsoNormal"><span style="font-size:11.0pt;"><a rel="nofollow" shape="rect" target="_blank" href="http://postgis.net/">http://postgis.net</a></span></div><div class="yiv6695718167MsoNormal"><span style="font-size:11.0pt;"> </span></div><div class="yiv6695718167MsoNormal"><span style="font-size:11.0pt;"> </span></div><div class="yiv6695718167MsoNormal"><span style="font-size:11.0pt;"> </span></div><div class="yiv6695718167qtdSeparateBR"><br clear="none"><br clear="none"></div><div class="yiv6695718167yqt4189761243" id="yiv6695718167yqt05879"><div><div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in;"><div class="yiv6695718167MsoNormal"><b><span style="font-size:11.0pt;">From:</span></b><span style="font-size:11.0pt;"> postgis-users-bounces@lists.osgeo.org [mailto:postgis-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Joseph Spenner<br clear="none"><b>Sent:</b> Monday, February 02, 2015 1:31 PM<br clear="none"><b>To:</b> PostGIS Users Discussion<br clear="none"><b>Subject:</b> Re: [postgis-users] Possible for ST_Intersects to not include the perimeter?</span></div></div></div><div class="yiv6695718167MsoNormal"> </div><div><div id="yiv6695718167"><div id="yiv6695718167yui_3_16_0_1_1422892475699_66013"><div id="yiv6695718167yui_3_16_0_1_1422892475699_66012"><div><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;">Chris:</span></div></div><div><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;"> I've been trying to get your suggestion to work as well, but appear to be having some problem with the syntax.</span></div></div><div><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;"> </span></div></div><div><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;">I currently have a situation where I have a polygon completely inside of a state, as well as a couple on the border.</span></div></div><div><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;">I have a query, but it returns ZERO:</span></div></div><div><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;"> </span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66295"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;">select ST_Asgeojson( geom ) from table where ST_Intersects(ST_GeomFromGeoJSON('$state'), geom)=TRUE and ST_Area(ST_Intersection(ST_GeomFromGeoJSON('$state'), geom))>1</span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66340"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;"> </span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66514"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;"> </span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66341"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;">I have been using the following, with pretty good success:</span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66342"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;"> </span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66350"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;">select ST_Asgeojson( geom ) from table where ST_Intersects(ST_GeomFromGeoJSON('$state'), geom)=TRUE and ST_Touches(ST_GeomFromGeoJSON('$state'), geom)=FALSE</span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66352"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;"> </span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66425"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;">But sometimes, there seems to be a really tiny square centimeter of area which makes the above succeed, so I would like to have at least some value to describe "how much intersection?" there is. But even using a small value (1), it always makes my select return no rows.</span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66517"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;"> </span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66518"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;">Ideas?</span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66519"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;"><br clear="none">Thanks!</span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66520"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;"> </span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66584"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;">Regardds,</span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66583"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;">Joseph Spenner</span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66582"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;"> </span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_64496"><div class="yiv6695718167MsoNormal" style="background:white;"><span style="font-size:10.5pt;"> </span></div></div><div><div class="yiv6695718167MsoNormal" style="margin-bottom:12.0pt;background:white;"><span style="font-size:10.5pt;"> </span></div></div><div id="yiv6695718167yqt12816"><div id="yiv6695718167yui_3_16_0_1_1422892475699_64527"><div id="yiv6695718167yui_3_16_0_1_1422892475699_64526"><div id="yiv6695718167yui_3_16_0_1_1422892475699_64525"><div class="yiv6695718167MsoNormal" style="text-align:center;background:white;" align="center"><span style=""></span><hr size="1" width="100%" align="center"></div><div class="yiv6695718167MsoNormal" style="background:white;"><b id="yiv6695718167yui_3_16_0_1_1422892475699_66294"><span style="font-size:10.0pt;">From:</span></b><span style="font-size:10.0pt;"> Christopher Swingley <<a rel="nofollow" shape="rect" ymailto="mailto:cswingle@swingleydev.com" target="_blank" href="mailto:cswingle@swingleydev.com">cswingle@swingleydev.com</a>><br clear="none"><b>To:</b> Joseph Spenner <<a rel="nofollow" shape="rect" ymailto="mailto:joseph85750@yahoo.com" target="_blank" href="mailto:joseph85750@yahoo.com">joseph85750@yahoo.com</a>> <br clear="none"><b>Cc:</b> PostGIS Users Discussion <<a rel="nofollow" shape="rect" ymailto="mailto:postgis-users@lists.osgeo.org" target="_blank" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>> <br clear="none"><b id="yiv6695718167yui_3_16_0_1_1422892475699_66292">Sent:</b> Wednesday, January 21, 2015 4:58 PM<br clear="none"><b id="yiv6695718167yui_3_16_0_1_1422892475699_66290">Subject:</b> Re: [postgis-users] Possible for ST_Intersects to not include the perimeter?</span><span style=""></span></div></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66280"><div class="yiv6695718167MsoNormal" style="background:white;"><span style=""><br clear="none">Joseph,<br clear="none"><br clear="none">On Wed, Jan 21, 2015 at 2:34 PM, Joseph Spenner <<a rel="nofollow" shape="rect" ymailto="mailto:joseph85750@yahoo.com" target="_blank" href="mailto:joseph85750@yahoo.com">joseph85750@yahoo.com</a>> wrote:</span></div><div id="yiv6695718167yui_3_16_0_1_1422892475699_66281"><div class="yiv6695718167MsoNormal" style="margin-bottom:12.0pt;background:white;"><span style=""> </span></div></div><div id="yiv6695718167yqtfd57069"><div class="yiv6695718167MsoNormal" style="background:white;"><span style=""><br clear="none">> I have NWS polygons describing Thunderstorm Warnings, which are made up of<br clear="none">> counties within the state. Some of those counties might be on the edge of<br clear="none">> the state. I want to query my database to show me all Warnings which are in<br clear="none">> a supplied state. However, if I query the adjacent state which borders the<br clear="none">> counties from the first state, I get those Warnings because they share the<br clear="none">> same parimeter points.</span></div></div><div class="yiv6695718167MsoNormal" style="background:white;"><span style=""><br clear="none"><br clear="none">What about finding the states that intersect thunderstorm warnings<br clear="none">where the intersection area is greater than some small threshold?<br clear="none">Something like:<br clear="none"><br clear="none">ST_Intersects(warning_geom, state_geom) AND<br clear="none">ST_Area(ST_Intersection(warning_geom, state_geom)) > 1000<br clear="none"><br clear="none">Cheers,<br clear="none"><br clear="none">Chris<br clear="none">-- <br clear="none">Christopher Swingley<br clear="none">Fairbanks, Alaska<br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://swingleydev.com/">http://swingleydev.com/</a><br clear="none"><a rel="nofollow" shape="rect" ymailto="mailto:cswingle@swingleydev.com" target="_blank" href="mailto:cswingle@swingleydev.com">cswingle@swingleydev.com</a></span></div><div id="yiv6695718167yqtfd70884"><div class="yiv6695718167MsoNormal" style="background:white;"><span style=""> </span></div></div><div class="yiv6695718167MsoNormal" style="margin-bottom:12.0pt;background:white;"><span style=""> </span></div></div></div></div></div></div></div></div></div></div></div></div></div><br clear="none"><div class="yiv6695718167yqt4189761243" id="yiv6695718167yqt49313">_______________________________________________<br clear="none">postgis-users mailing list<br clear="none"><a rel="nofollow" shape="rect" ymailto="mailto:postgis-users@lists.osgeo.org" target="_blank" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a></div><br clear="none"><br clear="none"></div></div> </div> </div> </div></div></div></div></body></html>