HowTo: add a shape feature store
1. Introduction
This HowTo page describes how to use the deegree 3 services console to add a new shape feature store to the deegree 3 web services. The description is based on the deegree3 utahDemo ready for download.
The tutorial will show how to add data from a shape file into a new shape feature store, in order to make the data available through basic WFS interfaces like DescribeFeatureType or GetFeature. The logical follow-up will be handled in another tutorial on how to add a layer to a mapService.
2. Preparations
Download the example SHP-File (ZIP), which depicts the LandslideAreas of the Utah County. The shape file is provided by the Utah GIS Portal, hosted by the AGRC.
- Unpack the zip file to a location of your choice.
/home/mays/Desktop/utahdata/SGID93_GEOSCIENCE_LandslideAreas/ SGID93_GEOSCIENCE_LandslideAreas.dbf SGID93_GEOSCIENCE_LandslideAreas.prj SGID93_GEOSCIENCE_LandslideAreas.shp SGID93_GEOSCIENCE_LandslideAreas.shp.xml SGID93_GEOSCIENCE_LandslideAreas.shx
3. Add shape feature store
Services console login: "deegree" (without the quote signs) is the default password.
Click on the link feature stores.
At the bottom of the listed features there is an input filed for new feature stores. Enter a name (e.g. utah_landslides) for the new feature store. From the select box choose the entry Shape. Click on Create new.
In the following screen you will be able to edit the XML file of the new feature store.
The location of this file is displayed at the top. The name of the file matches the name that you entered in the previous step:Editing: /home/mays/deegree3/deegree-utah-demo/webapps/ROOT/WEB-INF/workspace/datasources/feature/utah_landslides.xml
Below that you get an xml editor with example entries to help you along.
The only mandatory element is <File>...</File>. Here you need to enter the path and base name of your shape file (without file ending)
- either as relative path to the xml file that you are about to edit,
- or as absolute path as in the example below:
<ShapeFeatureStore xmlns="http://www.deegree.org/datasource/feature/shape" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" configVersion="3.0.0" xsi:schemaLocation="http://www.deegree.org/datasource/feature/shape http://schemas.deegree.org/datasource/feature/shape/3.0.0/shape.xsd"> <!-- [1] Name of the shape file --> <File>/home/mays/Desktop/utahdata/SGID93_GEOSCIENCE_LandslideAreas/SGID93_GEOSCIENCE_LandslideAreas</File> </ShapeFeatureStore>
Windows: Please make sure to only use forward slashes ("/") in the path/to/the/shapefile!<ShapeFeatureStore configVersion="3.0.0" xmlns="http://www.deegree.org/datasource/feature/shape" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.deegree.org/datasource/feature/shape http://schemas.deegree.org/datasource/feature/shape/3.0.0/shape.xsd"> <!-- [1] Name of the shape file --> <File>C:/Dokumente und Einstellungen/mays/Desktop/SGID93_GEOSCIENCE_LandslideAreas/SGID93_GEOSCIENCE_LandslideAreas</File> </ShapeFeatureStore>
Of course, this all depends on your local machine and the location of your shape file.
(For details on the other elements, please refer to the feature store documentation.)To apply the changes, you need to click the Save button at the top of the editor. The editor window will close and the Reload link in the top left corner will turn red to inform you about changes that have not been forwarded to the server side yet.
Click the Reload button to permanently store the changes in your configuration. (Follow-up message: Applying changes. Please wait).
4. Check success
The new shape feature store utah_landslides will be listed togehter with all other available feature stores.
- Check the capabilities of your WFS:
Click web services and then click on the Capabilities button next to the wfs.
The <WFS_Capabilities> document will contain the following section:
<wfs:FeatureType> <wfs:Name>app:SGID93_GEOSCIENCE_LandslideAreas</wfs:Name> <wfs:Title>app:SGID93_GEOSCIENCE_LandslideAreas</wfs:Title> <wfs:DefaultSRS>EPSG:26912</wfs:DefaultSRS> <wfs:OtherSRS>EPSG:4326</wfs:OtherSRS> <wfs:OutputFormats> <wfs:Format>text/xml; subtype=gml/2.1.2</wfs:Format> <wfs:Format>text/xml; subtype=gml/3.0.1</wfs:Format> <wfs:Format>text/xml; subtype=gml/3.1.1</wfs:Format> <wfs:Format>text/xml; subtype=gml/3.2.1</wfs:Format> </wfs:OutputFormats> <ows:WGS84BoundingBox> <ows:LowerCorner>-111.730497 40.127926</ows:LowerCorner> <ows:UpperCorner>-111.499315 40.500558</ows:UpperCorner> </ows:WGS84BoundingBox> </wfs:FeatureType>
the DefaultSRS is EPSG:26912, which is the SRS code for the data stored in the original shape file.
one OtherSRS is EPSG:4326, aka WGS84, which is the default SRS used in deegree.
5. What next ?
The data is there already, but now we want a map! The logical follow-up will be handled in another tutorial and teach you how to add a layer to a mapService, based on existing data.
6. Further reading
For details on all the elements of a <ShapeFeatureStore>, please refer to the feature store documentation.
Pages focusing on the deegree 3 services console:
Detailed description of the deegree 3 workspace and associated configuration pages:
- deegree3/WorkspaceConfiguration
- deegree3/WorkspaceConfiguration/CRSConfiguration
- deegree3/WorkspaceConfiguration/CoverageStoreConfiguration
- deegree3/WorkspaceConfiguration/DataStoreOverview
- deegree3/WorkspaceConfiguration/FeatureStoreConfiguration
- deegree3/WorkspaceConfiguration/FeatureStoreConfiguration_3.0
- deegree3/WorkspaceConfiguration/FeatureStoreConfiguration_3.1
- deegree3/WorkspaceConfiguration/JDBCConfiguration
- deegree3/WorkspaceConfiguration/MetadataStoreConfiguration
- deegree3/WorkspaceConfiguration/ObservationStoreConfiguration
- deegree3/WorkspaceConfiguration/ProxyConfiguration
- deegree3/WorkspaceConfiguration/RemoteOWSStore
- deegree3/WorkspaceConfiguration/ServicesConfiguration
- deegree3/WorkspaceConfiguration/ServicesConfiguration/ExtendedCapabilities
- deegree3/WorkspaceConfiguration/StylesConfiguration
- deegree3/WorkspaceConfiguration/TileStoreConfiguration