Hello!
I got it using the following code:
...
Configuration config = new OGCConfiguration();
Parser parser = new Parser(config);
InputStream is = new
ByteArrayInputStream(filter.getBytes("UTF-8"));
Filter gtFilter = (Filter) parser.parse(is);
FilterToSQL f2sql = new FilterToSQL();
try {
String sql = f2sql.encodeToString(gtFilter);
Logger.getAnonymousLogger().info(sql);
} catch (FilterToSQLException ex) {
Logger.getLogger(services.class.getName()).log(Level.SEVERE,
null, ex);
}
...
But now I have some questions:
- The interface Filter is marked as deprecated, what class/interface I must
to use instead?
- How to set up the attribute type of a filter's part. Let me explain:
there's a varchar type's attribute but the FilterToSQL utility class return
a value without quotes. Thus, when I concatenate the WHERE clause to the SQL
statement, the DBMS return me a type casting exception.
- And of course: Is this the best way to do the parsing?
Thanks!
José
--
View this message in context:
http://n2.nabble.com/Parsing-a-OGC-Filter-into-a-PostGIS-SQL-Statment-tp4586330p4588319.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users