All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.las.ogdi.OGDIDictionary

java.lang.Object
   |
   +----com.las.ogdi.OGDIDictionary

public class OGDIDictionary
extends Object
The Dictionary class describes the content of a geographic datasource available at the driver end and some metainformation related to the data. There is a tree structure exploited in a way described by a syntax model.

 

The OGDIDictionary class is used in relation with the following classes: OGDIDictionaryItem, OGDISyntaxModel, OGDISyntacticToken, OGDIExpressionSyntacticToken, OGDIItemSyntacticToken, OGDISeparatorSyntacticToken and OGDISyntacticParser. For each driver there is a corresponding class OGDI<Driver Name> Parser such as OGDIVRFParser,OGDIGRASSParser, and so on for the other geospatial data drivers).

The object instanciation process of these different classes is carried out as follows:

  1. Each instance of the OGDIClient class executes the getDictionary method. This method instanciates the OGDIDictionary object with a driver name and a string that describe the "updateDictionary". This string describes the metadata. This "updateDictionary" string is obtained by using an OGDI low-level function called "ecs_UpdateDictionary". This function will always have the parameters "url". This is the case with the GRASS and the RPF drivers. However, for the VRF driver, another parameter called "cat_list" is needed.
  2. The OGDIDictionary object allows the storage of the following information: driver name and dictionary string in _driver and _metadata fields respectively.
  3. The OGDIDictionary object instanciates one the following object according to the driver: OGDIVRFParser (if VRF driver), OGDIGRASSParser (if GRASS driver), etc. for the other drivers.
  4. Let suppose that we want to open a GRASS driver. The syntacticParser variable contains the OGDIGRASSParser object.
  5. The OGDI<Driver Name>Parser object instanciates the OGDIDictionaryItem objects with  the metadata description string defined in the OGDIDictionary object.
  6. Then, the object parser will instanciate the OGDISyntaxModel object and the its related objects according to the driver: OGDIItemSyntacticToken, OGDIExpressionSyntacticToken and OGDISeparatorSyntacticToken objects.

Dictionary Items are the building blocks to form a request that will enable you to access a coverage from an opened URL. At its simplest, a driver will have one level of Items i.e. all Items are at the same hierarchical level and organized by family. This is the case for a DTED data source for instance. In that case, you would get the list of dictionary Items from the URL Dictionary by invoking its getItems method (with the MATRIX family argument). That could return a "DTED" Item, which is the name of a coverage for that data source. Other drivers can have several levels of Items (VRF, GRASS. etc.) and sub-levels would be accessed by the getChildren method of an Item.

At that point, you would have to check the proper request syntax by invoking the getSyntaxModel (or getSyntaxDescription) of the dictionary. This would tell you that a DTED data source needs an item, a ( separator, an expression and a ) separator to properly validate a request. Separators are added for you, so you need only provide an item and an expression to the getRequest method of the SyntaxModel. In that case it could be the DTED Item and "DISK". The result is a correctly spelled request, DTED(DISK), that you put as an argument to create a Coverage object that, in turn, will serve as the argument to the setCurrentCoverage of the opened URL.

Here are a few syntax definitions according to the selected driver:

GRASS Driver: <File>@<Mapset>(*)   This syntax defines:  item (file or layer name), separator (@), item (mapset name), separator "(" (open parenthesis), expression (a * or an expression), separator ")" (closed parenthesis). The object number to be created will be equal to the larger number of mapsets times the number of families available in the GRASS driver  (Raster, Area, Line, Point and Text). The values of the different fields of the OGDIItemS.T. objects are defined in the following table:

 

Driver

Syntax

Fields and Values

GRASS <File>@<Mapset>(*) File: _level=0, _father=2, _description=null

Mapset: _level=1, _father=-1, _description=null

VRF <Coverage>@<Library>(expression) Coverage: _level=0, _father=2, _description= got from the dictionary description

Library: _level=1, _father=-1, _description=got from the dictionary description.

RPF <Coverage> For each field: _level=0, _father=-1, description=null

 

 

The number of objects OGDIDictionaryItem for the VRF driver will be equal to the larger number of Library times the number of families (Area, Line, Point, Text).

The number of objects OGDIDictionaryItem for the RPF driver will be equal to the number of coverages defined in the dictionary (there is only one family type: Raster).

Version:
1.1
Author:
Las Inc.
See Also:
OGDISyntaxModel

Constructor Index

 o OGDIDictionary(String, String, String, OGDISyntaxModel, Object, Enumeration)
Creates a Dictionary.

Method Index

 o getItems(OGDIFamily)
Gets the enumeration of coverages for a datasource.
 o getMetadata(int)
Gets the metainformation about the datasource.
 o getSyntaxDescription()
Gets a description of how to decode coverage names.
 o getSyntaxModel()
Gets rules of how to decode coverage names.
 o toString()
Gets the complete Dictionary description.

Constructors

 o OGDIDictionary
 public OGDIDictionary(String driver,
                       String urlinfo,
                       String syntaxDescription,
                       OGDISyntaxModel syntaxModel,
                       Object layout,
                       Enumeration items)
Creates a Dictionary. Note: The sub-structure of each top-level item is created thru Item add/remove

Parameters:
driver - the name of the driver
urlinfo - a string of metainformation about the datasource
syntaxDescription - a string describing the syntax format
layout - an object able to process the dictionary or null
items - the enumeration of coverage top-level items structure for a datasource
Returns:
no return
Throws: IllegalArgumentException
if a parameter is invalid

Methods

 o getSyntaxModel
 public OGDISyntaxModel getSyntaxModel()
Gets rules of how to decode coverage names.

Parameters:
no - parameter
Returns:
the syntax model
Throws: no
exception
 o getSyntaxDescription
 public String getSyntaxDescription()
Gets a description of how to decode coverage names.

Parameters:
no - parameter
Returns:
the syntax model
Throws: no
exception
 o getMetadata
 public String getMetadata(int level)
Gets the metainformation about the datasource.

Parameters:
level - the level of detail of the metadata returned (0 is minimum)
Returns:
a string of metainformation dependent on the driver type
Throws: no
exception
 o getItems
 public Enumeration getItems(OGDIFamily family)
Gets the enumeration of coverages for a datasource.

Parameters:
family - the family of the coverages enumerated
Returns:
an enumeration of coverages as OGDIDictionaryItem
Throws: IllegalArgumentException
if family is illegal
 o toString
 public String toString()
Gets the complete Dictionary description.

Parameters:
no - parameter
Returns:
the driver, metadata, syntax description/model, layout and items by family as a string
Throws: no
exception
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index