The GEOSS Discovery And Access Broker APIs
Authors: Fabrizio Papeschi, Mattia Santoro, Stefano Nativi
API version: 1.4.3-beta

GINode

Module: Core

A GINode is a Geo Information node representing an abstract geospatial resource, a "dataset" or a "service", available as result of a query to the DAB.

Nodes properties such as title and abstract are described by a report. A particular Report property attribute is type, which defines which kind of interactions are available with the node. When a node represents a "service" such as WMS, WCS, etc, the report has an additional service property.

Node accessibility

Usually a node is linked to one or more data. If the linked data is accessible by means of a set of options, the node is accessible otherwise it is directly accessible; a node can be both accessible and directly accessible.

  • accessible nodes provide one or more links that can be retrieved by means of the accessLink method. To test if this node is accessible use the isAccessible method
  • directly accessible nodes provide one or more links that can retrieved by means of the directAccessLinks method. To test if this node is directly accessible use the isDirectlyAccessible method

This API provides two other kinds of nodes: DAB and DAB sources

Methods

accessOptions

(
  • onResponse
)
async

If this node is accessible, retrieves one or more objects containing a list of validOptions, the defaultOption and the reducedOption to use as options for the accessLink method.
If this node is not accessible, this method does nothing.

Each returned object contains a validOptions array, and a defaultOption and a reducedOption. E.g.:

var options = {
                                                "validOptions": [
                                                      {
                                                         "CRS": "EPSG:4326",
                                                         "format": "IMAGE_PNG",
                                                         "firstAxisSize": {
                                                            "label": "Lat",
                                                            "value": 300
                                                         },
                                                         "secondAxisSize": {
                                                            "label": "Lon",
                                                            "value": 300
                                                         },
                                                         "spatialSubset": {
                                                             "south": -60.0,
                                                             "west": -180.0,
                                                             "north": 90.000007823,
                                                             "east": 180.000018775
                                                         },
                                                         "temporalSubset": {
                                                             "from" : "2000-01-01T00:00:00Z",
                                                             "to": "2013-01-01"        
                                                         }
                                                      },
                                                      {
                                                         "CRS": "EPSG:3857",
                                                         "format": "IMAGE_JPEG",
                                                         "firstAxisSize": {
                                                            "label": "X",
                                                            "value": 455
                                                         },
                                                         "secondAxisSize": {
                                                            "label": "Y",
                                                            "value": 300
                                                         },
                                                         "spatialSubset": {
                                                             "south": -60.0,
                                                             "west": -180.0,
                                                             "north": 90.000007823,
                                                             "east": 180.000018775
                                                         },
                                                         "temporalSubset": {
                                                             "from" : "2000-01-01T00:00:00Z",
                                                             "to": "2013-01-01"        
                                                         }
                                                      }],
                                                "defaultOption": 
                                                    {
                                                         "CRS": "EPSG:4326",
                                                         "format": "IMAGE_PNG",
                                                         "firstAxisSize": {
                                                            "label": "Lat",
                                                            "value": 300
                                                         },
                                                         "secondAxisSize": {
                                                            "label": "Lon",
                                                            "value": 300
                                                         },
                                                         "spatialSubset": {
                                                             "south": -60.0,
                                                             "west": -180.0,
                                                             "north": 90.000007823,
                                                             "east": 180.000018775
                                                         },
                                                         "temporalSubset": {
                                                             "from" : "2000-01-01T00:00:00Z",
                                                             "to": "2013-01-01"        
                                                         }
                                                      },
                                                "reducedOption": 
                                                    {
                                                         "CRS": "EPSG:4326",
                                                         "format": "IMAGE_PNG",
                                                         "firstAxisSize": {
                                                            "label": "Lat",
                                                            "value": 395
                                                         },
                                                         "secondAxisSize": {
                                                            "label": "Lon",
                                                            "value": 600
                                                         },
                                                         "spatialSubset": {
                                                             "south": -60.0,
                                                             "west": -180.0,
                                                             "north": 90.000007823,
                                                             "east": 180.000018775
                                                         },
                                                         "temporalSubset": {
                                                             "from" : "2013-01-01",
                                                             "to": "2013-01-01"        
                                                         }
                                                      }
                                                }
                                            

Parameters:

  • onResponse Function

    Callback function for receiving asynchronous query response

    • options Object

      the access options; in case of error this argument is set to null

    • [error] String optional

      In case of error this argument contains a message which describes the problem occurred

expand

(
  • onResponse
  • [pageSize=10]
)
async

If this node is composed, the result of the expansion is a result set split in pages (possibly one if the matched nodes are minor than the result set page size).
The result set contains the underlying first level nodes (this node children). If this node is a DAB instance, than the first call of this method returns the correspondent sources.
If the result set is split in more than one page use the expandNext method to retrieve the next ones. If this is a simple node, the result set is empty

Parameters:

expandNext

(
  • onResponse
  • [execute]
)
Boolean async

If this node has already been expanded, this method tests if other pages in the result set are available. If the test is positive and the execute argument is true, retrieves the next result set page. If this node is a composed node but it has never been expanded, an Exception is thrown.
If this is a simple node, this method returns false

Parameters:

  • onResponse Function

    onResponse Callback function for receiving asynchronous query response. See onResponse for more info

  • [execute] Boolean optional

    If omitted or set to false, this method tests if other pages in the result set are available and returns the test result. If set to true and the test is positive, this method retrieves the next result set page and returns true. If set to true and the test is negative this method returns false

Returns:

Boolean:

true if other pages in the result set are available, false otherwise

