Hi Michael;
Going over one of the example you provided (http://geotools.org/examples/displaylab.html
)
... and I have a question :-)
You used the filter produced when they click ... and process the
features into a Set<FeatureId>
Set<FeatureId> IDs = new HashSet<FeatureId>();
try {
while (iter.hasNext()) {
SimpleFeature feature = iter.next();
IDs.add(feature.getIdentifier());
System.out.println(" " + feature.getIdentifier
());
}
} finally {
iter.close();
}
And then to display the features you create a Rule with ...
selectedRule.setFilter(ff.id(IDs));
Can I ask why you do not use the original filter?
It could be:
- speed - avoiding a spatial test during every render - and using a
feature id test would be fast
- teaching - it could be an excuse to process a feature collection
I am finding the page clear and well written; so I am loath to change
anything :-)
I also usually produce a different filter when checking where someone
clicks; I produce a 3x3 pixel bounding box; and then:
1) transform it to mappane crs (ie world coordinates)
2) transofrm it to the data crs (ie data coordinates)
On the grounds that a BoundingBox query is often the fastest spatial
query you can do, faster then dwithin with less hard math.
Jody
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users