OffsetXY() 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 copy of the input object offset by the specified X and Y offset values. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

OffsetXY( object, xoffset, yoffset, units )

object is the object being offset.

xoffset and yoffset are numbers representing the distance along the x and y axes to offset the object.

units is a string representing the unit in which to measure distance.

Return Value

Object

Description

OffsetXY() produces a new object that is a copy of the input object offset by xoffset along the X-axis and yoffset along the Y-axis. The units string, similar to that used for the ObjectLen() function or Perimeter() function, is the unit for the distance values. The distance type used is Spherical unless the coordinate system is NonEarth. For NonEarth, the Cartesian distance type is automatically used. The coordinate system used is the coordinate system of the input object.

There are some considerations for Spherical measurements that do not hold for Cartesian measurements. If you move an object that is in Lat/Long, the shape of the object remains the same, but the area of the object will change. This is because you are picking one offset delta in degrees, and the actual measured distance for a degree is different at different locations.

For the Offset functions, the actual offset delta is calculated at some fixed point on the object (for example, the center of the bounding box), and then that value is converted from the input units into the coordinate system's units. If the coordinate system is Lat/Long, the conversion to degrees uses the fixed point. The actual converted distance measurement could vary at different locations on the object. The distance from the input object and the new offset object is only guaranteed to be exact at the single fixed point used.

Example

OffsetXY(Rect, 92, -22, "mi")

See Also:

Offset() function