3

I am using openlayers to consume geoserver. I have created a geoserver WMS layer and preview it.

var tiled = new OpenLayers.Layer.WMS(
                    "GIS:pipelines - Tiled", "http://10.1.1.9:8080/geoserver/GIS/wms",
                    {
                        LAYERS: 'GIS:pipelines',
                        STYLES: ''
                    },
                    {
                        isBaseLayer: false                  
                    } 
                );

I have two questions:

  1. http://10.1.1.9:8080/geoserver/GIS/wms Why URI is containing GIS workspace name.
  2. LAYERS: 'GIS:pipelines' is using GIS workspage prefix.

If I delete GIS from URI and LayerName, may be error?

1

If you accessing the geoserver url you can try setting up a wms layers in qgis as http://localhost:8080/geoserver/wms? Which gives you access to all wms request in your geoserver config. Setting it to use http://localhost:8080/geoserver/GIS/wms will give you access to wms layers in your. Work space. Save your project with these two layers and open the qgis project file to inspect how the two url are constructed.

1

You can add a layer without workspace so you will not be obliged to use a workspace prefix.

The wokspace is very usefull when you have layers which will not interact between them. An when you have to name them with the same suffix.

0

The URL reads the value you entered as the "URI" when you created the workspace in GeoServer (You are accessing your workspace). Depending on the URI you gave to the workspace,the URL changes. The GIS in "GIS:pipelines" is the name of the workspace where your layer is contained.Also the Pipelines is the name of the layer. The structure of accessing data in GeoServer is clear Workspace > Store > Layer According to your URI and URL ,if you remove GIS there will be an error because it will be impossible to locate the workspace needed.

Hope this helps ..

  • The GIS in "GIS:pipelines" represent the workspace not the store. – Olyster May 24 '18 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.