Pitney Bowes MapXtreme User Manual
Page 180

Chapter 8: Working with Data
Table Metadata (TableInfo)
MapXtreme v7.1
187
Developer Guide
VB example:
Public Shared Sub MapInfo_Data_SpatialSchemaXY()
Dim ti As TableInfo = _
TableInfo.CreateFromFile("c:\data\customers.TAB")
' a non-mappable table
Dim xy As SpatialSchemaXY = New SpatialSchemaXY
xy.XColumn = "Xcoord"
xy.YColumn = "Ycoord"
xy.NullPoint = "0.0, 0.0"
' Any customer at 0,0 means we don't know their location.
xy.StyleType = StyleType.None
xy.CoordSys = _
Session.Current.CoordSysFactory.CreateLongLat(DatumID.WGS84)
ti.SpatialSchema = xy
' Now set the spatial schema information before
' opening the table.
Dim table As Table = Session.Current.Catalog.OpenTable(ti)
End Sub
Public Shared Sub MapInfo_Data_TableInfoNative2(ByVal ti As _
TableInfoNative)
ti.WriteTabFile()
End Sub
SpatialSchemaPointRef
This spatial schema uses a value in the table's data to create a Point geometry object by matching
the value against an equivalent value in a mappable table.
For example, if your table of customers contains addresses with postal codes, the customer records
can be tied to the spatial points in a postal code reference table.
SpatialSchemaPointRef is actually a join between two tables, one containing data and the other
containing a join column and an object column. The join column contains the same values as the
data column in the non-mappable table, such as postal codes. The result of applying
SpatialSchemaPointRef is a table that contains a spatial geometry column for records that were
previously non-spatial. This geometry column has the following characteristics:
•
The data table may match more than one record in the geometry table. When this happens the
similar rows are aggregated into a MultiPoint geometry.
•
The geometry is the centroid of the geometry from the other table.
SpatialSchemaPointRef has these characteristics:
•
The temporary Geometry column is read-only.
•
Any edits to a value in the reference table changes the Geometry value in the data table.
•
SpatialSchemaPointRef can be applied to any data source except Seamless, View, and
ResultSet.
•
You can define styles for each point in the table.
•
You can store table information as a TAB file and open like any other table.