we've been developing a commercial application using GT2 - actually we're in the process of upgrading the app from GT1. We've got a long way with this new OGIS compliant version, which we're happy about, but have gotten to a point where we need some extra functionality. We'd like to develop this functionality, as a contribution to the GeoTools project, with the aim of enhancing GeoTools as well as for our own ends (and obviously we don't want to diverge from the project, or - worst-case - pursue an alternative). We are (and expect to continue to be) involved in a number of projects involving processing and visualisation of large geographical data sets. So here are the issues as we see them and what we'd like to do - I'm sure you've thought about much or perhaps even all of this before, so please let us know your thoughts. If you agree, we'd be very keen to make progress on
In the previous version of our app, which used GT1, we had the ability to highlight features with MouseOver (for purposes of user selection in setting up an optimisation process). We need to replicate this behaviour with GT2. Actually I've raised this before in one of our various correspondences - an issue was opened on JIRA at
http://jira.codehaus.org/secure/ViewIssue.jspa?key=GEOT-53 - http://jira.codehaus.org/secure/ViewIssue.jspa?key=GEOT-53
Also related is a request at
https://sourceforge.net/tracker/index.php?func=detail&aid=861276&group_id=4091&atid=503716 - https://sourceforge.net/tracker/index.php?func=detail&aid=861276&group_id=4091&atid=503716
The underlying issue, as we see it, is really one of interactivity,
coupled with dynamic rendering, which must be considered for performance reasons.
Such a capacity for interaction seems to be absent from the OGIS spec as it appears to be concerned primarly with representation of geography. However, in any real software application it becomes necessary to interact with the map (e.g., in this case, to select features). This requires that the visualisation is able to receive notification of changes from the user (by way of some kind of Event mechanism) and that the map respond appropriately. A parallel issue then arises of how to achieve this interaction for densely featured maps without impacting too heavily on performance (again this is a real-world software issue which OGIS does not seem to consider in any depth). Some kind of feature look-up mechanism would seem to be essential to ensure that only features in an area which is changed by user interaction are re-Styled and re-rendered - this may relate to
http://jira.codehaus.org/secure/ViewIssue.jspa?key=GEOT-10 - http://jira.codehaus.org/secure/ViewIssue.jspa?key=GEOT-10
Such a mechanism, combined with some kind of feature caching, is of course also a large part of what is required for fast panning and zooming operations.
Currently we have implemented a slightly crude selection mechanism which re-draws selected features in an extra, overlaid, "SelectionLayer" (with a "selected" Style). Features are selected in a table and their IDs added to a FeatureIDFilter in the SelectionLayer Style - hence our earlier request for removing/adding Fids to FidFilters:
http://jira.codehaus.org/secure/ViewIssue.jspa?key=GEOT-64 - http://jira.codehaus.org/secure/ViewIssue.jspa?key=GEOT-64 This however, can be slow when re-rendering and in any case does not offer the MouseOver capablities our client requires.
We would like to add these capabilities - interactivity and feature look-up - to GeoTools. It would be nice to build these in at quite a low level, but given the restrictons of OpenGIS, we expect that much of it will have to be done in the renderer.
For user interaction we propose some kind of listener which listens for MouseEvents on Shapes on the map. This then throws FeatureChangedEvents as appropriate, and, together with a Shape2Feature map, the affected area can be redrawn to show the modified features. For efficiency this would best be realised using a feature look-up mechanism. For this we propose building a (fairly standard) R-Tree structure of features in each layer, adding one to each layer (or, if OpenGIS is not happy with that, we are thinking to use RenderedLayer).
All this would also pave the way for building a proper Viewer with efficent pan and zoom behaviour - this would at least be useful for GeoTools for demo purposes (currently it seems such a Viewer element is not yet present or complete in GT2).
Well, hope you find this positive and worth pursuing. We would really like to get started on this soon.
Hope to hear from you soon, and in any case, all the best for the season and good luck with GeoTools in 2004!
CodeHaus Comment From: jmacgill - Time: Mon, 26 Jan 2004 23:26:01 -0600
This issue came during todays IRC session and a decision was made to dedicate most of next weeks IRC to issues related to interactive rendering.
You can find details about how to join in on an IRC session at:
If you are interested in this issue and are unable to attend (either for technical or timing reasions) then please let us know so that we can arrange something else.
CodeHaus Comment From: aaime - Time: Wed, 4 Feb 2004 05:31:20 -0600
Sorry to wake up this late, but here are a few comments:
instead of using the r-tree I'd suggest using a quadtree
to fastly get the geometries under the mouse. Rationale:
the quadtree and r-tree indexes are provided in the jts
as maps from envelopes to objects, so they are fairly
generic. R-tree is faster but is implemented as an STR-Tree
and needs to be rebuilt every time a single geometry changes,
which is what we need anyway when the base map style changes, but
may not be the best when in future we will provide layer editing
capabilities. The quatree implementation can be changed after
mapping directly the geometry to the feature means keeping in
memory every feature (geometry + attributes) which is something
that we may not be allowed to do when managing big data sets.
A solution that would be fast for both small data sets and big
ones would be to keep only the feature id:
- if the data set is small, it can be kept in memory as a feature
collection, and mapping from id to feature should be fast (we
could create a feature collection implementation based on
a HashMap instead of using a HashSet).
- if the data collection is so big that we cannot keep it into
memory, query the disk/network storage using a FidFilter and
hope that the data source itself has some feature caching
Since feature collection can be wrapped to look as feature sources,
the query mechanism would work for both in memory and disk data
sources without changes in the shape -> feature mapping code.
when thinking about ways to improve interactive rendering, please
consider that j2d renderer could be in future used for
headless server side apps (geoserver)...
so don't pretend to be in a swing environment.
This is just a praise, if that slows you down, forget
about it, we'll refactor the code to work server side later.
The featureModifier could be along the lines:
StyledGeometry getModifiedGeometry(StyledGeometry original)
this would allow to change both the style and the geometry.
Scaling can be achieved by wrapping the original geometry
along with an affine transform (see the TransformedShape class)
I still haven't looked at the source code, sorry.
CodeHaus Comment From: jelliott - Time: Fri, 6 Feb 2004 09:04:20 -0600
Thanks for your detailed comments on the highlighting stuff. In answer to your specific points:
1. The quadtree sounds sensible - from what you say, are you thinking that we should use the jts implementation?
2. You're absolutely right about mapping to features directly being a bad idea. Your idea of storing the feature id sounds very sensible. What is the contract that feature id should obey - is it supposed to be unique within a feature collection (in which case might we also need a reference to the feature collection) or across multiple feature collections.
3. I understand what you're saying about the rendered layer and client server applications. In fact, we may be about to implement an application relying on a client-server architecture with a large database of features. What do you think the future direction will be as regards this issue?
4. We thought about doing it that way ourselves (passing back a StyledGeometry object), it may be better perhaps. The idea of including an additional transformation seems nice.
CodeHaus Comment From: aaime - Time: Fri, 6 Feb 2004 09:35:21 -0600
yes, I'd like to use the JTS quadtree implementation, no need to re-invent the wheel IMHO.
ID uniqueness... uhm, I'm not sure. You should ask to the devel list, data store people will have an answer.
as far as managing big datasets are concerned, I think the following things are necessary or at least desiderable:
* implement tiling in the renderer so that not everything is loaded
in memory at the same time (specifically, when the area of interest
is smaller than the full data set)
* implement some kind of local on-disk cache, maybe based on picle,
to reduce the need to access the network
* implement active rendering aka threaded rendering, where the
rendering process is not blocking, but is progressive (with heavy
usage of VolatileImages to get good performance
Julian, can you post also the modified MapViewer with highlighting on?
Even better, subscribe to the devel list and attach the needed files
to the mail, so that everybody can see, test, comment and maybe include in cvs.
CodeHaus Comment From: aaime - Time: Sun, 28 Mar 2010 05:03:06 -0500
Mass closing all go-1 related issues as the module does not exist anymore