[postgis-users] RE: Select Point or PolyGon Polyline in Box

Obe, Regina robe.dnd at cityofboston.gov
Wed Apr 11 05:58:20 PDT 2007


Don't quite get what you are asking?  Are you trying to compare if 2
points are the same or if a point is within x distance of another point?
or something entirely different?

If you wanted to select all points within x distance of your reference
point , then it would be (again replace -1 with the correct SRID and
distance is always measured in the units of your spatial reference
system)

SELECT * 
FROM pointdemo
WHERE the_point && Expand(GeomFromText('POINT(295149 2315499)', -1), 10)
AND
	distance(the_point,GeomFromText('POINT(295149 2315499)', -1)) <=
10

If you wanted to know if 2 points are the same then it would be
SELECT * 
FROM pointdemo
WHERE the_point ~= GeomFromText('POINT(295149 2315499)', -1)
   

 

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
anhtin
Sent: Wednesday, April 11, 2007 12:32 AM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] RE: Select Point or PolyGon Polyline in Box


thanks 
How is Select if it is Point ?????



Obe, Regina     DND\MIS wrote:
> 
> Assuming your box is in the same srid as your points.  It would be
> something like
> 
> SELECT *
> FROM pointdemo
> WHERE  the_point && setsrid('BOX(295149 2315499, 465992
> 2163790)'::box2d, -1)
> 
> 
> Note - above I am assuming your point geometry is called the_point and
> your SRID is -1
> If the srid of your point geometry is not -1 then change  -1 to what
it
> should be.
> 
> 
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
> anhtin
> Sent: Tuesday, April 10, 2007 6:18 AM
> To: postgis-users at postgis.refractions.net
> Subject: [postgis-users] Select Point or PolyGon Polyline in Box
> 
> 
> hi all
> i have question to postgis
> i have table Pointdemo
> I want select all point in my Box("Rectangle") on PostGis
> my box is corrdinate 
> ex: full extend is:Box(110638 2587481, 903350 1972446) ---> xmin ymin,
> xmax
> ymax
> i want select point in Box(295149 2315499, 465992 2163790)  ---> xmin
> ymin,
> xmax ymax
> How will i do that ?????
> 
> 
> -- 
> View this message in context:
>
http://www.nabble.com/Select-Point-or-PolyGon-Polyline-in-Box-tf3552167.
> html#a9916986
> Sent from the PostGIS - User mailing list archive at Nabble.com.
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> -----------------------------------------
> 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.
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> 

-- 
View this message in context:
http://www.nabble.com/Select-Point-or-PolyGon-Polyline-in-Box-tf3552167.
html#a9933066
Sent from the PostGIS - User mailing list archive at Nabble.com.

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list