Jody Garnett ha scritto:
> Aaime++
> 
> Sounds like it will be a fascinating problem :-)
> 
> I would try and approach this as late as possible in the rendering
> pipeline (perhaps translating everything into polar coordinates?) and
> then rendering from there?

Most of the probems are actually caused by the "rendering from there"
part since it means applying from whatever mid coordinates you use
to the actual rendering projection.

That's why I'm pushing for a strategy per projection.
If you look at the OpenMap code you'll see there is not really a
one size fits all solution

What I'm going to do is something along the lines of a pluggable
strategy (possibly an abstract class, not an interface) that we
lookup up in SPI (via a factory, since these objects will be stateful)
and that is going to look something like this:

public abstract class RendererProjectionStrategy {

   /**
    * Provides the strategy with the area we want to render
    * and its CRS (the SPI lookup will do this step)
    */
   public void init(ReferencedEnvelope renderingEnvelope)

   /**
    * Returns a set of envelopes that will be used to query the
    * data given the specified rendering envelope and the current
    * query envelope
    */
   public ReferencedEnvelope[] getQueryEnvelopes(ReferencedEnvelope 
queryEnvelope);

   /**
     * Returns true if the geometry needs special handling
     */
   public boolean requiresProcessing(CoordinateReferenceSystem geomCRS,
                  Geometry geometry)

   /**
    * Pre processes the geometry, e.g. cuts it, splits it, etc. in its
    * native srs. May return null if the geometry is not to be drawn
    */
   public Geometry preProcess(CoordinateReferenceSystem geomCRS,
                  Geometry geometry)

   /**
    * Processes the geometry already projected to the target SRS.
    * May return null if the geometry is not to be drawn
    */
   public Geometry postProcess(Geometry geometry)
}

Cheers
Andrea

-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to