<!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=741251212-10032009><FONT face=Arial
color=#0000ff size=2>Mark,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=741251212-10032009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=741251212-10032009><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 class=741251212-10032009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=741251212-10032009><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 class=741251212-10032009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=741251212-10032009><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 class=741251212-10032009><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 class=741251212-10032009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=741251212-10032009><FONT face=Arial
color=#0000ff size=2>So should be</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=741251212-10032009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=741251212-10032009><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 class=741251212-10032009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=741251212-10032009><FONT face=Arial
color=#0000ff size=2>Hope that helps,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=741251212-10032009><FONT face=Arial
color=#0000ff size=2>Regina</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 7:04 AM<BR><B>To:</B>
postgis-users@postgis.refractions.net<BR><B>Subject:</B> [postgis-users] Help
with query<BR></FONT><BR></DIV>
<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></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>