Objects Move statement - 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

Moves the objects obtained from the current selection within the input table. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Objects Move
	Angle angle
	Distance distance
	[ Units unit ]
	[ Type { Spherical | Cartesian } ]

angle is a value representing the angle to move the selected object.

distance is a number representing the distance to move the selected object.

unit is the distance unit of distance.

Description

Objects Move moves the objects within the input table. The source objects are obtained from the current selection. The resulting objects replace the input objects. No data aggregation is performed or necessary, since the data associated with the original source objects is unchanged.

The object is moved in the direction represented by angle, measured from the positive X-axis (east) with positive angles being counterclockwise, and offset at a distance given by the distance parameter. The distance is in the units specified by unit parameter, if present. If the Units clause is not present, then the current distance unit is the default. By default, MapBasic uses miles as the distance unit; to change this unit, use the Set Distance Units statement.

The optional Type sub-clause lets you specify the type of distance calculation used to create the offset. If Spherical type is specified, then the calculation is done by mapping the data into a Latitude/Longitude On Earth projection and using distance measured using Spherical distance calculations. If Cartesian is specified, then the calculation is done by considering the data to be projected to a flat surface and distances are measured using Cartesian distance calculations. If the Type sub-clause is not present, then the Spherical distance calculation type is used. If the data is in a Latitude/Longitude Projection, then Spherical calculations are used regardless of the Type setting. If the data is in a NonEarth Projection, the Cartesian calculations are used regardless of the Type setting.

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

Objects Move Angle 45 Distance 100 Units "mi" Type Spherical

See Also:

Objects Offset statement