<div dir="ltr">Joseph,<div><br></div><div>Short answer - <span class="">ST_Intersects, see </span><a href="http://gis.stackexchange.com/questions/75537/how-to-run-st-intersects-on-a-geometry-from-text-and-an-existing-table">http://gis.stackexchange.com/questions/75537/how-to-run-st-intersects-on-a-geometry-from-text-and-an-existing-table</a></div>

<div><strong class=""><div style="font-weight:normal"><br></div><div style="font-weight:normal">see also</div><div style="font-weight:normal"><span class=""><a href="http://gis.stackexchange.com/questions/51869/how-to-find-out-whether-a-lat-long-position-resides-within-a-polygon">http://gis.stackexchange.com/questions/51869/how-to-find-out-whether-a-lat-long-position-resides-within-a-polygon</a></span></div>

<div style="font-weight:normal"><span class=""><br></span></div></strong></div><div><span class="">Longer answer -  go through the tutorial at <a href="http://workshops.boundlessgeo.com/postgis-intro/">http://workshops.boundlessgeo.com/postgis-intro/</a>  :-)</span></div>

<div>There are a couple of postgis - specific books that are available as well.</div><div><span class=""><br></span></div><div>Doug</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 8, 2014 at 11:35 AM, Joseph Spenner <span dir="ltr"><<a href="mailto:joseph85750@yahoo.com" target="_blank">joseph85750@yahoo.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:garamond,new york,times,serif;font-size:14pt"><div><span>Doug:</span></div>

<div style="color:rgb(0,0,0);font-size:18.6667px;font-family:garamond,new york,times,serif;background-color:transparent;font-style:normal"><span>  Thanks for the reply!   Sorry, I'm a bit new at this and kinda diving in head first.</span></div>

<div style="color:rgb(0,0,0);font-size:18.6667px;font-family:garamond,new york,times,serif;background-color:transparent;font-style:normal"><br><span></span></div><div style="color:rgb(0,0,0);font-size:18.6667px;font-family:garamond,new york,times,serif;background-color:transparent;font-style:normal">

<span>Does this help:</span></div><div style="color:rgb(0,0,0);font-size:18.6667px;font-family:garamond,new york,times,serif;background-color:transparent;font-style:normal"><br><span></span></div><div style="color:rgb(0,0,0);font-size:18.6667px;font-family:garamond,new york,times,serif;background-color:transparent;font-style:normal">

<span>----</span></div><div style="color:rgb(0,0,0);font-size:18.6667px;font-family:garamond,new york,times,serif;background-color:transparent;font-style:normal"><br></div><div><span><span style="font-family:Courier New,courier,monaco,monospace,sans-serif">polydata-# \d polys<br>

                                      Table "public.polys"<br>   Column   |            Type             |                      Modifiers                      <br>------------+-----------------------------+-----------------------------------------------------<br>

 gid        | integer                     | not null default nextval('polys_gid_seq'::regclass)<br> state      | character varying(2)        |
 <br> cwa        | character varying(9)        | <br> time_zone  | character varying(2)        | <br> fe_area    | character varying(2)        | <br> zone       | character varying(3)        | <br> name       | character varying(254)      | <br>

 state_zone | character varying(5)        | <br> lon        | numeric                     | <br> lat        | numeric                     | <br> shortname  | character varying(32)       | <br> geom       | geometry(MultiPolygon,4269) | <br>

Indexes:<br>    "polys_pkey" PRIMARY KEY, btree (gid)<br>    "polys_geom_gist" gist (geom)<br><br>polydata-# </span><br></span></div><div style="color:rgb(0,0,0);font-size:18.6667px;font-family:garamond,new york,times,serif;background-color:transparent;font-style:normal">

<br><span></span></div><div style="color:rgb(0,0,0);font-size:18.6667px;font-family:garamond,new york,times,serif;background-color:transparent;font-style:normal"><span>---</span></div><div style="color:rgb(0,0,0);font-size:18.6667px;font-family:garamond,new york,times,serif;background-color:transparent;font-style:normal">

<span>?</span></div><div style="color:rgb(0,0,0);font-size:18.6667px;font-family:garamond,new york,times,serif;background-color:transparent;font-style:normal"><span><br></span></div><div> </div><div>If life gives you lemons, keep them-- because hey.. free lemons.
</div><div><br><br></div><div>
<br>"~heart~ Sticker"  fixer:  <a href="http://microflush.org/stuff/stickers/heartFix.html" target="_blank">http://microflush.org/stuff/stickers/heartFix.html</a>
</div><div><br></div><div class="hm HOEnZb"><div><br></div><div>
<br></div><div><br></div>  </div><div style="font-family:garamond,new york,times,serif;font-size:14pt"><div class="hm HOEnZb"> </div><div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:12pt">

<div class="hm HOEnZb"> <div dir="ltr"> <hr size="1">  <font face="Arial"> <b><span style="font-weight:bold">From:</span></b> "Newcomb, Doug" <<a href="mailto:doug_newcomb@fws.gov" target="_blank">doug_newcomb@fws.gov</a>><br>

 <b><span style="font-weight:bold">To:</span></b> Joseph Spenner <<a href="mailto:joseph85750@yahoo.com" target="_blank">joseph85750@yahoo.com</a>>; PostGIS Users Discussion <<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a>> <br>

 <b><span style="font-weight:bold">Sent:</span></b> Friday, August 8, 2014 8:24 AM<br> <b><span style="font-weight:bold">Subject:</span></b> Re: [postgis-users] Accessing NWS poly data with lat/lon input<br> </font> </div>

