Dear GT community,

I'm looking for a way to build a SimpleFeatureSource from a SQL query.

I know there is the VirtualTable class but I want to do to something like that :

 SimpleFeatureSource fs = (SimpleFeatureSource) VirtualTableFactory.getFeatureSource("SELECT the_geom from geoTable limit 1");

or

SimpleFeatureSource fs = (SimpleFeatureSource) 
VirtualTableFactory.getFeatureSource("SELECT st_intersection(a.the_geom, b.the_geom) 
as the_geom from landcover as a, zones as b where st_intersects(a.the_geom, 
b.the_geom)");

In fact I would like to automatically introspect the metadata on resulset to 
build the schema.

In addition, I would like to support SQL named parameters similar to :

SimpleFeatureSource fs = (SimpleFeatureSource) 
VirtualTableFactory.getFeatureSource("SELECT the_geom from landcover where type = 
:landcover_type", [landcover_type
: "grass"]);

Best regards


Erwan

--
Ingénieur de Recherche CNRS - HDR,
Laboratoire Lab-STICC – UMR 6285
Equipe DECIDE
Institut Universitaire de Technologie de Vannes
8, Rue Montaigne - BP 561 56017 Vannes Cedex
T: +33 2 97 62 64 92
W:https://cv.archives-ouvertes.fr/erwan-bocher
W:http://www.labsticc.fr

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

Reply via email to