Objects Check 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

Checks a given table for various aspects of incorrect data, or possible incorrect data, which may cause problems and/or incorrect results in various operations. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Objects Check From tablename Into Table tablename
	[ SelfInt [ Symbol Clause] ]
	[ Overlap [ Pen Clause ] [ Brush Clause ] ]
	[ Gap areavalue [ Units Units ] [ Pen Clause ] [ Brush Clause ] ] ] 

tablename is a string representing the name of a table.

Clause is an expression.

Units is a value of an area.

areavalue is a value above which any potential gap, that is larger than this gap area value, is discarded and not reported.

Description

Objects Check will check the table designated in the From clause for various aspects of bad data which may cause problems or incorrect results with various operations. Only region objects will be checked. The region objects will be optionally checked for self-intersections, and areas of overlap and gaps.

Self-intersections may cause problems with various calculations, including the calculation for the area of a region. They may also cause incorrect results from various object-processing operations, such as combine, buffer, erase, erase outside, and split.

For any of these problems, a point object is created and placed into the output table. The output table can be supplied through the Into Table clause. If no Into Table clause exists, the output data is placed into the same table as the input table.

If the SelfInt option is included, then the table will be checked for self-intersections. Where found, point objects are created using the style provided by the Symbol clause. By default, this is a 28-point red pushpin.

Many region tables are designed to be boundary tables. The STATES.TAB and WORLD.TAB files provided with the sample data are examples of boundary tables. In tables such as these, boundaries should not overlap (for example, the state of Utah should not overlap with the state of Wyoming). The Overlap option will check the table for places where regions overlap with other regions. Regions will be created in the output table representing any areas of overlap. These regions will be created using the Brush clause to represent the interior of the regions, and the Pen clause to represent the boundary of the regions. By default, these regions are drawn with solid yellow interiors and thin black boundaries.

Gaps are enclosed areas where no region object currently exists. In a boundary table, most regions abut other regions and share a common boundary. Just as there should be no overlaps between the regions, there should also be no gaps between the regions. In some cases, these boundary gaps are legitimate for the data. An example of this would be the Great Lakes in the World map, which separate parts of Canada from the USA. Most gaps that are data problems occur because adjacent boundaries do not have common boundaries that completely align. These gap areas are generally small.

To help weed out the legitimate gap areas, such as the Great Lakes, from problem gap areas, a Gap areavalue is used. Any potential gap that is larger than this gap area is discarded and not reported. The units that the Gap Area is in is presented by the Units clause. If the Units sub-clause is not present, then the Gap Area value will be interpreted in MapBasic's current area unit.

Gaps will be presented using the Pen clause and Brush clause that follow the Gap keyword. By default, these regions are drawn with blue interiors and a thin black boundary.

Example

This example will run Objects Check on the table called TestFile and store the results in the table called DumpFile. It will also use the Overlap keyword and change the default Point and Polygon styles. The Gap Area in this example is 100000.

objects check from TestFile into table Dumpfile
Selfint Symbol (67,16711680,28)
Overlap Pen (1,2,0) Brush (2,16776960,0)
100000 Units "sq mi" Pen (1,2,0) Brush (2,255,0)