<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>I believe you want ST_Contains.  Using sample Census TIGER data for states and counties:</div><div><br></div><div><div><font face="Courier New">SELECT COUNT(c.*)</font></div><div><font face="Courier New">FROM prod.states s</font></div><div><font face="Courier New">INNER JOIN prod.counties c</font></div><div><font face="Courier New">ON (s.name = 'Georgia'</font></div><div><font face="Courier New">AND ST_Contains(s.the_geom, c.the_geom));</font></div><div><font face="Courier New">--159</font></div><div><font face="Courier New"><br></font></div><div><font face="Courier New">SELECT COUNT(*) from prod.counties WHERE state_cd = 'GA';</font></div><div><font face="Courier New">--159</font></div></div><div><br></div><div>I suppose it's possible that the NWS polygons aren't using the exact same county/boundary border as your reference states boundaries.  As such, you could also use a slight negative buffer on the NWS polygons to further ensure that they don't overlap an adjacent state border.</div><div><br></div><div>Regards,</div><div>Pete Yunker</div><div><br></div><div><div>On Jan 21, 2015, at 5:01 PM, Joseph Spenner <<a href="mailto:joseph85750@yahoo.com">joseph85750@yahoo.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div style="background-color: rgb(255, 255, 255); font-family: garamond, 'new york', times, serif; font-size: 14px;"><div id="yui_3_16_0_1_1421843595215_200324">For the record, my best guess (which didn't work) was:</div><div id="yui_3_16_0_1_1421843595215_200326"><br></div><div dir="ltr" id="yui_3_16_0_1_1421843595215_200386">select ST_Asgeojson( geom ) from polys where ST_Intersects(ST_GeomFromGeoJSON('$jsonPoly'), geom)=TRUE and ST_Touches(ST_GeomFromGeoJSON('$jsonPoly'), geom)=FALSE<br style="" class=""><br></div><div dir="ltr" id="yui_3_16_0_1_1421843595215_200328">Since 'touch' seemed to be the way to address the perimeter points.  But apparently this is not the case.</div><div dir="ltr"><br></div><div id="yui_3_16_0_1_1421843595215_200330"><br></div><div id="yui_3_16_0_1_1421843595215_200318"><br><div id="yui_3_16_0_1_1421843595215_200332">
<br></div></div><br>  <div id="yui_3_16_0_1_1421843595215_200336" style="font-family: garamond, new york, times, serif; font-size: 14px;"> <div id="yui_3_16_0_1_1421843595215_200335" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div id="yui_3_16_0_1_1421843595215_200334" dir="ltr"> <hr size="1">  <font id="yui_3_16_0_1_1421843595215_200338" face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Joseph Spenner <<a href="mailto:joseph85750@yahoo.com">joseph85750@yahoo.com</a>><br> <b><span style="font-weight: bold;">To:</span></b> "<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>" <<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>> <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, January 21, 2015 2:22 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Possible for ST_Intersects to not include the perimeter?<br> </font> </div> <div id="yui_3_16_0_1_1421843595215_200340" class="y_msg_container"><br><div id="yiv2918310787"><div id="yui_3_16_0_1_1421843595215_200343"><div id="yui_3_16_0_1_1421843595215_200342" style="background-color: rgb(255, 255, 255); font-family: garamond, 'new york', times, serif; font-size: 14px;"><span id="yiv2918310787yui_3_16_0_1_1421843595215_194968">I have a polygon as an input, and I'm trying to find all polygons which share points, but not the perimiter points themselves.  Is this possible?</span><div id="yiv2918310787yui_3_16_0_1_1421843595215_194991" dir="ltr"><br><span id="yiv2918310787yui_3_16_0_1_1421843595215_194968"></span></div><div id="yiv2918310787yui_3_16_0_1_1421843595215_194992" dir="ltr"><span id="yiv2918310787yui_3_16_0_1_1421843595215_194968">Real application:</span></div><div id="yiv2918310787yui_3_16_0_1_1421843595215_194993" dir="ltr"><span id="yiv2918310787yui_3_16_0_1_1421843595215_194968">  I have NWS polygons describing Thunderstorm Warnings, which are made up of counties within the state.  Some of those counties might be on the edge of the state.  I want to query my database to show me all Warnings which are in a supplied state.  However, if I query the <i id="yui_3_16_0_1_1421843595215_200347">adjacent</i> state which borders the counties from the first state, I get those Warnings because they share the same parimeter points.</span></div><div id="yiv2918310787yui_3_16_0_1_1421843595215_195026" dir="ltr"><br><span id="yiv2918310787yui_3_16_0_1_1421843595215_194968"></span></div><div id="yiv2918310787yui_3_16_0_1_1421843595215_195032" dir="ltr"><span id="yiv2918310787yui_3_16_0_1_1421843595215_194968">Is there a way to construct a query which will not return anything if the only points in common are the perimeter values themselves?</span></div><div id="yiv2918310787yui_3_16_0_1_1421843595215_195033" dir="ltr"><br><span id="yiv2918310787yui_3_16_0_1_1421843595215_194968"></span></div><div id="yiv2918310787yui_3_16_0_1_1421843595215_195034" dir="ltr"><span id="yiv2918310787yui_3_16_0_1_1421843595215_194968">I tried a few variations on ST_Intersects/ST_Covers/ST_Contains/ST_Overlaps, supplying various AND/OR and TRUE/FALSE combinatins, but I can't seem to get the right combo to accomplish my task.</span></div><div id="yiv2918310787yui_3_16_0_1_1421843595215_195087" dir="ltr"><br><span id="yiv2918310787yui_3_16_0_1_1421843595215_194968"></span></div><div id="yiv2918310787yui_3_16_0_1_1421843595215_195088" dir="ltr"><span id="yiv2918310787yui_3_16_0_1_1421843595215_194968">Any help would be great.</span></div><div id="yiv2918310787yui_3_16_0_1_1421843595215_195107" dir="ltr"><br><span id="yiv2918310787yui_3_16_0_1_1421843595215_194968"></span></div><div id="yiv2918310787yui_3_16_0_1_1421843595215_195106" dir="ltr"><span id="yiv2918310787yui_3_16_0_1_1421843595215_194968">Thanks!</span></div><div id="yiv2918310787yui_3_16_0_1_1421843595215_195091" dir="ltr"><br><span id="yiv2918310787yui_3_16_0_1_1421843595215_194968"></span></div><div id="yiv2918310787yui_3_16_0_1_1421843595215_195090" dir="ltr"><span id="yiv2918310787yui_3_16_0_1_1421843595215_194968">Regards,</span></div><div id="yiv2918310787yui_3_16_0_1_1421843595215_195089" dir="ltr"><span id="yiv2918310787yui_3_16_0_1_1421843595215_194968">Joseph Spenner</span><br></div><div id="yiv2918310787yui_3_16_0_1_1421843595215_194841"><br><div id="yiv2918310787yui_3_16_0_1_1421843595215_195015">
<br></div></div></div></div></div><br><br></div> </div> </div>  </div></div>_______________________________________________<br>postgis-users mailing list<br><a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</blockquote></div><br></body></html>