- I think there's a bug going on in the function parsing. Since you haven't specified a property to interpolate against, its trying to interpolate against zoom level (as per the spec). Since its generating multiple FeatureTypeStyles, it kind of looks like its trying to use the logic from zoom-and-property functions, but I'm not quite sure. Probably needs more debugging - MBStyle primarily delegates to the GeoTools colour converter factories for handling colours. Digging into the code, I'm not seeing hsl support, so I think thats just an unimplemented feature. - Base is only used for exponential interpolation; if it is used in another function type it will be ignored. Also, a base of 1 is equivalent to linear interpolation.
Torben On Fri, Mar 1, 2019 at 7:51 AM Andrea Aime <andrea.a...@geo-solutions.it> wrote: > Hi, > I have a mbstyle style stating: > > "paint": { > "fill-color": "hsl(82, 46%, 72%)", > "fill-opacity": { > "base": 1, > "stops": [ > [8, 0.6], > [22, 1] > ] > } > }, > and the translation looks like: > <sld:FeatureTypeStyle> > <sld:Name>landcover_wood</sld:Name> > <sld:Title>MBStyle landcover_wood</sld:Title> > <sld:Abstract>Generated for landcover</sld:Abstract> > <sld:SemanticTypeIdentifier>POLYGON</sld:SemanticTypeIdentifier> > <sld:Rule> > <sld:Name>landcover_wood</sld:Name> > <ogc:Filter> > <ogc:PropertyIsEqualTo> > <ogc:PropertyName>class</ogc:PropertyName> > <ogc:Literal>wood</ogc:Literal> > </ogc:PropertyIsEqualTo> > </ogc:Filter> > > <sld:MinScaleDenominator>133.2955989720566</sld:MinScaleDenominator> > > <sld:MaxScaleDenominator>2183915.0935581755</sld:MaxScaleDenominator> > <sld:PolygonSymbolizer uom=" > http://www.opengeospatial.org/se/units/pixel"> > <sld:Fill> > <sld:CssParameter name="fill"/> > <sld:CssParameter name="fill-opacity"> > <ogc:Function name="Interpolate"> > <ogc:Function name="zoomLevel"> > <ogc:Function name="env"> > <ogc:Literal>wms_scale_denominator</ogc:Literal> > </ogc:Function> > <ogc:Literal>EPSG:3857</ogc:Literal> > </ogc:Function> > <ogc:Literal>8</ogc:Literal> > <ogc:Literal>0.6</ogc:Literal> > <ogc:Literal>numeric</ogc:Literal> > </ogc:Function> > </sld:CssParameter> > </sld:Fill> > <sld:Stroke> > <sld:CssParameter name="stroke"/> > <sld:CssParameter name="stroke-opacity"> > <ogc:Function name="Interpolate"> > <ogc:Function name="zoomLevel"> > <ogc:Function name="env"> > <ogc:Literal>wms_scale_denominator</ogc:Literal> > </ogc:Function> > <ogc:Literal>EPSG:3857</ogc:Literal> > </ogc:Function> > <ogc:Literal>8</ogc:Literal> > <ogc:Literal>0.6</ogc:Literal> > <ogc:Literal>numeric</ogc:Literal> > </ogc:Function> > </sld:CssParameter> > </sld:Stroke> > </sld:PolygonSymbolizer> > </sld:Rule> > </sld:FeatureTypeStyle> > <sld:FeatureTypeStyle> > <sld:Name>landcover_wood</sld:Name> > <sld:Title>MBStyle landcover_wood</sld:Title> > <sld:Abstract>Generated for landcover</sld:Abstract> > <sld:SemanticTypeIdentifier>POLYGON</sld:SemanticTypeIdentifier> > <sld:Rule> > <sld:Name>landcover_wood</sld:Name> > <ogc:Filter> > <ogc:PropertyIsEqualTo> > <ogc:PropertyName>class</ogc:PropertyName> > <ogc:Literal>wood</ogc:Literal> > </ogc:PropertyIsEqualTo> > </ogc:Filter> > > <sld:MaxScaleDenominator>133.2955989720566</sld:MaxScaleDenominator> > <sld:PolygonSymbolizer uom=" > http://www.opengeospatial.org/se/units/pixel"> > <sld:Fill> > <sld:CssParameter name="fill"/> > <sld:CssParameter name="fill-opacity"> > <ogc:Function name="Interpolate"> > <ogc:Function name="zoomLevel"> > <ogc:Function name="env"> > <ogc:Literal>wms_scale_denominator</ogc:Literal> > </ogc:Function> > <ogc:Literal>EPSG:3857</ogc:Literal> > </ogc:Function> > <ogc:Literal>22</ogc:Literal> > <ogc:Literal>1</ogc:Literal> > <ogc:Literal>numeric</ogc:Literal> > </ogc:Function> > </sld:CssParameter> > </sld:Fill> > <sld:Stroke> > <sld:CssParameter name="stroke"/> > <sld:CssParameter name="stroke-opacity"> > <ogc:Function name="Interpolate"> > <ogc:Function name="zoomLevel"> > <ogc:Function name="env"> > <ogc:Literal>wms_scale_denominator</ogc:Literal> > </ogc:Function> > <ogc:Literal>EPSG:3857</ogc:Literal> > </ogc:Function> > <ogc:Literal>22</ogc:Literal> > <ogc:Literal>1</ogc:Literal> > <ogc:Literal>numeric</ogc:Literal> > </ogc:Function> > </sld:CssParameter> > </sld:Stroke> > </sld:PolygonSymbolizer> > </sld:Rule> > </sld:FeatureTypeStyle> > > The translation seems strange (buggy?) in a few ways: > > - The interpolate should have one more entry for level 22, there is > nothing telling it that it should reach 1... instead there is another > feature type style for level 22, but I don't think the mbstyle is implying > any stacking, isn't the usage of stops meant to be a linear interpolation > (unless explicitly overridden with the "interpolate" attribute, to make it > exponential or spline?) > - The color defined in the fill is not gray, I'm guessing the hsl > syntax is not supported? > - The "base" attribute seems to be ignored, from the spec it seems > related only to the "exponential" interpolation mode... maybe using 1 as > base does not matter, but I see values other than 1 in the style without > any interpolation spec.... dunno what's going on there? > > So, am I missing something here or.... those are just bugs? > > Cheers > Andrea > > == > > GeoServer Professional Services from the experts! Visit > http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf > Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa > (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 > http://www.geo-solutions.it http://twitter.com/geosolutions_it > ------------------------------------------------------- *Con riferimento > alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - > Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni > circostanza inerente alla presente email (il suo contenuto, gli eventuali > allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i > destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per > errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le > sarei comunque grato se potesse darmene notizia. This email is intended > only for the person or entity to which it is addressed and may contain > information that is privileged, confidential or otherwise protected from > disclosure. We remind that - as provided by European Regulation 2016/679 > “GDPR” - copying, dissemination or use of this e-mail or the information > herein by anyone other than the intended recipient is prohibited. If you > have received this email by mistake, please notify us immediately by > telephone or e-mail.* > _______________________________________________ > GeoTools-Devel mailing list > GeoTools-Devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-devel >
_______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel