Pitney Bowes MapXtreme User Manual

Page 593

Advertising
background image

Appendix I: User-Defined Metadata

User-Defined Metadata Support for TableInfoServer Queries

MapXtreme v7.1

600

Developer Guide

The ColumnHints property is defined as a Columns collection. After creating an instance of the
collection, and inserting Column instances for each hint within it, this collection is assigned to the
ColumnHints property; for example, for a TableInfoServer variable named tblInfoSrv…

[C#]
Columns hints = new Columns();
// insert Column instances into the collection to serve as hints (see
below)
tblInfoSrv.ColumnHints = hints;

Column instances for types other than FeatureGeometry and Style may be added into the Columns
collection for the hints, but these other column definitions will currently be ignored.

Applying a FeatureGeometry Column Hint

A FeatureGeometry column hint may be used to indicate that a named column within the query
result contains spatial values to be interpreted as feature geometries. For example, if a query returns
a column named geo that contains spatial objects (e.g., a SpatialWare ST_Spatial binary, or an
Oracle Spatial MDSYS.SDO_GEOMETRY structure), we can identify this column as such by
constructing a hint and adding it into the Columns collection (from above) as follows:

[C#]
GeometryColumn geoCol = new GeometryColumn("geo");
...
hints.Add(geoCol);

The ellipsis in the code fragment above indicates that additional properties of the GeometryColumn
instance will also need to be set before completing the hint and adding it into the Columns collection.
FeatureGeometry hints are principally intended to be used for explicitly providing the same
information that the MapCatalog provides, specifically:

Coordinate System

FeatureGeometry Type

Default View

Default Style

Taking all of these properties into account, a more complete example of a FeatureGeometry hint
might look something like this:

[C#]
CoordSysFactory cfs = new CoordSysFactory();
CoordSys cs = cfs.CreateFromMapBasicString("Earth Projection 1, 0");
GeometryColumn geo = new GeometryColumn("geo", cs);
geo.PredominantGeometryType = GeometryType.Polygon;
geo.DefaultView = new DRect(-74, 40, -70, 44);
geo.DefaultStyle = new MapInfo.Styles.AreaStyle(
new MapInfo.Styles.SimpleLineStyle(new LineWidth(2.0,
MapInfo.Styles.LineWidthUnit.Pixel)),
new MapInfo.Styles.SimpleInterior(10));
hints.Add(geo);

Advertising