SphericalOffset() 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 distance and angle using a spherical DistanceType. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

SphericalOffset( object, angle, distance, units )

object is the object being offset.

angle is the angle to offset the object.

distance is the distance to offset the object.

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

Return Value

Object

Description

This function produces a new object that is a copy of the input object offset by distance along angle (in degrees with horizontal in the positive X-axis being 0 and positive being counterclockwise). The unit string, similar to that used for the ObjectLen() function or the Perimeter() function, is the unit for the distance value. The DistanceType used is Spherical. If the coordinate system of the input object is NonEarth, an error will occur, since Spherical DistanceTypes are not valid for NonEarth. This is signified by returning a NULL object. 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 Latitude/Longitude, 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 Latitude/Longitude, 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

SphericalOffset(Rect, 45, 100, "mi")

See Also:

SphericalOffsetXY() function