[Geoserver-users] [Geotools-gt2-users] Filter to SQL mapping in GeoTools

Hi Brett

(it is appreciated if you can keep all replies on the public mailing list, thanks)

So if I am not mistaken what you are asking for is a way to parse a GML file and populate features in an oracle table? Yes, that should be very doable. Basically just create an oracle data store, create a streaming gml parser (or a wfs datastore if the GML is coming from a WFS). And insert features into the db that come out of the parser.

-Justin

Levasseur, Brett wrote:

Justin,

We are using an Oracle backend for our database. Since I posted this question I have done some other checking into GeoTools support of GML. I found some information that suggests that GeoTools attempts to support the Feature Geometry Abstract Specification using the Simple Feature Implementation Specification. Would it be safe to say that if a user sent us an XML file where the GML data conformed to the GML simple features profile we would be able to parse it into a SQL statement with GeoTools? Thanks for the information.

Brett

-----Original Message-----
From: Justin Deoliveira [mailto:jdeolive@anonymised.com] Sent: Wednesday, March 25, 2009 3:51 PM
To: Levasseur, Brett
Cc: 'geotools-gt2-users@lists.sourceforge.net'
Subject: Re: [Geotools-gt2-users] Filter to SQL mapping in GeoTools

Hi Brett,

So yeah, the FilterToSQL does a lot of the work. Basically anything that is considered a standard across databases in terms of SQL can be handle d with it. So most of the basic arithmetic and comparison expressions, etc...

But geometry filters are unfortunately encoded quite differently across postgis, oracle, db2, etc... so they have to be customized on a database by database basis.

We have recently re-architected our database back end and created the notion of a dialect. The dialect encapsulates the parts that differ across database implementations.

So based on which actual backend you are working with you may be able to use FilterToSQL in conjunction with one of the dialects to build up your SQL statements. Which database back end are you targeting?

-Justin

Levasseur, Brett wrote:

Hello,

I am new to GeoTools and I have a question. I am working on a project where I will need to take in xml documents that have OGC Filter statements and I will have to produce corresponding SQL where statements. I took a quick look at version 2.5.1 of GeoTools and saw the class FilterToSQL. However the comments for this class note that Geometry Filters cannot be encoded. What exactly does this mean? I am looking at instances where I will need to make SQL statements from filters that may ask for events that are relevant to locations such as show me everything that happened in this bounding box. Would a query like this still work, or is bounding box a type of geometry that will not work?

I ask because when I used a program called GeoServer, which uses GeoTools, I was able to make WFS queries that used bounding boxes to find specific data. I had assumed that GeoTools was doing all of the filter to SQL conversions, does anyone know if this so or not?

I also noted in the comments for this class that the reason for the lack of support was due to OGC's specifying two ways of doing SQL databases. The comments then note that it is possible to add functionality by subclassing off of the encoder you need, putting in the proper GeometryFilter visit method, and adding filter types. Does anyone know if doing this would allow me to fully support all possible OGC Filter statements that I could receive? Also does anyone know how much work this would entail? I am just trying to find out if GeoTools is still my best option or if I should be looking for another solution, any help would be greatly appreciated.

Brett

------------------------------------------------------------------------

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com

------------------------------------------------------------------------

_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.