After logging into GeoServer instance is to create a workspace for your web service. In the workspace all the layers / styles data will be stored.
- To create a workspace, click on Workspaces under Data. This will bring up the Workspaces page, wherein you can manage existing workspaces and create new workspaces.
Figure 6 – Add new workspace window
Click on Add new workspaces.
- Provide workspaces name and Namespace URI (The namespace uri associated with this workspace)
A URI is similar to a URL (Uniform Resource Identifier), except URIs do not need to point to a actual location on the web, and only need to be a unique identifier. For a Workspace URI, recommend using a URL associated with project, with perhaps a different trailing identifier. For example, http://www.openplans.org/topp is the URI for the “topp” workspace.
- Select Default workspace and click submit to create workspace
Figure 7 - Create New Workspace window
- In the above example, Workspacecreated with India_Political (Workspace Name)
- To edit the workspace, click on the workspace name
Figure 8 - Edit Workspace window
- Edit the details and click on Save
- To delete / remove the workspace, select the workspace and click on Remove selected workspace(s).
Figure 9 - Remove workspace window
Creating Stores
A store connects to a data source that contains raster or vector data. A data source can be a file or group of files, a table in a database, a single raster file, or a directory. It is necessary to register a store before configuring datasets within it.
- To create a store, click on Storesunder Data. This will bring up the stores page, wherein you can manage existing store and create new stores.
Figure 10 -Stores window before adding layers
- Click on Add new store. It will bring up the types of stores you need to add.
- Directory of Spatial Files (Shapefiles) - GeoServer connects to and publishes data from a wide variety of sources. This section will discuss how to use the GeoServer web interface to accomplish most common tasks, along with the different data formats served by GeoServer.
- GeoPackage -GeoPackage is an SQLite based standard format that is able to hold multiple vector and raster data layers in a single file. GeoPackage files can be used both as Raster Data Stores as well as Vector Data Stores (so that both kinds of layers can published).
- PostGIS -PostGIS is an open source spatial database based on PostgreSQL, and is currently one of the most popular open source spatial databases today. It is very east to add to Geoserver with proper administrator prvillages.
- Properties - Allows access to Java Property files containing Feature information
- Shapefile – ESRI (tm) Shapefiles (*.shp)
- Web Feature Server (NG) - Provides access to the Features published a Web Feature Service, and the ability to perform transactions on the server (when supported / allowed).
- In this exercise we will add shape file to store.
Figure 11 - New data source window
- In this exercise we will add shape file to store
- Click on Shapefile to add shapefile to store
- Select the workspace (Refer Figure 7)
- Provide Data Source Name(Recommended to use shapefile name to identify the layer easily)
- Provide the description of the shapefile (Optional)
- Browse for the shapefile and click Save.
Figure 12 - Add vector data source window
Click on Stores to view the created stores.
Figure 13 - Stores window with created store
- To edit the Stores, click on the store name, you will be redirected to Figure 12. Edit the details and click on save.
- To delete / remove the stores, select the stores and click on Remove selected stores.
Creating Layers
In GeoServer, the term “layer” refers to a raster or vector dataset that represents a collection of geographic features. Vector layers are analogous to “featureTypes” and raster layers are analogous to “coverages”. All layers have a source of data, known as a Store. The layer is associated with the Workspace in which the Store is defined.
- To create a store, click on Layersunder Data. This will bring up the layers page, wherein you can manage existing layers and create new layers.
Figure 14 - Add Layers window
- Click on Add a new layer.
- Choose add layer from and select the layer
Figure 15 - Add New layer window
- Click on Publishto openlayer editing and publishing window/page
Figure 16 - Edit Layer
- Under Edit Layer, select the layer name from Keywords.
- Under Coordinate Reference System check Native SRS (SRS of the Shapefile)
Figure 17–Select Coordinate Reference System
- Select Declared SRS, you can change SRS if you want to publish the data into other SRS (Recommended to maintain Native & Declared SRS as same and under SRS handling)
- select Fore declared, it will force the Declared SRS to maintain the same values as Native SRS
- Under Bounding boxes
Figure 18 - Select Bounding Boxes
- Native Bounding Box – Click on Compute from data to use the same limits of the shape file
- Lat/Lon Bounding Box – Click on Compute from native bounds to use the same values given in Native Bounding Box
- Under Feature Type details – Attribute fields of the shapefile will be displayed
- Click on Save
Layer Preview
This page provides layer views in various output formats. Once the layer is added it can be viewed by clicking on the layer preview.
- The Layer Preview page supports a variety of output formats for further use or data sharing. You can preview all three-layer types in the common OpenLayers, KML, & GML formats.
- To view the preview of the layer, click on LayersPreview under Data. This will bring up the layers preview page, wherein you can view added layers.
Figure 19 - Layer Preview window
- Click on OpenLayers to preview the layer in new web page
Figure 20 – OpenLayer Map Preview in web page
- Click on KML(Keyhole Markup Language) to preview the layer in google earth (KML file will be downloaded)
- Click on GML (Geography Markup Language) to view the data in XML format.
(The Geography Markup Language (GML) is the XML grammar defined by the Open Geospatial Consortium (OGC) to express geographical features. GML serves as a modeling language for geographic systems as well as an open interchange format for geographic transactions on the Internet. Key to GML's utility is its ability to integrate all forms of geographic information, including not only conventional "vector" or discrete objects, but coverages and sensor data – Source Wikipedia.
Comments
Post a Comment