Filtering with ST_AREA

6 messages Options
Embed this post
Permalink
Kang Mann Ern

Filtering with ST_AREA

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Hey guys,
 
I've been trying to get GeoTools to use the PostGIS ST_AREA function
when doing a SELECT query for some time so that fewer results are returned,
e.g. "SELECT * FROM table WHERE ST_AREA(the_geom) > 200;",  but have
 had no luck so far.
 
FilterFactory.function("ST_AREA", ...) gives an exception saying "St_area
cannot be found". If I replace "ST_AREA" with "AREA", it does post-fetching
filtering instead which is not what I wanted (I verified this by having PostgreSQL
log all queries - ST_AREA never shows up in the where clause).
 
I've searched through the sources and google but can't find mention of using
ST_AREA with GeoTools anywhere.
 
Was hoping to get some ideas on how this could be done.
 
Cheers,
riverfullofgood

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Mauricio Pazos

Re: Filtering with ST_AREA

Reply Threaded More More options
Print post
Permalink
On Wednesday 07 October 2009 01:43:15 am Kang Mann Ern wrote:
> FilterFactory.function("ST_AREA", ...) gives an exception saying "St_area
> cannot be found"
Hi, The function name should be "area", so test using
 FilterFactory.function("area", ...)

cheers
--
Mauricio Pazos
www.axios.es

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Kang Mann Ern

Re: Filtering with ST_AREA

Reply Threaded More More options
Print post
Permalink
Hi, thanks for the reply. I already tried that but it seem GeoTools stills
queries
everything from the database and filters them locally.  I checked this by
logging
all queries to the database.

I was thinking of maybe using the SQLBuilder to construct a query manually
but
that doesn't seem like the optimal way of doing it.

Could you give me a hint about an alternate way of doing this?

Cheers

--------------------------------------------------
From: "Mauricio Pazos" <[hidden email]>
Sent: Wednesday, October 07, 2009 5:42 PM
To: <[hidden email]>
Cc: "Kang Mann Ern" <[hidden email]>
Subject: Re: [Geotools-gt2-users] Filtering with ST_AREA

> On Wednesday 07 October 2009 01:43:15 am Kang Mann Ern wrote:
>> FilterFactory.function("ST_AREA", ...) gives an exception saying "St_area
>> cannot be found"
> Hi, The function name should be "area", so test using
> FilterFactory.function("area", ...)
>
> cheers
> --
> Mauricio Pazos
> www.axios.es
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Mauricio Pazos

Re: Filtering with ST_AREA

Reply Threaded More More options
Print post
Permalink
On Wednesday 07 October 2009 12:13:03 pm Kang Mann Ern wrote:
> Hi, thanks for the reply. I already tried that but it seem GeoTools stills
> queries
> everything from the database and filters them locally.  I checked this by
> logging
> all queries to the database.
>
I guess you have fund a bug. To report http://jira.codehaus.org/

> I was thinking of maybe using the SQLBuilder to construct a query manually

I think the problem is in the postgis data store, if I am right this approach
wont work. Probably the problem is the FilterVisitor implementation.

> but
> that doesn't seem like the optimal way of doing it.
>
> Could you give me a hint about an alternate way of doing this?
>
> Cheers


--
Mauricio Pazos
www.axios.es

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Kang Mann Ern

Re: Filtering with ST_AREA

Reply Threaded More More options
Print post
Permalink
Hi, sorry for the late reply. Thanks a lot for your help,
I'll make a bug report on that link.

Cheers!
--------------------------------------------------
From: "Mauricio Pazos" <[hidden email]>
Sent: Wednesday, October 07, 2009 9:18 PM
To: "Kang Mann Ern" <[hidden email]>
Cc: <[hidden email]>
Subject: Re: [Geotools-gt2-users] Filtering with ST_AREA

> On Wednesday 07 October 2009 12:13:03 pm Kang Mann Ern wrote:
>> Hi, thanks for the reply. I already tried that but it seem GeoTools
>> stills
>> queries
>> everything from the database and filters them locally.  I checked this by
>> logging
>> all queries to the database.
>>
> I guess you have fund a bug. To report http://jira.codehaus.org/
>
>> I was thinking of maybe using the SQLBuilder to construct a query
>> manually
>
> I think the problem is in the postgis data store, if I am right this
> approach
> wont work. Probably the problem is the FilterVisitor implementation.
>
>> but
>> that doesn't seem like the optimal way of doing it.
>>
>> Could you give me a hint about an alternate way of doing this?
>>
>> Cheers
>
>
> --
> Mauricio Pazos
> www.axios.es
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Mauricio Pazos

Re: Filtering with ST_AREA

Reply Threaded More More options
Print post
Permalink
On Friday 09 October 2009 05:03:33 am Kang Mann Ern wrote:
> Hi, sorry for the late reply.
no problem
> Thanks a lot for your help,
> I'll make a bug report on that link.
>
Good, it is the first step for your solution
Usually, the priorities of open source project don't match with our goals. I
don't know your project and the impact of this issue, but  in my experience, I
have got good result downloading the source and adjusting it to our
requirements or solving bugs (of course, previously evaluate effort, risk
analysis, etc ), we save a lot of person-hours.

> Cheers!
Good luck!
--
Mauricio Pazos
www.axios.es

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users