Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The following steps need to be followed in order to publish new spatial data in your GeoServer installation.


1. Add new styles (SLD)

Info

By default, GeoServer only supports styles through the use of SLD (Styled Layers Descriptor) standard files. Lots of examples and documentation can be found at http://docs.geoserver.org/2.8.3/user/styling/sld-cookbook/index.html

  1. Navigate to “Styles” and press the “Add new style” button
  2. Give your style a new name
  3. Paste your SLD into the text area or choose file to upload from your local computer
  4. Validate your style by pressing the “Validate” button
  5. Only submit your style if the validation retrieves no errors (like the next example)

   


2. Publish a new Layer

There are several possibilities to publish layers in Geoserver which are mainly related to the type of the data source you will be feeding GeoServer with. In the following section three procedures will be described:

...

Note

For performance reasons, it is recommended that all vectorial data being served by Geoserver is stored in a spatial database and that all optimizations have been done previously (e.g. building spatial indexes, geometry generalization, …)

2.1 Publish data imported into Union VMS database

  • Navigate to “Layers” and press the “Add new resource” button
  • In the next screen, choose “uvms:uvmsdb” option
  • From the list, choose the table you wish to publish (e.g. countries)
  • Make your layer specific settings:
    1. In the Data tab:
      • Accept all defaults
      • In the “Bounding Boxes” section press the “Compute from data” and “Compute from native bounds” options

...

  • Finally, press the “Save” button


2.2 Publish data imported into a different spatial database

  • You will first need to configure a datasource in your application server

    Code Block
    <datasource jta="true" jndi-name="java:jboss/datasources/my_db" pool-name="my_db" enabled="true" use-ccm="true">
        <connection-url>jdbc:postgresql://localhost:5432/mydb</connection-url>
        <driver>postgresql</driver>
        <security>
            <user-name>myuser</user-name>
            <password>mypassword</password>
        </security>
    </datasource>


...

  • Be sure to uncheck the option “Support on the fly geometry simplification”, and press “Save”
  • Navigate to “Layers” and press the “Add new resource” button
  • In the next screen, choose “uvms:mydb” option
  • From the list, choose the table you wish to publish
  • Make your layer specific settings like it was described in the previous procedure (2.1)

2.3 Publish a shapefile

  • Be sure that your shapefile is uploaded in the same server where you have your application server running
  • In the GeoServer admin page, navigate to “Stores” and press the “Add new store”
  • Select the “Shapefile” option and make the necessary configurations:
    • Define a name
    • Define a description
    • Browse to your shapefile through the “Browse” button
    • Set the character encoding of your shapefile
    • Accept the remaining values as defaults

...