Child pages
  • Item Core Services
Skip to end of metadata
Go to start of metadata
ScienceBase Geospatial Services provide core GIS services for items in three parts: 1) the item footprint for items that have one, 2) collection of geospatially referenced child items from the ScienceBase item hierarchy, and 3) appropriate data services from the ScienceBase Repository for items with geospatial data in the repository. Any item with a geospatial footprint will have simple map services in WMS and KML showing available parts of the footprint - point, bounding box, complex geometry.  Any item that acts as a collection or folder for other items in the ScienceBase hierarchy will provide a service with the point locations of any geospatially referenced (footprinted) child items. Any item with geospatial data in the ScienceBase Repository will have a corresponding dynamic service end point for WMS, WFS, KML, and/or WCS depending on the type of data.

Accessing Services

Geospatial services are generated automatically for each ScienceBase item and follow a standard naming convention.  The service end-point is generated at https://www.sciencebase.gov/catalogMaps/mapping/ows/[id].  WMS, WFS, and WCS can each be accessed through this URL, using the standard parameters.

Example

Consider a ScienceBase item with the identifier 4f4e4ad5e4b07f02db683919, which can be found at https://www.sciencebase.gov/catalog/item/4f4e4ad5e4b07f02db683919.  When viewing this item in the ScienceBase user interface, one sees a map overview of the contents of the shape file facet contained by this item.  Further, this item has a footprint.

To find the underlying spatial services provided by the system, select the Advanced Services link in the menu shown above the map. A dialog box will appear that contains links to the services provided for this item.  In this case, ScienceBase provides WMS and WFS services for two layers: the shape file layer, named Fault_Poly. The links direct the user to the GetCapabilities documents for each of these services.  These are standard XML documents described by the OGC specifications that enumerate the capabilities of each service.  It is possible, from this XML, to determine what layers are available and in what projections.

WMS Services

The OGC Web Mapping Service endpoint provides rendered images of geospatial products. Typically, you will generate an image in PNG or JPEG format, but others are supported, as described in this snippet from the GetCapabilities XML. This service is supported for vector and raster spatial types.

<Format>image/png</Format>
<Format>application/atom+xml</Format>
<Format>application/pdf</Format>
<Format>application/vnd.google-earth.kml+xml</Format>
<Format>application/vnd.google-earth.kmz</Format>
<Format>image/gif</Format>
<Format>image/jpeg</Format>
<Format>image/svg+xml</Format>
<Format>image/tiff</Format>

The most useful capability supported by a WMS service is called GetMap. A GetMap request has a variety of parameters:

ParameterRequired?Description
serviceYesService name. Value is WMS.
versionYesService version. Value is one of 1.0.01.1.01.1.11.3
requestYesOperation name. Value is GetMap.
layersYes

Layers to display on map. Value is a comma-separated list of layer names. Read below for more on the various available layers.

stylesYesStyles in which layers are to be rendered. Value is a comma-separated list of style names, or empty if default styling is required. Style names may be empty in the list.
srs or crsYesSpatial Reference System for map output. Value is in formEPSG:nnncrs is the parameter key used in WMS 1.3.0.
bboxYesBounding box for map extent. Value is minx,miny,maxx,maxy in units of the SRS.
widthYesWidth of map output, in pixels.
heightYesHeight of map output, in pixels.
formatYesFormat for the map output. See the list above or the capabilities XML document for supported values.
transparentNoWhether the map background should be transparent. Values aretrue or false. Default is false
bgcolorNoBackground color for the map image. Value is in the form RRGGBB. Default is FFFFFF (white).
exceptionsNoFormat in which to report exceptions. Default value isapplication/vnd.ogc.se_xml. Other valid values areapplication/vnd.ogc.inimage and application/vnd.ogc.se_blank.

Here is an example of a GetMap request that returns a transparent 680x350 PNG file for the example item above.  It uses the EPSG:900913 projection, which is web mercator.

http://www.sciencebase.gov/catalogMaps/mapping/ows/4f4e4ad5e4b07f02db683919?service=wms&layers=Fault_Poly&format=image/png&height=350&width=580&request=getmap&transparent=true&srs=EPSG:900913&styles=&version=1.1.1&bbox=-1.1937060339733224E7,2523882.5664386265,-7138569.534917223,5419523.569419722

Much more is possible with this and other features of the WMS service.  Please reference the GeoServer WMS documentation or the WMS specification for more information.

WFS Services

This service provides access to geospatial vector data in various formats. As such, it is only supported for vector sources of data. Our services will export in the following formats:

