I didn't really understand this hack.

By checking the clicked pixel on each individuals layers in the reverse order 
of the drawing order,
I can retrieve the Feature Type of the drawn Feature at this position but I 
can't tell
exactly which Feature it is, can I?

Does the ZBuffer technique need a lot of work and skills in rendering
(implementing drawing algorithms, ...) or can it just be done by a few changes?


> Date: Mon, 27 Apr 2009 08:28:19 +1000
> Subject: Re: [Geotools-gt2-users] Selecting a feature represented by a symbol
> From: [email protected]
> To: [email protected]
> CC: [email protected]
> 
> You are correct this technique would only show the maximum size; and
> use it to query. The style data structure is available so you can
> perform the calculations yourself (to see if which rules have been
> used).
> 
> There are a couple different approaches to selection in an interactive
> map; I mentioned one hack with respect to checking the pixels; a more
> involved technique involves rendering as a zbuffer; you would need to
> rewrite the renderer (or supply a hint) asking it to write down an
> integer for each feature drawn; and then check the raster at the end
> of the day to see what feature was "on top" in order to be clicked on.
> Not very much fun which is why I have not done it yet.
> 
> Jody
> 
> On Sun, Apr 26, 2009 at 11:01 PM, yako yako <[email protected]> wrote:
> >
> > Thank you Jody,
> >
> > But each Feature on a Layer can be drawn in various ways depending on the
> > applied styling rules.
> > Is it possible to determine which rules has been applied by the renderer for
> > a given Feature?
> >
> > Yako Bak
> >
> >> Date: Sat, 25 Apr 2009 18:24:09 +1000
> >> Subject: Re: [Geotools-gt2-users] Selecting a feature represented by a
> >> symbol
> >> From: [email protected]
> >> To: [email protected]
> >> CC: [email protected]
> >>
> >> Have a look at the StyleVisitor interface; you can use that to visit
> >> all the symbolizer elements used to rendering your features (and
> >> figure out what the target size is; and then use that size rather than
> >> 3x3 to determine your selection bounds).
> >>
> >> Note: In uDig we render each layer individual; allowing me to
> >> experimented in the past with just checking the pixels to see if
> >> anything is hit before trying to do a feature based query; this is
> >> only useful if you are rendering content onto individual rasters and
> >> then merging them.
> >>
> >> Jody
> >>
> >> On Sat, Apr 25, 2009 at 1:56 AM, yako yako <[email protected]> wrote:
> >> > Hello,
> >> >
> >> > I am making an application where the user can retrieve information from
> >> > a
> >> > feature by clicking on it.
> >> >
> >> > To do this, I make a filter to get all features located on the area
> >> > defined
> >> > by the projection on the map
> >> > of a 3x3 pixels square centered on the position of the click.
> >> >
> >> > I encouter a problem with Feature represented by a symbol because this
> >> > symbol can be bigger than
> >> > the real geometry of the feature. So we can not click anywhere on it to
> >> > retrieve its information.
> >> >
> >> > Is it possible to get the bounds of the symbol used to represent a
> >> > feature
> >> > in order to compute its projection
> >> > on the map and check if it intersects the 'click area'?
> >> >
> >> > Is there an other way to assign a feature to a pixel on the map whatever
> >> > its
> >> > type of representation is ?
> >> >
> >> > I hope I've been clear enough.
> >> >
> >> > Thank you,
> >> >
> >> > Yako Bak.
> >> >
> >> > ________________________________
> >> > Découvrez toutes les possibilités de communication avec vos proches
> >> >
> >> > ------------------------------------------------------------------------------
> >> > Crystal Reports &#45; New Free Runtime and 30 Day Trial
> >> > Check out the new simplified licensign option that enables unlimited
> >> > royalty&#45;free distribution of the report engine for externally facing
> >> > server and web deployment.
> >> > http://p.sf.net/sfu/businessobjects
> >> > _______________________________________________
> >> > Geotools-gt2-users mailing list
> >> > [email protected]
> >> > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> >> >
> >> >
> >
> > ________________________________
> > Votre correspondant a choisi Hotmail et profite d'un stockage quasiment
> > illimité. Créez un compte Hotmail gratuitement !

Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows Live ? 
Lancez-vous !
_________________________________________________________________
Inédit ! Des Emoticônes Déjantées! Installez les dans votre Messenger ! 
http://www.ilovemessenger.fr/Emoticones/EmoticonesDejantees.aspx
------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to