Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] rendering, styles, attributes

On Tue, 2005-05-07 at 15:31 +0100, Vince Darley wrote:
> Now that uDig's performance looks pretty good for our purposes, I'd like to 
> ask a few questions which I haven't been able to answer from reading the 
> documentation.
> 
> Render style by attribute value: The shapefiles I'm using (e.g. that large 
> one with lots of points) have various attributes associated with each 
> points.  I'd like to colour the points according to certain attribute 
> values (e.g. vehicle_id).  How would I go about doing that in uDig (or can 
> you point me to an outline of how I might achieve this with further 
> development)?  I can see two paths to achieving this -- first just to have 
> the ability to specify a render colour by attribute value, or second to 
> split a layer by a given attribute, and then colour each newly-created 
> layer manually.
> 
> 1-2 years ago we did a fair amount of work on the j2drenderer from 
> geotools, to add a more performant selection/modification capability (no 
> need to re-render everything just because a few features have changed 
> colour/appearance).  In the medium term we would probably want to use this, 
> so I'm wondering what the path might be to have uDig use the j2d renderer 
> (or something similar to that)?  Are the recent "point" performance 
> improvements to the shapefile renderer somehow intertwined with the 
> lite-renderer being used by uDig, or are they elsewhere in the rendering 
> pipeline?  (Note: we'd probably be using a mixture of shapefiles and GML 
> data for rendering purposes)

Unlike the j2drenderer very little is kept in memory in uDig.  Each
layer normally has a separate image that caches the last rendering of
the layer.  I plan on in the future, breaking the rasters into tiles and
caching the tiles.  Additionally uDig uses the FeatureStore's event API
so if a feature is modified the bbox of the modification is known
through the feature event notification and it is possible to only
re-render the bbox of that event on the one layer.

Now the bad news.  The API is there and a number of bug fixes have been
made so that it will work, but it was disconnected during a previous
release because of the problems with it.  Now during each modification
everything is re-rendered.  However since that release a great deal of
work has been done and I think it will work well as soon as the
modifications are made.

Currently there are 2 different renderers used by uDig.  LiteRenderer is
the renderer used for most datastores.  It is well tested and works for
all datastores, but it is slow.  There are a number of ideas on how to
fix it but they require significant changes to the Datastore API and
will take a while to be implemented. 

The other renderer is a renderer optimized for shapefiles.  I wrote that
in order to overcome the short term problems with LiteRenderer.
Polygons, Lines and points from shapefiles are all rendered using the
shapefile renderer.  I had a new idea while I was implementing the point
portion of the shapefile renderer so I think that I can improve the
polygons, lines rendering slightly, but it probably won't be done soon
because most people are happy with the current performance.

With regards to styling UDIG uses SLD styling and the both renderers
support virtually all of it.  Shapefile renderer currently has
difficulty with some of the Geometry filters but all the other styling
filters are valid.  All that is lacking is a user interface for defining
the themed styles.  That said, if a .sld file exists with the same
prefix as a shapefile, that file will be used as the styling information
for the shapefile.    (For example a countries.sld file will style the
countries.shp shapefile).


> 
> Another question of slightly lesser importance: is uDig's rendering 
> pipeline at all suited to the idea of adding a dynamic, animated layer 
> (e.g. vehicles moving around a street network, or ships across a river/sea 
> network) under some circumstances?

The uDig's rendering pipeline is quite flexible.  Each layer can have a
specific renderer for rendering that layer only.  I believe that Tony
Kennedy has already done something similar.
> 
> cheers,
> 
> Vince.
> 
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel



Back to the top