ObjectNodeHasZ() 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 TRUE if a specific node in a region, polyline, or multipoint object has a z-coordinate. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

ObjectNodeHasZ( object, polygon_num, node_num ) 

object is an Object expression.

polygon_num is a positive integer value indicating which polygon or section to query. It is ignored for Multipoint objects (it used for regions and polylines).

node_num is a positive integer value indicating which node to read.

Return Value

Logical

Description

The ObjectNodeHasZ() function returns TRUE if a specific node from a region, polyline, or multipoint object has a z-coordinate. The polygon_num parameter must have a value of one or more. This specifies which polygon (if querying a region) or which section (if querying a polyline) should be queried. Call the ObjectInfo() function to determine the number of polygons or sections in an object. The ObjectNodeHasZ() function supports Multipoint objects and returns TRUE if a specific node in a Multipoint object has a z-coordinate.

The node_num parameter must have a value of one or more; this tells MapBasic which of the object's nodes should be queried. You can use the ObjectInfo() function to determine the number of nodes in an object.

If object does not support z-coordinates or a z-coordinate for this node is not defined, it returns FALSE.

Example

The following example queries the first graphic object in the table Routes. If the first object is a polyline, the program queries if the first node in the object has z-coordinates or m-values and queries z-coordinates and m-values of the first node in the polyline.

Dim i_obj_type As SmallInt,
	z, m As Float
	hasZ, hasM as Logical
Open Table "routes" 
Fetch First From routes 
	' at this point, the expression: 
	' routes.obj
	' represents the graphical object that's attached 
	' to the first record of the routes table. 
i_obj_type = ObjectInfo(routes.obj, OBJ_INFO_TYPE) 
If  i_obj_type = OBJ_PLINE Then 
	' ... then the object is a polyline...
	If (ObjectNodeHasZ(routes.obj, 1, 1)) Then 
		z = ObjectNodeZ(routes.obj, 1, 1) ' read z-coordinate
	End If
	If (ObjectNodeHasM(routes.obj, 1, 1)) Then 
		m = ObjectNodeM(routes.obj, 1, 1) ' read m-value
	End If
End If  

See Also:

Querying Map Objects, ObjectInfo() function