<ResultFormat>
  <GML2/>
  <GML3/>
  <SHAPE-ZIP/>
  <CSV/>
  <GEOJSON/>
</ResultFormat>

Excellent help on using WFS is available at http://docs.geoserver.org/stable/en/user/services/wfs/index.html

WCS Services

WCS is the Web Coverage Service standard that provides access to raster data. Excellent information on using a WCS service is again available from GeoServer at http://docs.geoserver.org/stable/en/user/services/wcs/index.html.

KML Reflector

The KML reflector provides a short-hand way to get KML output without having to construct a complicated WMS string.

http://www.sciencebase.gov/catalogMaps/mapping/ows/4f7a4a65e4b0009bd827f592?mode=download&request=kml&service=wms&layers=ch_ag

More information is available at http://docs.geoserver.org/stable/en/user/googleearth/features/kmlreflector.html?highlight=kml.

ScienceBase Layer Types

Footprint

Each ScienceBase item may have a "footprint," which is basic spatial data to communicate the spatial context of an item.  This may take the form of a single representational point or more complex points, lines, and polygons.

This layer is available through WMS and WFS services for items that have footprints.

Children

This layer provides point data showing where all of the child items of this item are located.  Each representational point for underlying items is available.

This layer is available through WMS and WFS services for items that have children with footprints.

Extensions

ScienceBase items may have extensions that contain further geospatial data, like GeoTIFF files or ESRI Shapefiles. These are available as additional layers in the spatial services. Each layer has the same name as the associated extension on the ScienceBase item.  Most often, this is the filename.

Rasters

Raster types, like GeoTIFF files, are made available through WMS and WCS services.

Shapefiles

Shapefiles, which contain vector data, are made available through WMS and WFS services.

SLD Styling

It is possible to control the styling of raster and shapefile extension services by attaching an SLD (styled layer descriptor) file to the extension's list of files, as illustrated by the image below. Notice that the extension contains both a GeoTIFF and an SLD file for coloring it.

Before:

After:

Here is the simple example SLD file used above that creates a two-color ramp between values, as well as transparency for the rest of the map.

<StyledLayerDescriptor version="1.0.0"
                       xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
                       xmlns="http://www.opengis.net/sld"
                       xmlns:ogc="http://www.opengis.net/ogc"
                       xmlns:xlink="http://www.w3.org/1999/xlink"
                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <NamedLayer>
        <Name>Two color gradient</Name>
        <UserStyle>
            <Title>Two color gradient</Title>
            <FeatureTypeStyle>
                <Rule>
                    <RasterSymbolizer>
                        <ChannelSelection>
                            <GrayChannel>
                                <SourceChannelName>1</SourceChannelName>
                            </GrayChannel>
                        </ChannelSelection>
                        <ColorMap>
                            <ColorMapEntry color="#0000ff" opacity="0" quantity="-3.4028234663852886E38"/>
                            <ColorMapEntry color="#191970" quantity="0.0"/>
                            <ColorMapEntry color="#87cefa" quantity="1.0"/>
                        </ColorMap>
                    </RasterSymbolizer>
                </Rule>
            </FeatureTypeStyle>
        </UserStyle>
    </NamedLayer>
</StyledLayerDescriptor>

 

Map Packages

Map packages are an ESRI format that packages a complete ESRI map into a compressed file.  Once uploaded to ScienceBase, an automated process creates a service for each map package on an ArcGIS Server platform.  The URL to the associated service can be obtained by concatenating the servicePath value from the extension JSON with the following url: http://www.sciencebase.gov/catalogMaps/services/Catalog/.

{
  "facets": [
    {"files": [
      {
        "name": "New File Geodatabase (23).gdb.7z",
        "contentType": "x-gis/x-mpk",
        "contentEncoding": null,
        "pathOnDisk": "__disk__39/56/4d/39564df57f4ed0a51a91d67c3dbb3f6730121648",
        "url": "https://www.sciencebase.gov/catalog/file/get/4fbebeace4b0cd41ada3819c?f=__disk__39%2F56%2F4d%2F39564df57f4ed0a51a91d67c3dbb3f6730121648",
        "size": 13632282
      }
    ],
    "processingMessage": "",
    "servicePath": "4fbebeace4b0cd41ada3819c",
    "processingState": "success",
    "name": "New File Geodatabase (23).gdb.7z",
    "className": "gov.sciencebase.catalog.item.facet.MapPackageFacet"
  }]
}
  • No labels