[Geoserver-users] report a bug in SLDStyle Factory for Point Style ?

Geoserver reports an error when styling for point is like that:

<PointSymbolizer>
   <Graphic>
     <ExternalGraphic>
        <OnlineResource xlink:type="simple" xlink:href="http://maps.google.com/mapfiles/kml/shapes/rainy.png&quot;/&gt;
        <Format>image/png</Format>
     </ExternalGraphic>
     <Mark>
       <Fill>
         <CssParameter name="fill-opacity">0,5</CssParameter>
       </Fill>
     </Mark>
     <Size>0.5</Size>
   </Graphic>
</PointSymbolizer>

When the size is >= 1, it works.
under 1, it does not.

22 nov. 13:49:47 ERROR [org.geotools.rendering] - Unable to invert transform AffineTransform[[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]
java.awt.image.ImagingOpException: Unable to invert transform AffineTransform[[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]
        at java.awt.image.AffineTransformOp.validateTransform(AffineTransformOp.java:542)
        at java.awt.image.AffineTransformOp.<init>(AffineTransformOp.java:133)
        at org.geotools.renderer.style.SLDStyleFactory.createPointStyle(SLDStyleFactory.java:502)
        at org.geotools.renderer.style.SLDStyleFactory.createStyleInternal(SLDStyleFactory.java:334)
        at org.geotools.renderer.style.SLDStyleFactory.createStyle(SLDStyleFactory.java:295)
        at org.geotools.renderer.lite.StreamingRenderer.processSymbolizers(StreamingRenderer.java:1733)
        at org.geotools.renderer.lite.StreamingRenderer.process(StreamingRenderer.java:1660)

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

Sébastien Geindre ha scritto:

Geoserver reports an error when styling for point is like that:

<PointSymbolizer>
   <Graphic>
     <ExternalGraphic>
        <OnlineResource xlink:type="simple" xlink:href="http://maps.google.com/mapfiles/kml/shapes/rainy.png&quot;/&gt;
        <Format>image/png</Format>
     </ExternalGraphic>
     <Mark>
       <Fill>
         <CssParameter name="fill-opacity">0,5</CssParameter>
       </Fill>
     </Mark>
     <Size>0.5</Size>
   </Graphic>
</PointSymbolizer>

When the size is >= 1, it works.
under 1, it does not.

Understandle, under 1 it does not make any sense, thought
we should report a better error message. The SLD spec, page 42,
says:

"The Size element gives the absolute size of the graphic in pixels encoded as a floatingpoint number. This element is also used in other contexts than graphic size and pixel units are still used even for font size. The default size for an object is context-dependent.
Negative values are not allowed."

(http://portal.opengeospatial.org/files/?artifact_id=1188)

I think we should either complain loudly, and with a better error message than an invalid transform (which happens because we take the size you specified and cast it to an int, so anything below 1 becomes
zero), or abide to the spec by the letter and use whatever positive
size you throw at us, even if it does not seem to make sense (I'm very
curious, what's your use case for using sub-pixel symbolizers?).

Cheers
Andrea

Andrea Aime a écrit :

Sébastien Geindre ha scritto:

Geoserver reports an error when styling for point is like that:

<PointSymbolizer>
   <Graphic>
     <ExternalGraphic>
        <OnlineResource xlink:type="simple" xlink:href="http://maps.google.com/mapfiles/kml/shapes/rainy.png&quot;/&gt;
        <Format>image/png</Format>
     </ExternalGraphic>
     <Mark>
       <Fill>
         <CssParameter name="fill-opacity">0,5</CssParameter>
       </Fill>
     </Mark>
     <Size>0.5</Size>
   </Graphic>
</PointSymbolizer>

When the size is >= 1, it works.
under 1, it does not.

Understandle, under 1 it does not make any sense, thought
we should report a better error message. The SLD spec, page 42,
says:

"The Size element gives the absolute size of the graphic in pixels encoded as a floatingpoint number. This element is also used in other contexts than graphic size and pixel units are still used even for font size. The default size for an object is context-dependent.
Negative values are not allowed."

(http://portal.opengeospatial.org/files/?artifact_id=1188)

I think we should either complain loudly, and with a better error message than an invalid transform (which happens because we take the size you specified and cast it to an int, so anything below 1 becomes
zero),

or abide to the spec by the letter and use whatever positive
size you throw at us, even if it does not seem to make sense (I'm very
curious, what's your use case for using sub-pixel symbolizers?).

thanks for your explanation.
i was just trying to draw my clouds on googleearth.some of them are quiet small (thunderstorm)
and the google icon is too big.
http://maps.google.com/mapfiles/kml/shapes/rainy.png

i'll use my own icon !

is it possible to transform image with less than 1 coefficient ?
if it is, it could be useful to decrease the size of an icon, no ?
the spec do no say that it should be >= 1.

Merci Andrea!

Cheers
Andrea

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

Sébastien Geindre ha scritto:

Andrea Aime a écrit :

Sébastien Geindre ha scritto:

Geoserver reports an error when styling for point is like that:

<PointSymbolizer>
   <Graphic>
     <ExternalGraphic>
        <OnlineResource xlink:type="simple" xlink:href="http://maps.google.com/mapfiles/kml/shapes/rainy.png&quot;/&gt;
        <Format>image/png</Format>
     </ExternalGraphic>
     <Mark>
       <Fill>
         <CssParameter name="fill-opacity">0,5</CssParameter>
       </Fill>
     </Mark>
     <Size>0.5</Size>
   </Graphic>
</PointSymbolizer>

When the size is >= 1, it works.
under 1, it does not.

Understandle, under 1 it does not make any sense, thought
we should report a better error message. The SLD spec, page 42,
says:

"The Size element gives the absolute size of the graphic in pixels encoded as a floatingpoint number. This element is also used in other contexts than graphic size and pixel units are still used even for font size. The default size for an object is context-dependent.
Negative values are not allowed."

(http://portal.opengeospatial.org/files/?artifact_id=1188)

I think we should either complain loudly, and with a better error message than an invalid transform (which happens because we take the size you specified and cast it to an int, so anything below 1 becomes
zero),

or abide to the spec by the letter and use whatever positive
size you throw at us, even if it does not seem to make sense (I'm very
curious, what's your use case for using sub-pixel symbolizers?).

thanks for your explanation.
i was just trying to draw my clouds on googleearth.some of them are quiet small (thunderstorm)
and the google icon is too big.
http://maps.google.com/mapfiles/kml/shapes/rainy.png

i'll use my own icon !

is it possible to transform image with less than 1 coefficient ?
if it is, it could be useful to decrease the size of an icon, no ?
the spec do no say that it should be >= 1.

It's not a coefficient. It's the resulting size. With 1 you should
get a 1 pixel high image. Don't you?

Cheers
Andrea

It's not a coefficient. It's the resulting size. With 1 you should

get a 1 pixel high image. Don't you?

No. ok, i thought it as a coefficient !! :wink:

i check the kml output, the style is :
         <Style id="GeoServerStylecb.fid-7187845a_11661c48900_-7e42">
            <IconStyle>
               <scale>1.4</scale>
               <Icon>
                  <href>http://localhost:8080/geoserver/icon-poly.png&lt;/href&gt;
               </Icon>
            </IconStyle>
            <PolyStyle>
               <color>7fffff22</color>
               <outline>1</outline>
            </PolyStyle>
            <LineStyle>
               <color>ff000000</color>
               <width>1</width>
            </LineStyle>
            <IconStyle>
               <color>ffaaaaaa</color>
               <colorMode>normal</colorMode>
               <Icon>
                  <href>http://maps.google.com/mapfiles/kml/shapes/rainy.png&lt;/href&gt;
               </Icon>
            </IconStyle>
         </Style>

2 IconStyles !

Nothing about my Size, (also fill-opacity) in SLD file :

<PointSymbolizer>
   <Graphic>
     <ExternalGraphic>
        <OnlineResource xlink:type="simple" xlink:href="http://maps.google.com/mapfiles/kml/shapes/rainy.png&quot;/&gt;
        <Format>image/png</Format>
     </ExternalGraphic>
     <Mark>
       <Fill>
         <CssParameter name="fill-opacity">0,5</CssParameter>
       </Fill>
     </Mark>
     <Size>1.5</Size>
   </Graphic>
</PointSymbolizer>

Cheers
Andrea

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

It's not a coefficient. It's the resulting size. With 1 you should
get a 1 pixel high image. Don't you?

no i do not.
with googleearth, it is possible to modify the size parameter of the icon.
values less than 1 are available....

who is wrong ?
specification interpretation... :wink:

Cheers
Andrea

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

Sébastien Geindre ha scritto:

It's not a coefficient. It's the resulting size. With 1 you should
get a 1 pixel high image. Don't you?

no i do not.
with googleearth, it is possible to modify the size parameter of the icon.
values less than 1 are available....

who is wrong ?
specification interpretation... :wink:

Well, the thing is, the SLD specification was not meant to be used with Google Earth at all, it has been devised for raster map generation and it shows. In the KML converter we tried to adapt things so that you see the same map from a WMS preview and in Google Earth, but
some part of the styling are just different.

In the specification there is nothing to interpret, the size is pixels
so any value less than one simply does not make sense. That said,
as far as I can see the kml encoder code completely disregards
the point symbolizer size, so there is room for improvement.
Can you open a jira issue for this one?

Cheers
Andrea