Thanks michael, it is my example for render gif.

AbstractGridCoverage2DReader reader;
                GridCoverage2D coverage;
        try {
                URL urlGif = file.toURL();
                Hints hi = new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM,
DefaultGeographicCRS.WGS84);
            reader = new WorldImageReader(urlGif,hi);
            
            coverage = (GridCoverage2D) reader.read(null);
        } catch (IOException ex) {
            ex.printStackTrace();
            throw new
FormatImportFileException(Mensajes.getMensaje("mensaje.error.metadata"));
        }


RasterSymbolizer symbolizer = styleFactory.createRasterSymbolizer();
                Style style = styleFactory.createStyle();
        Rule[] rules = new Rule[1];
        rules[0] = styleFactory.createRule();
        rules[0].setSymbolizers(new Symbolizer[] { symbolizer });

        FeatureTypeStyle type = styleFactory.createFeatureTypeStyle(rules);
        style.addFeatureTypeStyle(type);
        try {
               //this for its for put image in first layer, to the others
layers with geometrys
               //are at top of the gif image.
                int totalLayer = context.getLayerCount();
                boolean encontrado = false;
                int index = 0;
                for (int i = 0; i < totalLayer && !encontrado; i++) {
                        index=i;
                                if (context.getLayer(i) instanceof 
DespliegueLayer) {
                                        encontrado=true;
                                }
                                
                        }
                        DefaultMapLayer newLayer = new 
DefaultMapLayer(coverage2D,style);
                        context.addLayer(index,newLayer);
                } catch (TransformException e) {
                        e.printStackTrace();
                } catch (FactoryConfigurationError e) {
                        e.printStackTrace();
                } catch (SchemaException e) {
                        e.printStackTrace();
                } catch (IllegalAttributeException e) {
                        e.printStackTrace();
                }








Michael Bedward wrote:
> 
> If you know the geo coordinates of you GIF image you can create a grid
> coverage from it and add that to your map context...
> 
> http://docs.codehaus.org/display/GEOTDOC/Image+Plugin
> 
> Hope this helps
> 
> Michael
> 
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with
> Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code
> to
> build responsive, highly engaging applications that combine the power of
> local
> resources and data with the reach of the web. Download the Adobe AIR SDK
> and
> Ajax docs to start building applications
> today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Create-Layer-Gif-file-tp2275534p2313684.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to