<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Query postGIS (ArcGIS shapefile) based on lat/lon position</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1498" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial color=#0000ff size=2>Hi Greene</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>What kind of geometries do U 
have?</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>select geometrytype(the_geom) from 
yourtable</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>perhaps U should use x() and y() 
</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>example</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>select x('point(5 
10)'::geometry)</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>returns 5</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>and </FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>
<DIV><FONT face=Arial color=#0000ff size=2>select y('point(5 
10)'::geometry)</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>returns 10</FONT></DIV></FONT></DIV>
<DIV>---------------------------------------------------------------<BR>TECHER 
Jean David<BR>01MAP<BR>e-mail: <A 
href="mailto:david@01map.net">david@01map.net</A><BR>Tél: 04 67 45 60 
27<BR>Entreprise: <A 
href="http://www.01map.net">http://www.01map.net</A><BR>Perso: <A 
href="http://techer.pascal.free.fr/postgis/">http://techer.pascal.free.fr/postgis/</A><BR>---------------------------------------------------------------</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=Courtney.Greene@drdc-rddc.gc.ca 
  href="mailto:Courtney.Greene@drdc-rddc.gc.ca">Greene, Courtney</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A 
  title=postgis-users@postgis.refractions.net 
  href="mailto:'postgis-users@postgis.refractions.net'">'postgis-users@postgis.refractions.net'</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, June 14, 2005 1:39 
PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [postgis-users] Query postGIS 
  (ArcGIS shapefile) based on lat/lonposition</DIV>
  <DIV><BR></DIV>
  <P><FONT face=Arial size=2>Hi,</FONT> <BR><FONT face=Arial size=2>I'm a new 
  user of postgres/postGIS, (Win2000, postgres 8.0.3, postGIS 9.0.1) but I have 
  managed to load the contents of an ArcGIS shapefile into postGIS and I'm able 
  to query and retrieve records based on the table contents. </FONT></P>
  <P><FONT face=Arial size=2>What I'm struggling with is trying to formulate and 
  execute a query based on a latitude/longitude position. I want to query and 
  retrieve the one record that describes the shape that is positioned over a 
  specific lat/lon position and I just don't know how to work with a lat/long 
  position and the positions as described in the shape file. Can any one offer 
  any suggestions as to how I can do this or where I may look for 
  answers?</FONT></P>
  <P><FONT face=Arial size=2>I appreciate any guidance that may be 
  offered.</FONT> </P>
  <P><FONT face=Arial size=2>Thanks,</FONT> <BR><FONT face=Arial 
  size=2>Courtney</FONT> </P>
  <P><FONT face=Arial size=2>Courtney Greene</FONT> <BR><FONT face=Arial 
  size=2>Defence R&D Canada - Atlantic</FONT> <BR><FONT face=Arial 
  size=2>Integrated Signatures Management</FONT> <BR><FONT face=Arial size=2>9 
  Grove Street (PO Box 1012)</FONT> <BR><FONT face=Arial size=2>Dartmouth, Nova 
  Scotia</FONT> <BR><FONT face=Arial size=2>Tel: 902-426-3100, Ext. 258</FONT> 
  <BR><FONT face=Arial size=2>Email: Courtney.Greene@drdc-rddc.gc.ca</FONT> 
  </P><BR>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>postgis-users 
  mailing 
  list<BR>postgis-users@postgis.refractions.net<BR>http://postgis.refractions.net/mailman/listinfo/postgis-users<BR></BLOCKQUOTE></BODY></HTML>