I also recommend YSLD as the best of both worlds. To compare I recommend
the style workshop exercises
<https://docs.geoserver.org/latest/en/user/styling/workshop/index.html> which
produce the same content in each styling flavour.

YSLD


   1. It is a one-to-one mapping to SLD (so it does exactly what you ask)
   and it is not in XML (why SDL indeed). It uses indentation to communicate
   the structure rather than XML tags.



   1. It is also willing to fill in the blanks for boiler-plate XML that is
   not very interesting (so only write what you need):


>From line exercise
<https://docs.geoserver.org/latest/en/user/styling/workshop/ysld/linestring.html>
:

line:
  stroke-color: blue
  stroke-width: 2px
  stroke-dasharray: 5 2


   1. You can also define and reuse snippets to prevent having to copy and
   paste


define: &stroke
  stroke-color: 'gray'
  stroke-width: 0.5
rules:
  - filter: ${mapcolor9 = '1'}
    scale: [min, max]
    symbolizers:
    - polygon:
        <<: *stroke
        fill-color: '#8DD3C7'
  - filter: ${mapcolor9 = '2'}
    scale: [min, max]
    symbolizers:
    - polygon:
        <<: *stroke
        fill-color: '#FFFFB3'


   1. Tip: Also you can convert between different styles using GeoServer
   REST API:


To access the default data directory SLD:

   - *http://localhost:8080/geoserver/rest/styles/states.sld?pretty=true
   <http://localhost:8080/geoserver/rest/styles/states.sld?pretty=true>*


To convert to YSLD:

   - http://localhost:8080/geoserver/rest/styles/states.yaml


The same approach can be used to convert a YSLD style to SLD if you wish to
go back to plain SLD.
This also works for converting CSS to YSLD or SLD (so please experiment
without fear of lock-in forever).

Just do not write SLD by hand :)
--
Jody Garnett


On Jun 20, 2023 at 6:21:22 PM, Miguel Ángel Parrilla Godínez via
Geoserver-users <geoserver-users@lists.sourceforge.net> wrote:

> Thanks Ian.
>
>
>
> Miguel Ángel.
>
>
>
> *De:* Ian Turton <ijtur...@gmail.com>
> *Enviado el:* martes, 20 de junio de 2023 18:16
> *Para:* Miguel Ángel Parrilla Godínez <maparri...@itracasa.es>
> *CC:* geoserver-users@lists.sourceforge.net
> *Asunto:* Re: [Externo] [Geoserver-users] Styled marks shape dot does not
> work in geoserver version 2.23.1
>
>
>
> *ADVERTENCIA: *Este correo electrónico se originó fuera de Tracasa
> Instrumental. No pinches en enlaces, abras ficheros adjuntos o respondas si
> no reconoces al emisor y no tienes la certeza de que el contenido es seguro
> .
>
>
>
>
>
>
>
> On Tue, 20 Jun 2023 at 17:13, Miguel Ángel Parrilla Godínez via
> Geoserver-users <geoserver-users@lists.sourceforge.net> wrote:
>
> Dear all,
>
> To the mail thread.
>
> I would like to know what are the advantages or disadvantages of styling
> using css or sld?
>
>
>
> SLD is machine readable and does exactly what you asked for and nothing
> else, css is human readable and does lots of things while you aren't
> watching but many people claim it is easier to use. It can be slower
> especially for complex styles (as they are converted in to SLD in the
> background)
>
>
>
> Ian
>
>
>
>
>
>
> ------------------------------
>
> This email has been scanned for spam and viruses by Proofpoint Essentials.
> Click here
> <https://eu1.proofpointessentials.com/index01.php?mod_id=11&mod_option=logitem&mail_id=1687277750-NS3lHlrGfpZ2&r_address=maparrilla%40itracasa.es&report=1>
> to report this email as spam.
>
>
>
> ------------------------------
>
> AVISO LEGAL: Este correo y en su caso su(s) archivo(s) adjunto(s),
> proceden de TRACASA INSTRUMENTAL, S.L. y se dirige exclusivamente a su
> destinatario, puede contener información privada o confidencial amparada
> por el secreto de empresa, y a la que sólo tiene el derecho de acceder el
> destinatario. Si no es Vd. el destinatario indicado, o la persona
> responsable de su entrega al mismo, deberá abstenerse de examinar su
> contenido y queda notificado de que la utilización, divulgación y/o copia
> sin autorización está prohibida en virtud de la legislación vigente. Si ha
> recibido este mensaje por error, le rogamos que nos lo comunique
> inmediatamente mediante correo electrónico a esta misma dirección, y
> proceda a su destrucción segura. TRACASA INSTRUMENTAL, S.L. es el
> responsable de tratamiento de los datos de carácter personal facilitados
> que se utilizarán con la finalidad de mantener comunicaciones con usted.
> Tiene la posibilidad de ejercitar los derechos de acceso, rectificación,
> limitación del tratamiento, supresión y portabilidad, mediante solicitud
> dirigida por escrito, acreditando su identidad a la dirección electrónica
> d...@itracasa.es. Puede consultar información adicional y detallada sobre
> nuestra política de protección de datos de nuestra web www.itracasa.es.
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
> http://geoserver.org/comm/userlist-guidelines.html
>
> If you want to request a feature or an improvement, also see this:
> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
>
>
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to