Hi Steve,
No problem. If you are using Postgres/PostGIS, then using a
PostGISDataStore and organizing your data in SimpleFeatures will net you
some benefits!
Check out
http://docs.geotools.org/stable/userguide/library/jdbc/postgis.html.
I'll try and respond later with more info about creating SimpleFeatures.
Jim
On 03/15/2015 02:17 PM, Stephen Brooke wrote:
Thanks for your speedy response Jim.
I have been looking at the SimpleFeature implementations and trying to
determine how to construct one from one of my classes. What is the
best way to construct a SimpleFeature instance, would you recommend
that I structure my data such that I can retrieve a SimpleFeature
directly from my PostGIS database? I was hoping to at first just
construct a SimpleFeature instance from one of my own classes.
--Steve
*From:*Jim Hughes [mailto:jn...@ccri.com]
*Sent:* Sunday, March 15, 2015 10:20 AM
*To:* geotools-gt2-users@lists.sourceforge.net
*Subject:* Re: [Geotools-gt2-users] CQL Parsing and Filtering with
GeoTools
Hi Steve,
As a quick reply, I'd suggest looking at ECQL rather than CQL. For
GeoServer, the community has extended CQL in a few ways.
Assuming that your users will write queries in (E)CQL, ECQL.toFilter
will parse the string and handle building a filter object. It is a
'big if', but if you are using SimpleFeatures, I know you'll be off to
the races immediately. With the filter, you can call
filter.evaluate(simpleFeature); the return is a boolean indicating if
your object satisfies the filter or not.
Anyhow, the good news is that 'evaluate' actually takes an Object, so
there's some chance you won't be restricted to storing your data as
SimpleFeatures. Unfortunately, I haven't traced through the various
classes to see how things work in detail. Others will be able to
speak to that better.
Does that help?
Jim
On 03/15/2015 12:54 PM, Stephen Brooke wrote:
Hi list,
I am thinking of using CQL as a filter language in my own
application and I’ve been looking at “gt-cql.jar” in the GeoTools
suite of tools as a library to do the heavy lifting. However, I’m
having trouble knowing where to start.
The scenario I am trying to implement is as follows:
A user creates a rule for how they want to receive notifications
about new data available and the rule can contain a filter which I
send to my application as a CQL filter. The application stores
the rule and when “new data available” event occurs the
application needs to go through all user rules and determine
whether notifications need to be sent to which users. So the
application needs to go through each rule and see which ones are a
match for the “new data available” event.
Does anyone have any pointers as to where to start if I want to
use GeoTools to help with this?
The classes I’ve studied so far are:
org.geoserver.wfs.GetFeature
org.geoserver.wfs.JoinExtractingVisitor
org.geoserver.monitor.FilterVisitorSupport
org.geotools.filter.FilterFactoryImpl
org.opengis.filter.Filter
org.geoserver.ows.KvpParser
org.geotools.filter.text.cql2.CQLTest
org.geotools.filter.text.cql2.CQL
--Steve
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website,
sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for
all
things parallel software development, from weekly thought leadership blogs
to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now.http://goparallel.sourceforge.net/
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
<mailto:GeoTools-GT2-Users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users