|
Hi uDig'gers ! I am new on the uDig world and I am having some troubles
while trying to filter some datas from an Oracle database. I have a database that consist of a set of tables : three of them contain spatial informations. I am able to retrieve the whole content of a given table, but now I would like to filter datas to be displayed on a map : particularly, I would like to filter only geometries corresponding to a given ID. Here is the snippet of code I got currently : IServiceFactory factory = CatalogPlugin.getDefault().getServiceFactory(); for (IService service : factory.createService(params)) { // params is the map containing informations to connect to the database if( service.canResolve(OracleDataStore.class )){ try { OracleDataStore database = service.resolve(OracleDataStore.class, new NullProgressMonitor()); // This statement allows me to retrieve datas only for the LOCATION_POINT table ... FeatureSource<SimpleFeatureType, SimpleFeature> featureSource = database.getFeatureSource("LOCATION_POINT"); // Add here filter [1] List<IGeoResource> resourceList = new ArrayList<IGeoResource>(); for (IResolve nextElt : service.members(new NullProgressMonitor())) { if (nextElt instanceof IGeoResource) { resourceList.add((IGeoResource) nextElt); } } ApplicationGIS.addLayersToMap(ApplicationGIS.getActiveMap(), resourceList, 1, null, true); } catch (Exception e) { e.printStackTrace(); } } } Then, I tried the following to only filter a particular row of my table : // This code should go to the [1] FilterFactory ff = new FilterFactoryImpl(); Filter myFilter = ff.id(Collections.singleton(ff.featureId("LOCATION_POINT.681"))); ... but with no success :-/ Any help would be appreciated. Regards, --
Any unauthorized modification, edition, use or dissemination is prohibited. Neither Anyware Technologies nor its headquarters Wavecom shall be liable for the Message if altered, changed, falsified or edited, diffused without authorization. |
_______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel

