[udig-devel] getBounds of selection/filter

Vince Darley vince.darley at eurobios.com
Wed Mar 26 08:17:01 PDT 2008


I've solved my own problem here:

                 FeatureSource resource = 
layer.getResource(FeatureSource.class, ProgressManager.instance().get());
                 Query query = new DefaultQuery( 
resource.getSchema().getTypeName(), layer.getFilter(),
                 new 
String[]{resource.getSchema().getDefaultGeometry().getName()});
                 Envelope ebounds = resource.getBounds(query);
                 if( ebounds==null ){
                     ebounds=resource.getFeatures(query).getBounds();
                 }
                 bounds = new ReferencedEnvelope(ebounds, crs);

seems to do the job just fine.

Vince.




More information about the udig-devel mailing list