Hi Simone,
Thanks a lot, I have raised an issue on this:
https://osgeo-org.atlassian.net/browse/GEOS-8034?filter=-4
Regards,
Moses
From: Simone Giannecchini [mailto:[email protected]]
Sent: Mittwoch, 15. März 2017 12:47
To: Gone, Moses
Cc: geoserver-users
Subject: Re: [Geoserver-users] Problem with YSLD ColorMapEntry from YAML file.
Hi Moses,
this is most likely a minor bug in the YSLD to SLD conversion.
SLD parser will not chew a Java color.
Regards,
Simone Giannecchini
==
GeoServer Professional Services from the experts!
Visit http://goo.gl/it488V for more information.
==
Ing. Simone Giannecchini
@simogeo
Founder/Director
GeoSolutions S.A.S.
Via di Montramito 3/A
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
-------------------------------------------------------
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i
file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo
è consentito esclusivamente al destinatario del messaggio, per le finalità
indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne
il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di
procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro
sistema. Conservare il messaggio stesso, divulgarlo anche in parte,
distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse,
costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for the
attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act (Legislative
Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in
accord with its purpose, any disclosure, reproduction, copying, distribution,
or either dissemination, either whole or partial, is strictly forbidden except
previous formal approval of the named addressee(s). If you are not the intended
recipient, please contact immediately the sender by telephone, fax or e-mail
and delete the information in this message that has been received in error. The
sender does not give any warranty or accept liability as the content, accuracy
or completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of e-mail
transmission, viruses, etc.
On Wed, Mar 15, 2017 at 11:03 AM,
<[email protected]<mailto:[email protected]>> wrote:
Dear List,
We are using Geoserver REST API to upload and attach yaml style files to
layers. A sample yaml file looks like this:
name: Test
title: Test Style title
abstract: Styling of Test layer
feature-styles:
- rules:
- title: raster
symbolizers:
- raster:
opacity: 1.0
color-map:
type: values
entries:
- ['#e20374', 1.0, 1, Lorem Ipsum (magenta = covered)]
We use the following curl commands to upload the style:
Creating Style
curl -u "$credentials" -XPOST -H "Content-type: text/xml" -d
"<style><name>$style_name</name><format>ysld</format><filename>$style_name.yaml</filename><languageVersion><version>1.0.0</version></languageVersion></style>"
http://host:8081/geoserver/rest/workspaces/$workspace_name/styles
Update the style with uploaded style info
curl -u $credentials -XPUT -H "Content-type:
application/vnd.geoserver.ysld+yaml" --data-binary @$style_name.yaml http://
host:8081/geoserver/rest/workspaces/$workspace_name/styles/$style_name
Check result:
curl -u $credentials -XGET http://
host:8081/geoserver/rest/workspaces/$workspace_name/styles/$style_name.sld?pretty=true
<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld"
xmlns:sld="http://www.opengis.net/sld" xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc" version="1.0.0">
<sld:NamedLayer>
<sld:Name>test</sld:Name>
<sld:UserStyle>
<sld:Name>Test</sld:Name>
<sld:Title>Test Style</sld:Title>
<sld:Abstract>Styling abstract desc.</sld:Abstract>
<sld:FeatureTypeStyle>
<sld:Rule>
<sld:Title>raster</sld:Title>
<sld:RasterSymbolizer>
<sld:ColorMap type="values">
<sld:ColorMapEntry
color="java.awt.Color[r=226,g=3,b=116]" opacity="1.0" quantity="1" label="lorem
ipsum (magenta = covered)"/>
</sld:ColorMapEntry>
<sld:ContrastEnhancement/>
</sld:RasterSymbolizer>
</sld:Rule>
</sld:FeatureTypeStyle>
</sld:UserStyle>
</sld:NamedLayer>
</sld:StyledLayerDescriptor>
As can be seen, #e20374 is converted to java.awt.Color instead of the same
'#e20374' literal. When I manually edit the yaml file in geoserver (i.e replace
java.awt.Color[r=226,g=3,b=116] with #e20374) , I get the correct styling.
[cid:[email protected]]
However, if I use the the java color ( java.awt.Color[r=226,g=3,b=116]), I get
the following error
[cid:[email protected]]
It seems that something goes wrong during conversion. Does anyone know the
cause of this problem?
Regards,
Moses
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/geoserver-users
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users