New MapLayer constructor to pass GeneralParameterValue[] reader paramters

2 messages Options
Embed this post
Permalink
Stefan Tzeggai

New MapLayer constructor to pass GeneralParameterValue[] reader paramters

Reply Threaded More More options
Print post
Permalink
Hi

In reply to my mail "How to set the transparent color on an ImagePyramidReader
or ImageMosaicReader", Simone and I figured out on IRC yesterday, that it might
be a good idea to add a new constructor to DefaultMapLayer that allows to
define the "read-parameters" for a GridCoverage2DReader.

When a user (like i did) creates a new DefaultMapLayer for an
AbstractGridCoverage2DReader, the Reader will be wrapped as a
FeatureCollection using FeatureUtilities.wrapGridCoverageReader(reader,null).
There is no way to pass GeneralParameterValues[] to the wrapper function, as
null is always used. The new constructor would roughly look like:

>public DefaultMapLayer(AbstractGridCoverage2DReader reader,  
GeneralParameterValue[] params, Style style, String title) {
> this(FeatureUtilities.wrapGridCoverageReader(reader,params), style, title);
>}

It would allow to use a
 mapContext.addLayer ( new DefaultMapLayer(Coverage2DReader ...) )
and still pass read parameters, which was rather hard to do before.

Any comments welcome.. otherwise i will write a patch tomorrow.

Greetz
Steve


--
wiki² - Softwareentwicklung
Stefan Krüger

webpage http://en.geopublishing.org/FAQ
skype alfonx

reclaim your net - http://tor.eff.org
enforce privacy - http://www.pgpi.org
pgp key id: 51B576FD - http://pgp.mit.edu

Please note that according to the German law on data retention,
information on every electronic information exchange with me is
retained for a period of six months.



------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
My last name will change from Krüger to Tzeggai in mid 2010.
Stefan Tzeggai

Re: New MapLayer constructor to pass GeneralParameterValue[] reader paramters

Reply Threaded More More options
Print post
Permalink
Hi

Created a JIRA with the patch for it.

http://jira.codehaus.org/browse/GEOT-2789

Greetz,
Steve

Am Donnerstag 01 Oktober 2009 09:17:59 schrieb Stefan Krüger:

> Hi
>
> In reply to my mail "How to set the transparent color on an
> ImagePyramidReader or ImageMosaicReader", Simone and I figured out on IRC
> yesterday, that it might be a good idea to add a new constructor to
> DefaultMapLayer that allows to define the "read-parameters" for a
> GridCoverage2DReader.
>
> When a user (like i did) creates a new DefaultMapLayer for an
> AbstractGridCoverage2DReader, the Reader will be wrapped as a
> FeatureCollection using
> FeatureUtilities.wrapGridCoverageReader(reader,null). There is no way to
> pass GeneralParameterValues[] to the wrapper function, as
>
> null is always used. The new constructor would roughly look like:
> >public DefaultMapLayer(AbstractGridCoverage2DReader reader,
>
> GeneralParameterValue[] params, Style style, String title) {
>
> > this(FeatureUtilities.wrapGridCoverageReader(reader,params), style,
> > title); }
>
> It would allow to use a
>  mapContext.addLayer ( new DefaultMapLayer(Coverage2DReader ...) )
> and still pass read parameters, which was rather hard to do before.
>
> Any comments welcome.. otherwise i will write a patch tomorrow.
>
> Greetz
> Steve

--
wiki² - Softwareentwicklung
Stefan Krüger
Straßburger Weg 26
53113 Bonn

email [hidden email]
mobile 0151 50543949
webpage wikisquare.de
skype alfonx

reclaim your net - http://tor.eff.org
enforce privacy - http://www.pgpi.org
pgp key id: 51B576FD - http://pgp.mit.edu

Please note that according to the German law on data retention,
information on every electronic information exchange with me is
retained for a period of six months.



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
My last name will change from Krüger to Tzeggai in mid 2010.