Options

General Tab

Table 1. Read Spatial Data General Options

Option

Description

MISQL

To enter an MI SQL query, begin typing. An auto-completion pop-up window displays a list of functions and aggregations supported by Spectrum Spatial, filtering the list based on what you type. All MI SQL keywords are highlighted in blue. See the Introduction MapInfo SQL Language Reference Guide for detailed information on using MI SQL.
  • Press Tab to insert a function.
  • To see the table structure, you can use SELECT * to see all the columns and types in a table.
  • You can name a stage field using the As keyword; for example, SELECT Obj As Geom...
  • Click Verify to see the fields in the data and the Read Spatial Data input fields, as well as to verify the validity of the query. These stage fields are now available for the downstream stage.

Examples

select count (*) from "/Polygon" where MI_Contains(Obj, ${Geometry} )

This is based on the typical query used for Point in Polygon where “/Polygon” is the named table that contains polygons to check for containment, Obj is the geometry column in the “/Polygon” named table that contains the polygons, and ${Geometry} is the field that will contain the incoming point to check for containment. This counts the number of polygons that the incoming point is contained within.

select Country, Capital, MI_Within(obj, ${Geometry}) from "/Samples/NamedTables/WorldcapTable"

This query returns each country and capital from the WorldcapTable named table that is contained within a specified geometry.

select Count(*) from "/Samples/NamedTables/WorldcapTable" Group by Country

This query returns the number of records per country.

Note: A named table must be present in the repository before using it with MISQL in this stage.

Include checkbox

The Include checkbox allows you to select which columns to include as fields on the output record. By default, all fields are selected. Once you start building the query, only columns in the SELECT clause will be shown.

Table columns Represents the column name for the SQL query. This field is not editable. If you have an alias in the SQL query then the alias will appear in this column.
Output field name Represents the output field. If selected, this name will be written to the stage output. This field is editable; for example, a field called Latitude could be named PointOfInterest_Latitude (a unique name is required).
Type Represents the column type. This field is not editable.

Coordinate System Tab

Note: This tab is only available for dataflows created prior to version 11.1 of the Spectrum Technology Platform. If you require a coordinate system transform use either the MI_Transform MI SQL function or the Coordinate System Transform option in the Spatial Calculator.
Table 2. Read Spatial Data General Options

Option

Description

Coordinate system

The coordinate system for the geometry object returned by the query. Read Spatial Data transforms the geometry to the coordinate system you specify here.

To change the default coordinate system, clear the default value then start typing the name of a coordinate system or an EPSG code to see a drop-down list of systems that begin with or contain those characters (the list appears after you have entered three alphanumeric characters). You can also click the browse button to open the Select Coordinate System dialog and select one from the list. Regardless of which coordinate system you select, the descriptive name will appear in the field and the respective EPSG code is saved for the stage.

For more information on EPSG codes, see www.spatialreference.org. To retrieve a list of supported codespaces for EPSG, you can submit the SOAP request List Supported CoordSys by Code Space from the Geometry Service Demo page at http://<server>:<port>/Spatial/GeometryService/DemoPage.html.