Thanks Paul!<br><br><div class="gmail_quote">On Thu, May 31, 2012 at 1:12 PM, Paul Ramsey <span dir="ltr"><<a href="mailto:pramsey@opengeo.org" target="_blank">pramsey@opengeo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
select tz.tzid<br>
from tz_world tz, locations locs<br>
where st_contains(tz.the_geom, st_makepoint(locs.longitude, locs.latitude))<br>
and <a href="http://loc.id" target="_blank">loc.id</a> = ?;<br>
<div><div class="h5"><br>
<br>
On Thu, May 31, 2012 at 12:57 PM, Scott Chapman <<a href="mailto:scott@mischko.com">scott@mischko.com</a>> wrote:<br>
> I have the following table for time zone data:<br>
><br>
> CREATE TABLE tz_world<br>
> (<br>
>   gid serial NOT NULL,<br>
>   tzid character varying(30),<br>
>   the_geom geometry,<br>
>   CONSTRAINT tz_world_pkey PRIMARY KEY (gid ),<br>
>   CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2),<br>
>   CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) =<br>
> 'MULTIPOLYGON'::text OR the_geom IS NULL),<br>
>   CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = (-1))<br>
> )<br>
><br>
> and a location table:<br>
><br>
> CREATE TABLE locations<br>
> (<br>
>   id bigserial NOT NULL,<br>
>   latitude numeric,<br>
>   longitude numeric,<br>
> )<br>
><br>
> Given a location id, I want to know what time zone it's in.  I'm brand new<br>
> to GIS and have not been able to figure out this query. I have PostgreSQL<br>
> 9.1 and PostGIS 1.5.3 installed and set up, and the timezone data imported<br>
> using the shape file import wizard.<br>
><br>
> Can someone please give me an example of how to query lat/lon in the_geom?<br>
><br>
> Thanks!<br>
> Scott<br>
><br>
</div></div>> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto: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 href="mailto: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>
</blockquote></div><br>