</div><div><div class="h5"> <div><br><div><div><div dir="ltr">Joseph,<div>I don't see a geometry or geography field in your table listing.</div><div><br clear="none"></div><div>Doug </div></div><div><br clear="none">
<br clear="none">
<div>On Fri, Aug 8, 2014 at 11:12 AM, Joseph Spenner <span dir="ltr"><<a rel="nofollow" shape="rect" href="mailto:joseph85750@yahoo.com" target="_blank">joseph85750@yahoo.com</a>></span> wrote:<br clear="none">

<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div style="color:#000;background-color:#fff;font-family:garamond,new york,times,serif;font-size:14pt">Hello, I've just got postgresql93-server installed, with postgis21-postgresql93 on a CentOS system.<br clear="none">



<br clear="none">I then used shp2pgsql to load in some shape files using this procedure:<br clear="none"><br clear="none"><a rel="nofollow" shape="rect" href="http://suite.opengeo.org/docs/latest/dataadmin/pgGettingStarted/shp2pgsql.html" target="_blank">http://suite.opengeo.org/docs/latest/dataadmin/pgGettingStarted/shp2pgsql.html</a><br clear="none">



<br clear="none">The shapefiles were obtained from NWS:<br clear="none"><a rel="nofollow" shape="rect" href="http://www.nws.noaa.gov/geodata/catalog/wsom/html/pubzone.htm" target="_blank">http://www.nws.noaa.gov/geodata/catalog/wsom/html/pubzone.htm</a><br clear="none">

<br clear="none">Everything appears to have been written to the database properly:<br clear="none">

<br clear="none">polydata=# select state,time_zone,zone,name,lon,lat from polys where state='CO' limit 10;<br clear="none"> state | time_zone | zone |               name               |      lon       |      lat      <br clear="none">

-------+-----------+------+----------------------------------+----------------+---------------<br clear="none">

 CO    | M         | 048  | Logan County                     | -103.110114271 | 40.7246902558<br clear="none"> CO    | M         |
 044  | Morgan County                    | -103.809823690 | 40.2627093692<br clear="none"> CO    | M         | 050  | Sedgwick County                  | -102.351810279 | 40.8758426210<br clear="none"> CO    | M         | 049  | Washington County                | -103.201287262 | 39.9710250432<br clear="none">



 CO    | M         | 090  | Yuma County                      | -102.424258955 |
 40.0029195574<br clear="none"> CO    | M         | 099  | Springfield Vicinity/Baca County | -102.560453567 | 37.3192132374<br clear="none"> CO    | M         | 097  | Las Animas Vicinity/Bent County  | -103.071690129 | 37.9551177349<br clear="none">

 CO    | M         | 092  | Cheyenne County                  | -102.603398004 | 38.8279341557<br clear="none">

 CO    | M         | 089  | Crowley County                   | -103.784878922 | 38.3266440954<br clear="none"> CO    |
 M         | 091  | Kit Carson County                | -102.602884309 | 39.3054124576<br clear="none">(10 rows)<br clear="none"><br clear="none">polydata=#<br clear="none"><br clear="none">My goal is to construct a query providing lat/lon such that the result returned is the single row poly containing that point.<br clear="none">



<br clear="none">Does anyone know how I would construct this query?<br clear="none"><div>
<br clear="none">Thanks!<br clear="none"><br clear="none">Regards,<br clear="none">Joseph Spenner<br clear="none"><br clear="none"></div></div></div></div><br clear="none">_______________________________________________<br clear="none">


postgis-users mailing list<br clear="none">
<a rel="nofollow" shape="rect" href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br clear="none">
<a rel="nofollow" shape="rect" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br clear="none"></blockquote></div><br clear="none">

<br clear="all"><div><br clear="none"></div>-- <br clear="none"><div>

Doug Newcomb</div><div>USFWS</div><div>Raleigh, NC</div><div>919-856-4520 ext. 14 <a rel="nofollow" shape="rect" href="mailto:doug_newcomb@fws.gov" target="_blank">doug_newcomb@fws.gov</a></div><div>---------------------------------------------------------------------------------------------------------</div>



<div>The opinions I express are my own and are not representative of the official policy of the U.S.Fish and Wildlife Service or Dept. of the Interior.   Life is too short for undocumented, proprietary data formats.</div>




</div></div></div><br><br></div> </div></div></div> </div>  </div></div><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>

Doug Newcomb</div><div>USFWS</div><div>Raleigh, NC</div><div>919-856-4520 ext. 14 <a href="mailto:doug_newcomb@fws.gov" target="_blank">doug_newcomb@fws.gov</a></div><div>---------------------------------------------------------------------------------------------------------</div>

<div>The opinions I express are my own and are not representative of the official policy of the U.S.Fish and Wildlife Service or Dept. of the Interior.   Life is too short for undocumented, proprietary data formats.</div>


</div>