View tables – Pitney Bowes MapXtreme User Manual
Page 177

Chapter 8: Working with Data
Table Metadata (TableInfo)
MapXtreme v7.1
184
Developer Guide
Dim ti As TableInfoServer = New TableInfoServer("StateCapXY",_
"SRVR=tempest;UID=tn;PWD=tn", "Select * from usa_caps", _
MapInfo.Data.ServerToolkit.Oci)
Dim StateCapXY As Table = Connection.Catalog.OpenTable(ti)
' Add the Oracle columns to the USA table
Dim states As Table = Connection.Catalog.GetTable("usa")
states.AddColumns(Nothing, MapInfo.Data.BindType.Static, _
StateCapXY, "state", MapInfo.Data.Operator.Equal, "state")
'Create a ranged theme on the USA layer using a field
'from the Oracle table
Dim thm As MapInfo.Mapping.Thematics.RangedTheme = New _
MapInfo.Mapping.Thematics.RangedTheme(lyr, _
"pop_1990", "popusa", 4, _
MapInfo.Mapping.Thematics.DistributionMethod.EqualCount_
PerRange)
lyr.Modifiers.Insert(0, thm)
'Create a legend to appear on the map
Dim legend As MapInfo.Mapping.Legends.Legend = _
map.Legends.CreateLegend(New Size(5, 5))
legend.Border = True
Dim frame As MapInfo.Mapping.Legends.ThemeLegendFrame = _
MapInfo.Mapping.Legends.LegendFrameFactory.CreateTheme_
LegendFrame(_"Pop", "pop", thm)
legend.Frames.Append(frame)
frame.Title = "pop"
map.Adornments.Append(legend)
End Sub
View Tables
A view is a way to relate information from one or more tables based on a named select statement.
The Catalog allows you to create views based on any table definition. View tables have the following
characteristics:
•
The data is not copied.
•
Access to views always accesses its base tables.
•
View is an MapInfo SQL Select Statement with a name (Alias).
•
Queries may be joins (forms composite keys).
•
Membership in the View is live.
•
Exception: Views that aggregate cache the data. Data changed events trigger recomputation.
•
Can be serialized and persisted in workspaces.
For more information and code examples, see the MapInfo.Data.TableInfoView class in the
Developer Reference Help system.