Hi Thomas,

it should be possible to import YSLD-Styles via REST.
Here are some snippets (curl commands) from a script that we were using to do this:


Step 1: Create the style

curl \
    -v \
    -u $USER:$PASSWORD \
    -XPOST \
    -H "Content-type: text/xml" \
    -d "<style>
        <name>$YOURSTYLE</name>
        <format>ysld</format>
        <filename>$YOURSTYLE.yaml</filename>
        <languageVersion>
          <version>1.0.0</version>
        </languageVersion>
      </style>" \
http://localhost:8080/geoserver/rest/workspaces/$YOURWORKSPACE/styles


Step 2: Upload the style

 curl \
    -v \
    -u $USER:$PASSWORD \
    -XPUT \
    -H "application/vnd.geoserver.ysld+yaml" \
    --data-binary @$YOURSTYLE.yaml \
http://localhost:8080/geoserver/rest/workspaces/$YOURWORKSPACE/styles/$YOURSTYLE


Step 3 (optional): Assign style

curl \
    -v \
    -u $USER:$PASSWORD \
    -XPUT \
    -H "Content-type: text/xml" \
    -d "<layer>
        <defaultStyle>
          <name>$YOURSTYLE</name>
          <workspace>$YOURWORKSPACE</workspace>
        </defaultStyle>
      </layer>" \
http://localhost:8080/geoserver/rest/layers/$YOURWORKSPACE:$YOURLAYER


Good luck,

Nils



Am 07.12.2016 um 12:23 schrieb thomas-maximilian.cuer...@t-systems.com:
Hello,
I am trying to add YSLD-Styles through Rest equivalent to this Documentation of SLD-Imports: _http://docs.geoserver.org/stable/en/user/rest/api/styles.html_ At the end of the first section it says: “Other extensions (such as /_css_/ <http://docs.geoserver.org/stable/en/user/styling/css/index.html>) add support for additional formats”. Unfortunately I haven’t found any documentation for the YSLD-extension regarding this issue. Is there nevertheless any way to import YSLD-Styles via Rest or is that just possible by converting them into SLDs?
I am using the GeoServer 2.10 Version.
Cheers
Thomas


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi


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

--
Dipl.-Inf. Nils Bühner
— Anwendungsentwickler —
terrestris GmbH & Co. KG
Kölnstr. 99
53111 Bonn

Tel:   +49 (0)228 / 96 28 99 -54
Fax:   +49 (0)228 / 96 28 99 -57

Email: bueh...@terrestris.de
Web:   http://www.terrestris.de

Amtsgericht Bonn, HRA 6835
Komplementärin: terrestris Verwaltungsgesellschaft mbH
vertreten durch: Hinrich Paulsen, Till Adams

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to