Commit 4ab52dc4 authored by Jody Garnett's avatar Jody Garnett Committed by Andrea Aime
Browse files

revised with numbered steps and additional use of rst and sphinx markup

parent 7bb34de8
......@@ -15,7 +15,7 @@ QGIS style exporting abilities have been evolving over time, as a reference:
vendor extensions to support constrast streching that most recent GeoServer versions support
properly. For older QGIS versions limited export functionality is available using the SLD4Raster plugin.
For the export it is advised to use the "Save As" functionality available in the style dialog,
For the export it is advised to use the :guilabel:`Save As` functionality available in the style dialog,
as indicated below in this guide. Other plugins exist that streamline the export process, but they
may ruin the style trying to adapt it to older GeoServer versions (e.g., translating it
down to SLD 1.0 by simple text processing means), or rewrite it entirely.
......@@ -30,134 +30,122 @@ down to SLD 1.0 by simple text processing means), or rewrite it entirely.
Exporting vector symbology
--------------------------
This is a step by step guide to style a GeoServer demo layer, "sfdem".
This is a step by step guide to style a GeoServer demo layer, ``sfdem``.
- Open QGIS (minimum version 3.0)
- Load the ``states.shp`` dataset from the GeoServer data directory, ``<GEOSERVER_DATA_DIR>/data/shapefiles/states.shp``
- Double click the layer to open the properties dialog and switch to the "Symbology" section
- Choose a "Graduated" rendering, on the "PERSONS" column, and click on "Classify" button to generate
1.5 standard deviations, select the "spectral" color ramp, switch mode to "Quantile" and finally
and click on the "Classify" button to generate a 5 classes map, as shown in figure.
#. Open :command:`QGIS` (minimum version 3.0)
#. Load the :file:`states.shp` dataset from the GeoServer data directory, :file:`<GEOSERVER_DATA_DIR>/data/shapefiles/states.shp`
#. Double click the layer to open the :guilabel:`Properties` dialog and switch to the :guilabel:`Symbology` page.
#. Choose a `Graduated` rendering, on the ``PERSONS`` column, and click on :guilabel:`Classify` button to generate `1.5` standard deviations, select the `spectral` color ramp, switch mode to `Quantile` and finally and click on the ":guilabel:`Classify` button to generate a 5 classes map, as shown in figure.
.. figure:: images/qgis-vector-style.png
:align: center
.. figure:: images/qgis-vector-style.png
:align: center
*QGIS vector styling*
QGIS vector styling
- Switch to the "Labels" tab, choose "Single labels", label with the "STATE NAME" attribute and
choose your preferred text rendering options, as shown in figure
#. Switch to the :guilabel:`Labels` page, choose `Single labels``, label with the ``STATE NAME`` attribute and choose your preferred text rendering options, as shown in figure
.. figure:: images/qgis-label-style.png
:align: center
.. figure:: images/qgis-label-style.png
:align: center
*QGIS labelling*
QGIS labelling
#. The layer renders as follows:
- The layer should render as follows:
.. figure:: images/qgis-vector-render.png
:align: center
.. figure:: images/qgis-vector-render.png
:align: center
QGIS raster styling
*QGIS raster styling*
#. Go back At the :guilabel:`Properties` dialog, from the bottom of the :guilabel:`Styles` page, choose :menuselection:`Style --> Save Style`.
.. figure:: images/qgis-vector-saveas.png
:align: center
- Go back At the dialog bottom, choose "Style" and then "Save Style..."
*Export using Save As...*
.. figure:: images/qgis-vector-saveas.png
:align: center
#. Choose export in the SLD format, placing the file in the desired location.
*Export using Save As...*
.. figure:: images/qgis-choose-format.png
:align: center
- Choose export in the SLD format, placing the file in the desired location
Choosing export format...
.. figure:: images/qgis-choose-format.png
:align: center
#. Go in GeoServer, create a new style, use the :guilabel:`Upload a new style` dialog to choose the exported file, and click on `upload` link.
*Choosing export format...*
.. figure:: images/gs-vector-upload.png
:align: center
- Go in GeoServer, create a new style, use the "Upload a new style" dialog to choose the exported
file, and click on "upload"
Uploading style in GeoServer...
.. figure:: images/gs-vector-upload.png
:align: center
#. Click on guilabel:`Apply`.
*Uploading style in GeoServer...*
#. Change to the :guilabel:`Layer preview` tab, click on the :guilabel:`Preview on Layer` link to choose ``topp:states`` to verify proper rendering.
- Click on "Apply", then "Layer preview", "Preview on Layer" and choose "topp:states" to verify
proper rendering
.. figure:: images/gs-vector-preview.png
:align: center
.. figure:: images/gs-vector-preview.png
:align: center
Previewing style in GeoServer...
*Previewing style in GeoServer...*
#. Eventually switch to the :guilabel:`Publishing` tab, search for ``states``, and select :guilabel:`Default` or :guilabel:`Associated` checkbox to publish the layer to use the new style permanently.
- Eventually switch to the "Publishing" tab, search for "states", and check on "Default",
or "Associated" to associate the style with the layer permanently.
.. figure:: images/gs-vector-associate.png
:align: center
*Associating style in GeoServer...*
.. figure:: images/gs-vector-associate.png
:align: center
Associating style in GeoServer...
Exporting raster symbology
--------------------------
This is a step by step guide to style a GeoServer demo layer, "sfdem".
- Open QGIS (minimum version 3.5)
- Load the ``sfdem.tif`` raster from the GeoServer data directory, ``<GEOSERVER_DATA_DIR>/data/sf/sfdem.tif``
- Double click the layer to open the properties dialog and switch to the "Symbology" section
- Choose a "Singleband pseudocolor" rendering, use a "mean +/- standard deviation" filtering using
1.5 standard deviations, and generate a 5 classes interpolated map, as shown in figure.
This is a step by step guide to style a GeoServer demo layer, ``sfdem``.
.. figure:: images/qgis-raster-style.png
:align: center
#. Open QGIS (minimum version 3.5)
#. Load the :file:`sfdem.tif` raster from the GeoServer data directory, :file:`<GEOSERVER_DATA_DIR>/data/sf/sfdem.tif`
#. Double click the layer to open the :guilabel:`Properties` dialog and switch to the :guilabel:`Symbology` page.
#. Choose a `Singleband pseudocolor` rendering, Generate :guilabel:`Min / Max Value Settings` using :guilabel:`Mean +/- standard deviation` with using ``1.5`` standard deviations. Generate a 5 classes :guilabel:`Linear` interpolated map, as shown in figure.
*QGIS raster styling*
.. figure:: images/qgis-raster-style.png
:align: center
- The layer should render as follows:
QGIS raster styling
.. figure:: images/qgis-raster-render.png
:align: center
#. The layer renders as follows:
*QGIS raster styling*
.. figure:: images/qgis-raster-render.png
:align: center
QGIS raster styling
- Go back At the dialog bottom, choose "Style" and then "Save Style..."
#. Return to the layer's :guilabel:`Properties` dialog :guilabel:`Symbology` page, at the bottom of the page choose :menuselection:`Style --> Save Style`.
.. figure:: images/qgis-raster-saveas.png
:align: center
.. figure:: images/qgis-raster-saveas.png
:align: center
*Export using Save As...*
Export using Save As...
- Choose export in the SLD format, placing the file in the desired location
#. Choose export in the SLD format, placing the file in the desired location
.. figure:: images/qgis-choose-format.png
:align: center
.. figure:: images/qgis-choose-format.png
:align: center
*Choosing export format...*
Choosing export format...
- Go in GeoServer, create a new style, use the "Upload a new style" dialog to choose the exported
file, and click on "upload"
#. Go in GeoServer, create a new style, use the :guilabel:`Upload a new style` dialog to choose the exported file, and click on `upload` link.
.. figure:: images/gs-raster-upload.png
:align: center
.. figure:: images/gs-raster-upload.png
:align: center
*Uploading style in GeoServer...*
Uploading style in GeoServer...
- Click on "Apply", then "Layer preview", "Preview on Layer" and choose "sfdem" to verify
proper rendering
#. Click on guilabel:`Apply` then change to the :guilabel:`Layer preview` tab. Click on the :guilabel:`Preview on Layer` link to choose ``sfdem`` to verify proper rendering.
.. figure:: images/gs-raster-preview.png
:align: center
.. figure:: images/gs-raster-preview.png
:align: center
*Previewing style in GeoServer...*
Previewing style in GeoServer...
- Eventually switch to the "Publishing" tab, search for "sfdem", and check on "Default",
or "Associated" to associate the style with the layer permanently.
#. Finally switch to the :guilabel:`Publishing` tab, search for ``sfdem`` layer, and select :guilabel:`Default` or :guilabel:`Associated` checkbox to publish ``sfdem`` with the new style.
.. figure:: images/gs-raster-associate.png
:align: center
.. figure:: images/gs-raster-associate.png
:align: center
*Associating style in GeoServer...*
Associating style in GeoServer...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment