[postgis-users] query on polygon type column

strk at refractions.net strk at refractions.net
Thu Jun 23 07:21:42 PDT 2005


On Thu, Jun 23, 2005 at 05:13:15PM +0300, orkun wrote:
> hello
> 
> say I have geodatabase which has been created in postgresql and in 
> following
> structure:
> 
> (cat int, pol polygon)
> 
> cat |                                       pol
> ----- 
> +------------------------------------------------------------------------------------------------------ 
> 
>  1  | ((35.50456,37.59156),(35.84032,37.91965),(35.78211,37.8825))
>  2  | ((45.50456,47.59156),(45.84032,47.91965),(45.78211,47.8825))
> 
> 
> how can I query this table on pol column something like
> select * from table where pol_val contains '45.50456,47.59156'
> How is using regular exp possible on pol ?

This has nothing to do with postgis.
Polygon is a core postgresql object.
Using Geometry, which is a postgis type, you can use
the contains() function for your kind of test.

--strk;



More information about the postgis-users mailing list