<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16809" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=553304213-10032009><FONT face=Arial 
color=#0000ff size=2>Yes.  Expect one is all I can say, but not at liberty 
to talk about the details right now.</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> 
postgis-users-bounces@postgis.refractions.net 
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of </B>mark 
balman<BR><B>Sent:</B> Tuesday, March 10, 2009 9:38 AM<BR><B>To:</B> PostGIS 
Users Discussion<BR><B>Subject:</B> Re: [postgis-users] Help with 
query<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>Hi Regina</DIV>
<DIV> </DIV>
<DIV>Many thanks to your prompt answer, the query works great now! In my 
query the coordinates were in Plate Carree metres and I think I confused myself 
with the transform function. Much appreciated, any news on the proposed postgis 
book?</DIV>
<DIV> </DIV>
<DIV>Cheers</DIV>
<DIV> </DIV>
<DIV>Mark<BR></DIV>
<DIV class=gmail_quote>On Tue, Mar 10, 2009 at 12:16 PM, Obe, Regina <SPAN 
dir=ltr><<A 
href="mailto:robe.dnd@cityofboston.gov">robe.dnd@cityofboston.gov</A>></SPAN> 
wrote:<BR>
<BLOCKQUOTE class=gmail_quote 
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
  <DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2>Mark,</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN> </DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>I'm a bit 
  confused,  for your second query, are those points suppose to represent 
  user input and in long lat?  They don't look like long lat.  If they 
  are meant to be long lat, then your args are just 
  backwards.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN> </DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>The basic 
  idea I think you want to do  is</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN> </DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>1) Take 
  user input which I presume is in 4326 and then transform it to Plate Carree to 
  match your existing data?</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>Note 
  ST_GeomFromText doesn't transform anything it simply states this data is in 
  long lat and then transform changes the coordinates to Plate 
  Carree</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN> </DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>So should 
  be</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN> </DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2>ST_Intersects(<FONT face="Times New Roman" color=#000000 
  size=3>pas_nat_iv_pnt.the_geom <FONT face=Arial color=#0000ff 
  size=2>,ST_Transform(</FONT></FONT>ST_GeomFromText(userinput,4326), 32662) 
  )</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN> </DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>Hope that 
  helps,</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
  size=2>Regina</FONT></SPAN></DIV><BR>
  <DIV lang=en-us dir=ltr align=left>
  <HR>
  <FONT face=Tahoma size=2><B>From:</B> <A 
  href="mailto:postgis-users-bounces@postgis.refractions.net" 
  target=_blank>postgis-users-bounces@postgis.refractions.net</A> [mailto:<A 
  href="mailto:postgis-users-bounces@postgis.refractions.net" 
  target=_blank>postgis-users-bounces@postgis.refractions.net</A>] <B>On Behalf 
  Of </B>mark balman<BR><B>Sent:</B> Tuesday, March 10, 2009 7:04 
  AM<BR><B>To:</B> <A href="mailto:postgis-users@postgis.refractions.net" 
  target=_blank>postgis-users@postgis.refractions.net</A><BR><B>Subject:</B> 
  [postgis-users] Help with query<BR></FONT><BR></DIV>
  <DIV>
  <DIV></DIV>
  <DIV class=h5>
  <DIV></DIV>
  <DIV>Hi all</DIV>
  <DIV> </DIV>
  <DIV>I am trying to create a query that returns the features intersected by a 
  user defined area. I can do this with the following query which works fine and 
  returns what I want:</DIV>
  <DIV> </DIV>
  <DIV>select areaname, country<BR>FROM pas_nat_iv_pnt<BR>where 
  ST_Intersects(pas_nat_iv_pnt.the_geom , 
  ST_GeomFromText('POLYGON((-7726647.392661 408830.119563 ,</DIV>
  <DIV>-6918290.736304  408830.119563 , -6918290.736304  828801.112346 
  , </DIV>
  <DIV>-7726647.392661  828801.112346 , -7726647.392661 408830.119563 ))' , 
  32662) )</DIV>
  <DIV> </DIV>
  <DIV>However, what I need to do is to have a user enter latitude and 
  longitude values and then transform these into Plate Carree coordinates, 
  I have tried the following query:</DIV>
  <DIV> </DIV>
  <DIV>select areaname, country<BR>FROM pas_nat_iv_pnt<BR>where  
  ST_Intersects(pas_nat_iv_pnt.the_geom , 
  transform(ST_GeomFromText('POLYGON((-7726647.392661 408830.119563 , 
  -6918290.736304  408830.119563 , -6918290.736304  828801.112346 , 
  -7726647.392661  828801.112346 , -7726647.392661 408830.119563 ))' , 
  32662),4326))</DIV>
  <DIV> </DIV>
  <DIV>The query runs but returns no rows.. I would be most grateful if anyone 
  could enlighten me on what is wrong and what I need to change.</DIV>
  <DIV> </DIV>
  <DIV>TIA</DIV>
  <DIV> </DIV>
  <DIV>Mark</DIV></DIV></DIV></DIV>
  <DIV>
  <P>
  <HR SIZE=1>

  <P></P>
  <P><STRONG>The substance of this message, including any attachments, may be 
  confidential, legally privileged and/or exempt from disclosure pursuant to 
  Massachusetts law. It is intended solely for the addressee. If you received 
  this in error, please contact the sender and delete the material from any 
  computer. </STRONG></P>
  <P></P></DIV>
  <P>
  <HR SIZE=1>

  <P></P>
  <P><STRONG><FONT color=#339900 size=2>Help make the earth a greener place. If 
  at all possible resist printing this email and join us in saving paper. 
  </FONT></STRONG></P>
  <P></P><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><BR>
  <P></P></BLOCKQUOTE></DIV><BR></BODY></HTML>

<HTML><BODY><P><hr size=1></P>
<P><STRONG>
The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer.
</STRONG></P></BODY></HTML>

<P><hr size=1></P>
<P><STRONG><font size="2" color="339900"> Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper. </p> <p> </font></STRONG></P>