[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| Re: [udig-devel] programmatically selecting features for highlighting | 
Jesse Eichar schrieb:
The name is of setFilter regarding selection was in hind sight a poor 
decision because it implies that the features rendered will be 
filtered.  Instead the 'non-filtered' features (IE features that match 
the filter) are considered to be the selection.  There is the start of a 
SelectionManager that will in the future help this situation.  But for 
now Filter.ALL means filter everything (match nothing) and Filter.None 
means filter nothing. 
Ok. For testing this little function, that should select "All except the 
one":
private void selectFeature(ILayer layer, Feature feature){
map.sendCommandSync(SelectionCommandFactory.getInstance().createFIDSelectCommand(layer, 
feature));
}
But it doesn't work. Nothing is selected. With the whole feature as 
input I thought I can avoid trouble with FIDs.
I think newer versions of Geotools have changed 
this to Filter.Include and Filter.Exclude.
So set a bounding box filter on the layer and all features within that 
bounding box are considered selected.
I'm using Multipolygons in my layer. Using the envelope could lead to a 
selection that includes several polygons cause they overlap or are 
otherwise laying in the given envelope. This is not the intention... 
only a certain feature shall be selected.
Thanks!
Matthias
On 24-Oct-08, at 5:04 PM, Matthias Lendholt wrote:
Jesse Eichar schrieb:
The Table view simply tracks changes to the filter on the selected 
layer.  You can put a filter on a layer.  There should be a command 
available to do this.  Look for something like SetFilterCommand or 
something similar.
FidFilter ff = 
FilterFactoryFinder.createFilterFactory().createFidFilter(fid);
map.sendCommandASync(SelectionCommandFactory.getInstance().createSelectCommand(layer,ff)); 
the map renders but nothing is selected.
This should work if the fid is correct.  Becareful though because often 
the FID changes after a commit.
Jesse
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
--
Matthias Lendholt
phone:  +49 331 288 1687 | GeoForschungsZentrum
mobile: +49 170 325 1691 | Telegrafenberg A3
fax:    +49 331 288 1703 | D 14473 Potsdam