Reader Directives – all GeoMedia Warehouses

This section describes the directives that all GeoMedia reader modules recognize when reading from GeoMedia Warehouses.

DATASET

The value of this keyword depends on the format of the source dataset. For GeoMedia Access warehouse, it is either the filename of the Microsoft Access database or an existing ODBC data source name; for GeoMedia SQL Server warehouse, it is either the database name or an existing ODBC data source name.

When specifying data source name for GeoMedia SQL Server warehouse, a username and password is also required. For GeoMedia Access warehouse, a password is required only if the source warehouse is password-protected.

Required/Optional

Required

Range

Valid File Name or ODBC source for Access warehouses

Default

None

Mapping File Syntax

A typical mapping file fragment specifying an input GeoMedia dataset looks like:

FM0_DATASET D:\Warehouses\featuredata.mdb

or

FM0_DATASET Access_ODBC_Source

FM0_SQL_DATASET myDatabase

or

FM0_SQL_DATASET Sql_Server_ODBC_Source

Workbench Parameter

Source Intergraph GeoMedia Access Warehouse File(s) or Source Intergraph GeoMedia SQL Server Warehouse Dataset

DEF

Required/Optional

Optional

Each GeoMedia table may optionally be defined before it is read. The definition specifies the name of the table, the type of geometry on each row, the names and types of all attributes and possibly an optional WHERE clause, or even an entire SQL statement with which to query the table. The syntax of a GeoMedia DEF thus may appear in one of two forms.

The first form allows specification of a WHERE clause:

<ReaderKeyword>_DEF <tableName>	\
[SQL_WHERE_CLAUSE <whereClause>] \
	FM0_GEOMETRY fm0_point|fm0_arc|fm0_line|fm0_area| 
	fm0_text|fm0_none  \
[<attrName> <attrType>]+

Note: The Reader uses only the tableName and possible SQL modifications, ignoring the other geometry and attribute information, which is relevant only to the writer. An example of an SQL WHERE clause that could be used is

FM0_DEF States	\							
	SQL_WHERE_CLAUSE “id > 35“\ 											
		fm0_type fm0_area \
		id integer \
		name char(20)

Note: The value for SQL_WHERE_CLAUSE should always be enclosed within double quotation marks when specified on DEF lines.

where “id” is a column of the table “States”. The user is responsible for ensuring the column is contained in the table, and this WHERE clause is only appended to the SQL statement select * from <tableName>. The word WHERE is not included in the WHERE clause, but is appended automatically when a clause is specified.

The second form of a DEF line involves specification of an entire SQL statement:

<ReaderKeyword>_DEF <tableName> \
[SQL_STATEMENT <sqlStatement>]	\
	FM0_GEOMETRY fm0_point|fm0_arc|fm0_line|fm0_area|		
	fm0_text|fm0_none  \
[<attrName> <attrType>]+

The specified SQL statement is used to place the query against the database. It is again the responsibility of the user to ensure its correspondence with the correct table and columns. An example SQL statement might be

SELECT GEOMETRY FROM POINTS WHERE ID=0

The following table shows the attribute types that are supported.

Field Type

Description

char(<length>)

Character fields store fixed-length strings. The length parameter controls the maximum characters that can be stored by the field. When a character field is written, it is right-padded with blanks, or truncated, to fit the width. When a character field is retrieved, any padding blank characters are stripped away.

date

Date fields store dates as character strings with the format YYYYMMDD. Note that <fieldname>.full contains the time as well and is of the format YYYYMMDDHHMMSS.

smallint

Integer fields store whole numbers. This one is 2 bytes or 16 bits long.

integer

Integer fields store whole numbers. This one is 4 bytes or 32 bits long.

float

Real fields store decimal numbers. This one is 4 bytes or 32 bits long.

double

Real fields store decimal numbers. This one is 8 bytes or 64 bits long.

number

(<width>,<decimals>)

Fields created with this option will be converted to smallint, integer or double depending on the value of width and decimal parameters. The width parameter is the total number of characters allocated to the field, including the decimal point. The decimals parameter controls the precision of the data and is the number of digits to the right of the decimal. If the decimal is zero and width is less than 5, then the field type will be changed to smallint. If the decimal is zero and width is greater than 5 and less than 10, then the field type will be changed to integer. For all other cases, the field type will be treated as double.

Range: YES | NO

Default:NO

IDs

Required/Optional: Optional

This optional specification is used to identify a specific set of tables to be read from the data source. If nothing is specified, all tables are returned. This feature is useful only if a data source contains many tables and for efficiency you want to read only one table, rather than all of them.

Range: Valid table name in the data source

Default: None

Workbench Parameter: Feature Types to Read

PASSWORD

For a password-protected GeoMedia Access warehouse, this is a required parameter; otherwise, it is optional. For a GeoMedia SQL Server warehouse, this is a required parameter and will specify the password required to log in to the database specified by DATASET keyword.

Workbench Parameter: Password

TEXT_SIZE_GROUND_UNITS

Specifies the text size in ground units.

Range: Any positive number less than 2,147,483,647

Default: 1

Workbench Parameter: Text Size In Ground Units

USE_ORIENTED_POINTS

Required/Optional: Optional

This directive specifies how the GeoMedia oriented points will be read. If YES is specified, then all GeoMedia oriented points will be returned with orientation information. If NO is specified, then all GeoMedia-oriented points will be returned as normal points without the orientation information. The default value of this keyword is NO.

Workbench Parameter: Use oriented points

RETRIEVE_ALL_SCHEMAS

This parameter is applicable only when generating a mapping file, generating a workspace, or when retrieving schemas in an FME Objects application.

When set to yes, schemas for all of the tables and feature classes in the database are returned.

When set to no (or missing), and if RETRIEVE_ALL_TABLE_NAMES is similarly set to no (or missing), only schemas requested by the IDs parameter are returned.

Required/Optional

Optional

Values

YES | NO (default)

NO: The reader will return the schemas for the feature types specified in the IDs. If no features are specified in IDs, then FME returns the schema features for all the tables.

If this value is not specified, then it is assumed to be No.

YES: Indicates to the reader to return all the schemas of the tables in the database.

Mapping File Syntax

Not applicable.

FME Objects applications would include RETRIEVE_ALL_SCHEMAS followed by “YES” in the parameters array passed to IFMEUniversalReader::open().

Workbench Parameter

Not applicable

RETRIEVE_ALL_TABLE_NAMES

This parameter is only applicable when generating a mapping file, generating a workspace or when retrieving schemas in an FME Objects application.

When set to yes, and if RETRIEVE_ALL_SCHEMAS is set to no (or missing), names for all of the tables and feature classes in the database are returned. When set to no (or missing), and if RETRIEVE_ALL_SCHEMAS is similarly set to no (or missing), the schemas requested by the IDs directive are returned.

Note: If RETRIEVE_ALL_SCHEMAS is also set to Yes, then RETRIEVE_ALL_SCHEMAS takes precedence.

Required/Optional

Optional

Values

YES | NO (default)

Mapping File Syntax

Not applicable.

FME Objects applications would include RETRIEVE_ALL_TABLE_NAMES followed by “YES” in the parameters array passed to IFMEUniversalReader::open().

Workbench Parameter

Not applicable (used when you browse a Table List)