<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Okay this is a bit dated now, but I needed to get everything entered
correctly before proceeding.  The point-in-polygon method you
referenced is what I'm looking for and searching for good examples of
implementing this has not yielded good results.  This is most likely
due to my ignorance is what I need to look for, so I guess I'm trying
to find the fastest method of finding the polygon that a point lies
within.  The points and polygons are predefined and in separate table. 
Also gist indexes exist on the geom columns so what is the most
efficient query of returning the polygon a point lies within?<br>
<br>
Here is the query I have now:<br>
<br>
select imp_territories.store from phone_points,imp_territories where
phone_points.phone_lat = 39.5457 AND phone_points.phone_long = -89.2935
AND phone_points.the_geom && imp_territories.the_geom and
contains(imp_territories.the_geom, phone_points.the_geom);  <br>
<br>
It seems to work fine(232 ms), just looking for further input.<br>
<br>
<br>
<br>
Paul Ramsey wrote:
<blockquote
 cite="mid:30fe546d0808051246p6386bee5u2877020e9392a36d@mail.gmail.com"
 type="cite">
  <pre wrap="">Well, that's the opposite of the usual point-in-polygon use case
(given an existing set of polygons and a point input, tell me what
polygons it falls within), but it's equally tractable.

You need an input interface, and that will be the hardest part of your
task. You can do something in Google Maps, if you like, then stuff the
geometry down into a script (php, asp, whatever) that in turn
inscribes it into a SQL statement ala:

select points.id, points.name from points where
st_contains('POLYGON(....)', points.geometry);

Where the 'POLYGON(...)' is constructed by your script from your user
interface input.

Enjoy,

P.

On Tue, Aug 5, 2008 at 12:24 PM, Adam Vande More <a class="moz-txt-link-rfc2396E" href="mailto:adam@imedmobility.com"><adam@imedmobility.com></a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hello,

Perhaps my questions were addressed earlier or in some documentation I
missed. If so, I apologize in advance as I am completely new to GIS and
PostGIS.  Judging from the documentation I have read, my needs are extremely
simple vs PostGIS capabilities however I am unsure if the functionality of
what I want actually exists.

I deal with areas in the US, territories that are regional in nature but not
bounded by common things eg state lines, water ways, counties, etc.  They
are irregular shapes of varying land area.  I also have sets of latitude and
longitude points.  I would like some type of system where I enter in a
perimeter of  territories, and find out whether a particular latitude and
longitude point lies within that perimeter.
My understanding of this is that I would need to either manually create a
GML type file with the perimeters in it, or use some type of map authoring
software to accomplish this goal.  Are my understandings correct and if so
is there a recommendation for a particular piece of software which can
fulfill this?

Also, are the libraries/functions available for determining whether a point
is in a perimeter?

Much appreciated,

--
Adam Vandemore
Systems Administrator
IMED Mobility
(605) 498-1610

_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
<a class="moz-txt-link-freetext" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>

    </pre>
  </blockquote>
  <pre wrap=""><!---->_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
<a class="moz-txt-link-freetext" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>
  </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
Adam Vande More
Systems Administrator
IMED Mobility
(605) 498-1610 </pre>
</body>
</html>