Defining mappable tables in server table queries, The geometry column – Pitney Bowes MapXtreme User Manual

Page 224

Advertising
background image

Chapter 11: Accessing Data from a DBMS

Defining Mappable Tables in Server Table Queries

MapXtreme v7.1

231

Developer Guide

Defining Mappable Tables in Server Table Queries

The query you specify for a server table defines the result set of data from your DBMS that
represents the data in the table being added. You can formulate a fairly complex query to do
powerful server-side analysis that defines a mappable table in MapXtreme. Your MapXtreme
application uses this query internally to access the data.

MapXtreme generates several internal queries based on your query to access the data in a map as
well as selection/key based queries. The table from which the geometry column is selected must be
registered in the MapInfo MapCatalog on the server. MapXtreme requires this to obtain certain
metadata about the geometry column such as the coordinate system, spatial type, and default
styles.

In order for a query to define a mappable table, the query must contain both a geometry column and
a key column. Sometimes for more complex queries on small sets of data (where the spatial
indexing or spatial predicate cause the query to fail), you can specify
TableInfoServer.MbrSearch=false to enable the results to be mapped.

The Geometry Column

If you do not specify a geometry column that your MapXtreme application can recognize, the table is
opened, but cannot be added to a map (the table is unmappable). MapXtreme determines the
geometry column of the table by looking it up in the MapCatalog and by examining the result set
datatype of the column. You can reference the geometry column generically via the pseudo column
name “Obj”, or you may refer to the geometry column using its specific column name. This form is
required to reference the geometry column for an X/Y mappable layer. You can specify a geometry
column via any server-supported geometry function/expression.

Example

Select Obj from rdbsdata
Select sw_geometry from rdbsdata
select sw_member, ST_Buffer(geometry, 66.0, 0.1) from rdbsdata

// a geometry function

Select st_geometry(st_point(72.5, 42.5) from rdbsdata

// a geometry constructor

Oracle sdo_buffer example:

Select mi_prinx, mdsys.sdo_geom.sdo_buffer(geoloc, (select diminfo from
sdo_geom_metadata where table_name = 'ALINE'), 20) from aline where prinx
= 1

Oracle constructor example:

Select 1 "mi_prinx",
mdsys.sdo_geometry(3,null,null,mdsys.sdo_elem_info_array(1,3,3),
mdsys.sdo_ordinate_array(-79.919909,40.553465,-71.060457,45.363657)) from
dual

Advertising