Creating geometries – Pitney Bowes MapXtreme User Manual

Page 506

Advertising
background image

Appendix D: Extensible Data Providers

Advanced Topics / Important Considerations

MapXtreme v7.1

513

Developer Guide

Š

Creating Geometries

Š

Coordinate Systems

Š

Styles

Š

Exception Handling

Š

Persistence Providers

Š

Serialization

Š

Authentication

Š

Thread safety

Creating Geometries

Extensible data providers implementing support for 3rd party spatial formats must convert spatial
data between their format and the MapXtreme FeatureGeometry format. FeatureGeometry objects
are returned as values of the IFeature objects obtained from cursors and feature accessors. The
features and the geometry objects they contain are transient. MapXtreme will only assume that
these objects are valid while the cursor is open and positioned on the current feature. As a result,
the most robust and scalable data provider implementations will try to re-use the same feature and
feature geometry objects for the life of the cursor or feature accessor.

A geometry that is created once and continually updated for the current feature is referred to as a
“transient” geometry. MapXtreme’s geometry model contains constructor and method signatures
that facilitate geometries being used in this way. Following the initial construction of MultiPoint,
MultiCurve, and MultiPolygon objects, geometry editor interfaces can be used on these existing
instances to make the changes for the new feature. For MultiCurve and MultiPoygon objects, the
Clear method can be used to empty the geometry, and then AddCurve and AddPolygon can be used
respectively to redefine the geometries. For MultiPoint objects, the ReplaceAll method can be used
for redefinition. Furthermore, the constructor signatures and Add/Replace methods that use input
arrays support an optional size designation enabling single array instances to be efficiently re-used
as well.

The OGC conversion code works in this manner. The internal byte arrays used for parsing the well
known binary and well known text are reused and grown as needed. When data is supplied to the
appropriate geometry methods (like AddPolygon) the forms that accept an array size are used since
the input arrays may be longer than the data being supplied.

MultiPolygon objects composed of multiple polygons are generally checked by MapXtreme to
determine if any of the polygons have interior/exterior relationships to one another; for example, a
doughnut shaped MultiPolygon instance might be comprised of an exterior polygon with a second
interior polygon interpreted as a cutter such that the two together logically represent a single
geometry. The geometry code does not make any assumptions by default, and when editing is
complete it will analyze all of the constituent polygons searching for the existence of these
relationships. If the 3rd party spatial format being converted already knows these relationships and
can add the polygons in the correct sequence (exteriors followed immediately by any of its
associated interiors), there’s no need for MapXtreme to incur the potentially expensive cost of re-
analyzing all of the polygons. This operation can be suppressed using the overloaded
EditingComplete method on the MultiPolygon class and passing “true” to the withinSpecified
argument.

Advertising