Create Cutter 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

Produces a Region object that can be used as a cutter for an Object Split operation, as well as a new set of Target objects which may be a subset of the original set of Target objects. You need to provide a set of Target objects, and a set of polylines as a selection object. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Create Cutter Into Target 

Description

Before using Create Cutter, one or more Polyline objects must be selected, and an editable target must exist. This is set by choosing the Set Target command, or using the Set Target statement. The Polyline objects contained in the selection must represent a single, contiguous section. The Polyline selection must contain no breaks or self intersections.

The Polyline must intersect the Minimum Bounding Rectangle (MBR) of the Target in order for the Target to be a valid object to split. The Polyline, however, does not have to intersect the Target object itself. For example, the Target object could be a series of islands (for example, Hawaii), and the Polyline could be used to divide the islands into two sets without actually intersecting any of the islands. If the MBR of a Target does not intersect the Polyline, then that Target will be removed from the Target list.

Given this revised set of Target objects, a cumulative MBR of all of these objects is calculated and represents the overall space to be split. The polyline is then extended, if necessary, so that it covers the MBR. This is done by taking the direction of the last two points on each end of the polyline and extending the polyline in that Cartesian direction until it intersects with the MBR. The extended Polyline should divide the Target space into two portions. One Region object will be created and returned which represents one of these two portions.

This statement returns the revised set of Target objects (still set as the Target), as well as this new Region cutter object. This Region object will be inserted into the Target table (which must be an editable table). The original Polyline object(s) will remain, but will no longer be selected. The new Region object will now be the selected object. If the resulting Region object is suitable, then this operation can be immediately followed by an Object Split operation, as appropriate Target objects are set, and a suitable Region cutter object is selected.

Note: The cutter object still remains in the target layer. You will have to delete the cutter object manually from your editable layer.

Example

Open Table "C:\MapInfo_data\TUT_USA\USA\STATES.TAB" 
Open Table "C:\MapInfo_data\TUT_USA\USA\US_HIWAY.TAB"
Map from States, Us_hiway
select * from States where state = "NY"
Set target On
select * from Us_hiway where highway = "I 90"
Create Cutter Into Target
Objects Split Into Target

See Also:

OverlayNodes() function, Set Target statement