googleImageMapType

(
  • map
  • [initOptions]
)
google.maps.ImageMapType[]

Retrieves an array of google.maps.ImageMapType; if the current node does not provide any layer an empty array is returned.
All the available ImageMapTypeOptions are allowed; this method implements the getTileUrl function in order to build the correct WMS GetMap request.

Parameters:

Returns:

google.maps.ImageMapType[]:

array (possible empty) of google.maps.ImageMapType

has_olVector_Layer

() String[]

This method checks if the node provides one or more layers of type OpenLayers.Layer.Vector. The method returns an array of Strings, each string is the name of an available vector layer.

Returns:

String[]:

the Array of names of available OpenLayers.Layer.Vector layers.

isAccessible

()

Tests if this node is accessible.
See also accessOptions and accessLink methods

Returns:

true if this node is linked to one or more data and it is asynchronously accessible, false otherwise

isDirectlyAccessible

()

Tests if this node is directly accessible.

See also directAccessLinks method.
See also OnlineInfo.accessType property

Returns:

true if this node is linked to one or more data and it has one or more direct access links, false otherwise.

ol3WMS_Layer

(
  • [opt_options]
)
ol.source.TileWMS []

Retrieves an array of ol.source.TileWMS ; if the current node does not provide any layer an empty array is returned.
As explained in the ol.source.TileWMS constructor documentation, the returned layers can be optionally created with additional parameters and options for the GetMap request (see opt_options argument). E.g.:

var opt_options = {};
                                            opt_options.params = {LAYERS: name, TRANSPARENT: true}; //WMS request parameters. At least a LAYERS param is required.
                                            opt_options.attributions = new ol.Attribution({
                                                                                   html: 'All maps © ' + 'ExampleMap'
                                                                             }); 
                                            
                                            var layers = giNode.ol3WMS_Layer(opt_options);
                                            

Parameters:

Returns:

ol.source.TileWMS []:

Array of ol.source.TileWMS possible empty if this node does not provide any

olTiles_Layer

(
  • [initOptions]
)
OpenLayers.Layer.WMS[]

Retrieves an array of OpenLayers.Layer.WMS (TiledMapService type); if the current node does not provide any layer an empty array is returned.
As explained in the OpenLayers.Layer.WMS constructor documentation, the returned layers can be optionally created with additional parameters and options for the GetMap request (see initOptions argument). E.g.:

var initOptions = {};
                                            initOptions.params = {transparent: true}; // corresponds to the OpenLayers.Layer.WMS params argument
                                            initOptions.options = {opacity: 0.5}; // corresponds to the OpenLayers.Layer.WMS options argument
                                            
                                            var layers = giNode.olTiles_Layer(initOptions);
                                            

Parameters:

Returns:

OpenLayers.Layer.WMS[]:

Array of OpenLayers.Layer.WMS possible empty if this node does not provide any

olVector_Layer

(
  • onResponse
)
async

Retrieves an array of OpenLayers.Layer.Vector; if the current node does not provide any layer an empty array is returned.
Besides, client applications are required (at the moment) to handle the cross-origin nature of the request which is executed (GML is an XML encoding)

Parameters:

olWMS_Layer

(
  • [initOptions]
)
OpenLayers.Layer.WMS[]

Retrieves an array of OpenLayers.Layer.WMS; if the current node does not provide any layer an empty array is returned.
As explained in the OpenLayers.Layer.WMS constructor documentation, the returned layers can be optionally created with additional parameters and options for the GetMap request (see initOptions argument). E.g.:

var initOptions = {};
                                            initOptions.params = {transparent: true}; // corresponds to the OpenLayers.Layer.WMS params argument
                                            initOptions.options = {opacity: 0.5}; // corresponds to the OpenLayers.Layer.WMS options argument
                                            
                                            var layers = giNode.olWMS_Layer(initOptions);
                                            

Parameters:

Returns:

OpenLayers.Layer.WMS[]:

Array of OpenLayers.Layer.WMS possible empty if this node does not provide any

overview

(
  • id
  • onResponse
  • [options]
)
Boolean async

If this node has an overview, creates an <img> having as source the overview link at the given options.index (0 if not specified) and appends <img> to the element having the given id.
The overview property can be available also if this node is not accessible.

The method throws an Exception if id does not correspond to an element or if options.index does not respect the following statement: index >= 0 && index <= overview.length - 1

Parameters:

  • id String

    the id of an element in which to append the <img> element of the selected overview

  • onResponse Function

    Callback function for receiving asynchronous request status

    • status String

      possible status are 'success' and 'error'

    • [message] String optional

      in case of 'error' status this argument contains the error message

    • [image] String optional

      the loaded image element or null in case of error

  • [options] Object optional
    • [index=0] Number optional

      index of this node overview array

    • [size="medium"] String optional

      The overview size (aspect ration is preserved). Possible values are:

      • "extra small": 48x48 px
      • "small": 96x96 px
      • "medium": 144x144 px
      • "large": 288x288 px
      • "original": the original size of the target overview image
    • [force=false] Boolean optional

      If set to true a "no overview" image is used in case of error or in case an overview is not available

    • [backgroundURL] String optional

      URL of an additional image to load as background of the overview image (use this only if the overview image is transparent)

Returns:

Boolean:

true if this node has an overview, false otherwise

report

(
  • [newReport]
)
Report

Retrieves and optionally set a new report

Parameters:

Returns:

Report:

The node report

Properties

uiId

String

Identifier created with random method which contains only alphanumeric characters and can be used inside the attributes of DOM elements