[Geoserver-users] Question about SLD to mask a raster layer

Dear,

I'm trying to define a SLD rule to apply a mask over a raster layer in order to make transparent all the image outside of a polygon. I want to use it to publish full raster maps (with legende) and make all the external content transparent.

It is possible to do it with Geoserver?

I am thinking on any like this:

<StyledLayerDescriptor version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
  xmlns="http://www.opengis.net/sld&quot;
  xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:xlink="http://www.w3.org/1999/xlink&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   <!-- a Named Layer is the basic building block of an SLD document -->
   <NamedLayer>
     <Name>TheName</Name>
     <UserStyle>
       <Title>TheTitle</Title>
       <Abstract>TheAbstract</Abstract>
       <FeatureTypeStyle>
         <Rule>
           <Name>TheRuleName</Name>
           <Title>RuleTitle</Title>
           <Abstract>RuleAbstract</Abstract>
           <ogc:Filter>
             <Within>
                 <PropertyName>WKB_GEOM</PropertyName>
                 <Polygon name="1" srsName="EPSG:4326"><outerBoundaryIs><LinearRing><coordinates>-9.852620777390985,44.004899819177012 -4.470297097577549,43.987766050797482 -4.508584704808891,41.320830104705493 -9.852719379692296,41.301005576398182 -9.852719379692296,41.301005576398182 -9.852620777390985,44.004899819177012</coordinates></LinearRing></outerBoundaryIs></Polygon>
             </Within>
           </ogc:Filter>
             <RasterSymbolizer>
                     <Opacity>1.0</Opacity>
             </RasterSymbolizer>
         </Rule>
       </FeatureTypeStyle>
     </UserStyle>
   </NamedLayer>
</StyledLayerDescriptor>

Can any on help me?, please

Thank you
Miguel A. Manso

Dear Miguel,
please find my answer inline below....

Regards,
Simone Giannecchini

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

On Sun, Apr 27, 2014 at 7:33 PM, Miguel-Angel Manso-Callejo (UPM)
<m.manso@anonymised.com> wrote:

Dear,

I'm trying to define a SLD rule to apply a mask over a raster layer in
order to make transparent all the image outside of a polygon. I want to
use it to publish full raster maps (with legende) and make all the
external content transparent.

It is possible to do it with Geoserver?

I am thinking on any like this:

<StyledLayerDescriptor version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
  xmlns="http://www.opengis.net/sld&quot;
  xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:xlink="http://www.w3.org/1999/xlink&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   <!-- a Named Layer is the basic building block of an SLD document -->
   <NamedLayer>
     <Name>TheName</Name>
     <UserStyle>
       <Title>TheTitle</Title>
       <Abstract>TheAbstract</Abstract>
       <FeatureTypeStyle>
         <Rule>
           <Name>TheRuleName</Name>
           <Title>RuleTitle</Title>
           <Abstract>RuleAbstract</Abstract>
           <ogc:Filter>
             <Within>
                 <PropertyName>WKB_GEOM</PropertyName>
                 <Polygon name="1"
srsName="EPSG:4326"><outerBoundaryIs><LinearRing><coordinates>-9.852620777390985,44.004899819177012
-4.470297097577549,43.987766050797482
-4.508584704808891,41.320830104705493
-9.852719379692296,41.301005576398182
-9.852719379692296,41.301005576398182
-9.852620777390985,44.004899819177012</coordinates></LinearRing></outerBoundaryIs></Polygon>
             </Within>
           </ogc:Filter>
             <RasterSymbolizer>
                     <Opacity>1.0</Opacity>
             </RasterSymbolizer>
         </Rule>
       </FeatureTypeStyle>
     </UserStyle>
   </NamedLayer>
</StyledLayerDescriptor>

Can any on help me?, please

What you are trying to do is not supported, assuming it is valid.
What is supported is using footprints shapefile with the ImageMosaic
plugin this way:
http://docs.geoserver.org/2.4.x/en/user/tutorials/imagemosaic_footprint/imagemosaic_footprint.html

Thank you
Miguel A. Manso

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users