|
From: Combe, C. <C....@na...> - 2003-10-02 22:50:04
|
hi,
i've been having a go at doing this (files attatched) but i'm a bit =
confused
about where responsibility for resetting the mark iterator lies.
The attatched example sort of works but, in order to stop the display =
from
flickering when you pan, i had to insert=20
iterator.setIteratorPosition(-1);
at line 241 of RenderedMarks (after iterator.paint(*)). This is because =
the
paint method uses setIteratorPosition(index) to get all the points in =
turn
but then doesn't reset the counter - which makes be wonder if my simple
MarkIterator subclass works as its meant to.
colin
-----Original Message-----
From: Martin Desruisseaux
To: geo...@li...
Sent: 10/1/03 2:00 PM
Subject: Re: [Geotools-gt2-users] Creating Point Layers
Hello Dale
Dale Peakall a =E9crit :
> I'm having trouble working out how to create a layer that can display
> individual points, rather than polygons.
>=20
> [...snip...]
>=20
> But when I run this, I get the following exception:
>=20
> Exception in thread "main" java.lang.UnsupportedOperationException:
This
> kind of symbolizer is not yet supported
> at
>
org.geotools.renderer.style.SLDStyleFactory.createStyle(SLDStyleFactory.=
java
> :150)
> ...
>=20
> I've looekd at the code and it seems that only Polygon or Line
symbolizers
> are supported by the SLDStyleFactory.
>=20
> Is there another approach I should take to adding point data?
Yes. There is currently 2 renderers in Geotools.
- lite-renderer, a simple renderer with great styling capability.
- j2d-renderer, a more complex renderer which still in development.
This renderer is faster once started (by has a longer startup =
time
than lite-renderer), supports projections, many zooms
capabilities,
map scale, etc., but is less advanced than lite-renderer in
regards
to styling.
The code above used j2d-renderer. In order to display point data, there =
is 2 choices:
1) Use lite-renderer instead of j2d-renderer. Lite-renderer is the
most OpenGIS compliant renderer regarding to styling.
or 2) Hard-code the rendering of point data in the following way:
Create a subclass of MarkIterator which iterate through yours
data (no matter how yours data are stored). Override the
'position()' method so that it returns yours point geographic
coordinate. You can also override methods like 'markShape()',
'markPaint()', 'markIcon()', etc.
Create a subclass of RenderedMarks and overrides its
getMarkIterator() method, so that it returns a new instance
of yours MarkIterator subclass.
Approach #2 work with j2d-renderer and gives a fair amount of=20
flexibility, but is really not an "OpenGIS way" at all. The long term=20
plan is of course to fully supports rendering of styled point data in=20
j2d-renderer, but it may take a while before I can work on it (not=20
before January, since I have to finish my damn thesis first...)
Regards,
Martin.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Geotools-gt2-users mailing list
Geo...@li...
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
|