CartesianBuffer() 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 region object that represents a buffer region (the area within a specified buffer distance of an existing object). You can call this function from the MapBasic window in MapInfo Pro.

Syntax

CartesianBuffer( inputobject, resolution, width, unit_name )

inputobject is an object expression.

resolution is a SmallInt value representing the number of nodes per circle at each corner.

width is a float value representing the radius of the buffer; if width is negative, and if inputobject is a closed object, the object returned represents an object smaller than the original object.

unit_name is the name of the distance unit (e.g., "mi" for miles, "km" for kilometers) used by width.

Return Value

Region Object

Description

The CartesianBuffer() function returns a region representing a buffer and operates on one single object at a time.

To create a buffer around a set of objects, use the Create Object statement As Buffer. If width is negative, and the object is a linear object (line, polyline, arc) or a point, then the absolute value of width is used to produce a positive buffer.

The CartesianBuffer() function calculates the buffer by assuming the object is in a flat projection and using the width to calculate a cartesian distance calculated buffer around the object.

If the inputobject is in a Latitude/Longitude Projection, then Spherical calculations will be used regardless of the Buffer function used.

Example

The following program creates a line object, then creates a buffer region that extends 10 miles surrounding the line.

Dim o_line, o_region As Object 
o_line = CreateLine(-73.5, 42.5, -73.6, 42.8) 
o_region = CartesianBuffer( o_line, 20, 10, "mi") 

See Also:

Buffer() function, Creating Map Objects, Set Buffer Version statement