Re: [postgis-users] Casting a point and a polygon to geometry

2012-07-09 Thread Mike Toews
On 10 July 2012 06:53, Roba Binyahib  wrote:
> ST_Crosses(geometry g1, geometry g2);
>
> but I want g1 to be column of points and g2 a column of geometry, so how can
> I convert them to geometry enable to use the function

By column of "points", do you mean a PostGIS type, or a PostgreSQL
type[1]? If it is a PostGIS type, then it is a geometry, with it's own
internal type (Point, MultiPoint, Polygon, etc.).

> select r.name,u.id from river r, users u where
> ST_Crosses(r.point,u.polygon)='T' ;

ST_Crosses returns T/F, so you don't need to evaluate " ='T' ".

-Mike

[1] http://www.postgresql.org/docs/current/static/datatype-geometric.html
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Casting a point and a polygon to geometry

2012-07-09 Thread Roba Binyahib
Dear all

I want to use the following query

ST_Crosses(geometry g1, geometry g2);

but I want g1 to be column of points and g2 a column of geometry, so how
can I convert them to geometry enable to use the function


this is my query

select r.name,u.id from river r, users u where
ST_Crosses(r.point,u.polygon)='T' ;


hope you can help

thanks



---

Best Regards,
Roba

-- 

--
This message and its contents, including attachments are intended solely 
for the original recipient. If you are not the intended recipient or have 
received this message in error, please notify me immediately and delete 
this message from your computer system. Any unauthorized use or 
distribution is prohibited. Please consider the environment before printing 
this email.
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users