Purpose
Copies objects, obtained from the current selection, offset from the original objects. You can issue this statement from the MapBasic window in MapInfo Pro.
Syntax
Objects Offset
[ Into Table intotable ]
Angle angle
Distance distance
[ Units unit ]
[ Type { Spherical | Cartesian } ]
[ Data column = expression [ , column = expression ... ] ]
intotable is a string representing the table that the new values are copied to.
angle is a value representing the angle which to offset the selected objects.
distance is a number representing the distance to offset the selected objects.
unit is the distance unit of distance.
column is a string representing the column on which to perform the offset.
expression is an expression to calculate the offset for the column.
Description
Objects Offset makes a new copy of objects offset from the original source objects. The source objects are obtained from the current selection. The resulting objects are placed in the intotable, if the Into clause is present. Otherwise, the objects are placed into the same table as the input objects are obtained from (for example, the base table of the selection).
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 the unit parameter. 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.
If you specify a Data clause, the application performs data aggregation.
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 Offset Into Table c:\temp\table1.tbl Angle 45 Distance 100 Units
"mi" Type Spherical
See Also:
Offset() function