[postgis-users] query on polygon type column

Stephen Woodbridge woodbri at swoodbridge.com
Thu Jun 23 08:24:05 PDT 2005


strk at refractions.net wrote:
> 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;

Can a Polygon be cast or converted into a Geometry? If so then 
contains() would work.

-Steve



More information about the postgis-users mailing list