ExtractNodes() function - 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

Returns a polyline or region created from a subset of the nodes in an existing object. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

ExtractNodes( object, polygon_index, begin_node, end_node, b_region )

object is a polyline or region object.

polygon_index is an integer value, 1 or larger: for region objects. This indicates which polygon (for regions) or section (for polylines) to query.

begin_node is a SmallInt node number, 1 or larger; indicates the beginning of the range of nodes to return.

end_node is a SmallInt node number, 1 or larger; indicates the end of the range of nodes to return.

b_region is a logical value that controls whether a region or polyline object is returned; use TRUE for a region object or FALSE for a polyline object.

Return Value

Returns an object with the specified nodes. MapBasic applies all styles (color, etc.) of the original object; then, if necessary, MapBasic applies the current drawing styles.

Description

If the begin_node is equal to or greater than end_node, the nodes are returned in the following order:

  • begin_node through the next-to-last node in the polygon;
  • First node in polygon through end_node.

If object is a region object, and if begin_node and end_node are both equal to 1, MapBasic returns the entire set of nodes for that polygon. This provides a simple mechanism for extracting a single polygon from a multiple-polygon region. To determine the number of polygons in a region, call the ObjectInfo() function.

Error Conditions

ERR_FCN_ARG_RANGE (644) error generated if b_region is FALSE and the range of nodes contains fewer than two nodes, or if b_region is TRUE and the range of nodes contains fewer than three nodes.

See Also:

ObjectNodeX() function, ObjectNodeY() function