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

Creates regions that are formed from collections of polylines; corresponds to MapInfo Pro's Enclose (Polylines to Regions) command (on the SPATIAL tab, click Regions). You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Objects Enclose
	[ Into Table tablename ]
	[ Region ]

tablename is a string representing the name of the table you want to place objects in.

Description

Objects Enclose creates objects representing closures linear objects (lines, polylines, and arcs). A new region is created for each enclosed polygonal area. Input objects are obtained from the current selection. Unlike the Objects Combine statement, the Objects Enclose statement does not remove the original input objects. No data aggregation is done.

The optional Region clause allows closed objects (regions, rectangles, rounded rectangles, and ellipses) to be used as input to the Objects Enclose statement. The input regions will be converted to Polylines for the purpose of this operation. The effects are identical to first converting any closed objects to Polyline objects, and then performing the Objects Enclose operation. All input objects must be linear or closed, and any other objects (for example, points, multipoints, collections, and text) will cause the operation to produce an error. If closed objects exist in the selection, and the Region keyword is not present, then those objects will be ignored.

The Objects Enclose statement corresponds to MapInfo Pro's Enclose (Polylines to Regions) command. For an introduction to this operation, see the discussion of this command in the MapInfo Pro User Guide. To see a demonstration of the Objects Enclose statement, run MapInfo Pro, open the MapBasic window, and use the Combine command on the SPATIAL tab.

The optional Into Table clause places the objects created by this command into the table. Otherwise, the output objects are placed in the same table that contains the input objects.

Example

This will select all the objects in a table called testfile, performs an Objects Enclose and stores the resulting objects in a table called dump_file.

select * from testfile
Objects Enclose Into Table dump_file

See Also:

Objects Check statement, Objects Combine statement, Set Combine Version statement