Server Create Map statement - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Identifies the spatial information for a server table. It does not alter the table to add the spatial columns. For this release, we have added the option to place Oracle 11g annotation text in MapInfo maps. You can issue this statement from the MapBasic window in MapInfo Pro.

To support the changes to the Make Table Mappable dialog box, we use the Server <Connection Number> Create Map statement to register the metadata in the MAP CATALOG. To support ANNOTATION TEXT, we have introduced a Text object type. The statement is now:

Syntax

Server ConnectionNumber Create Map 
	For linked_table 
	Type { MICODE columnname | XYINDEX (xcolumnname, ycolumnname) | {
		SPATIALWARE | ORA_SP  | SQLSERVERSPATIAL {
		GEOMETRY | GEOGRAPHY } | POSTGIS } 
		columnname}
	[ CoordSys... ]
	[ MapBounds { Data | Coordsys | Values ( x1, y1 ) ( x2, y2 ) } ]
	[ ObjectType { Point | Line | Region | Text | ALL } ]
	[ Symbol(...) ]
	[ Linestyle Pen(...) ]
	[ Regionstyle Pen(...) Brush(...) ]
	[ Style Type style_number [ Column column_name ] ]

Text supports the creation of the text object for annotation text. The ALL option does not include this text object.

connectionNumber is an integer value that identifies the specific connection.

linked_table is the name of an open, linked ODBC table.

columnname is the name of the column containing the coordinates for the specified type.

xcolumnname is the name of the X column containing longitude value of the coordinate

ycolumnname is the name of the Y column containing latitude value of the coordinate

x1, y1, x2, y2 define the coordinate system bounds.

CoordSy clause specifies the coordinate system and projection to be used.

MapBounds clause allows you to specify what to store for the entire/default table view bounds in the MapCatalog. The default is Data which calculates the bounds of all the data in the layer. (For programs compiled before 7.5, the default will is Coordsys).

Coordsys stores the coordinate system bounds. This is not recommended as it may cause the entire layer default view to appear empty if the Coordsys bounds are significantly greater than the bounds of the actual data. Most users are zoomed out too far to see their data using this option.

Values lets you specify your own bounds values for the MapCatalog.

ObjectType clause specifies the type of object in the table: points, lines, regions, text, or all objects. If no ObjectType clause is specified, the default is Point. The Text option allows for the placement of Oracle Spatial annotation text into a text object., and the type for this option is ORA_SP. The ALL option does not include text.

Symbol is a valid Symbol clause to specify a point style.

Linestyle Pen is a valid Pen clause that specifies the line style to be used for a line object type.

Regionstyle Pen is a valid Pen clause and Brush is a valid Brush clause that specifies the line style and fill style to be used for a region object type.

StyleType sets per-row symbology. style_number is a value either 0 or 1. The Column keyword and argument must be present when style_number is set to 1 (one). When the style_number is set to zero the Column keyword is ignored and the rendition columns in the MapCatalog are cleared.

Description

The Server Create Map statement makes a table linked to a remote database mappable. For a SpatialWare, Oracle Spatial, SQL Server Spatial or PostGIS table, you can make the table mappable for points, lines, or regions. For all other tables, you can make a table mappable for points only. Any MapInfo Pro table may be displayed in a Browser, but only a mappable table can have graphical objects attached to it and be displayed in a Map window.

Note: If Oracle9i is the server and the coordinate system is specified as Lat/Long without specifying the datum, the default datum, World Geodetic System 1984(WGS 84), will be assigned to the Lat/Long coordinate system. This behavior is consistent with the Server Create Table statement and Easyloader.
Attribute Types Description
ORA_SP columnname OracleSpatial
SPATIALWARE SpatialWare for SQL Server
MICODE XYINDEX
SQLSERVERSPATIAL GEOMETRY SQL Server Spatial Geometry
SQLSERVERSPATIAL GEOGRAPHY SQL Server Spatial Geography
POSTGIS PostGIS for PostgreSQL

Examples

Sub Main
	Dim ConnNum As Integer 
	ConnNum = Server_Connect("ODBC",
		"DSN=SQLServer;DB=QADB;UID=mipro;PWD=mipro") 
	Server ConnNum Create Map For "Cities" 
	Type SPATIALWARE 
	CoordSys Earth Projection 1, 0 
	ObjectType All 
	ObjectType Point 
	Symbol (35,0,12)
	Server ConnNum Disconnect 
End Sub

The following is an example of the MapBasic statement for the ANNOTEXT_TABLE:

Server 1 Create Map For """MIPRO"".""ANNOTEXT_TABLE""" 
	Type ORA_SP "TEXTOBJ" 
	CoordSys Earth Projection 12, 62, "m", 0 Bounds 
		(-34012036.7393, -8625248.51472) (34012036.7393, 8625248.51472) 
	mapbounds data 
	ObjectType Text

See Also:

Server Link Table statement, Unlink statement