Set Distance Units 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

Sets the distance unit used for subsequent geographic operations, such as the Create Object statement. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Set Distance Units unit_name

unit_name is the name of a distance unit (for example, "m" for meters).

Description

The Set Distance Units statement sets MapBasic's linear unit of measure. By default, MapBasic uses a distance unit of "mi" (miles); this distance unit remains in effect unless a Set Distance Units statement is issued. Some MapBasic statements take parameters representing distances. For example, the Create Object statement's Width clause may or may not specify a distance unit. If the Width clause does not specify a distance unit, the Create Object statement uses the distance units currently in use (either miles or whatever units were set by the latest Set Distance Units statement).

The unit_name parameter must be one of the values from the table below:

unit_name value Unit Represented
"ch" chains
"cm" centimeters
"ft" feet (also called International Feet; one International Foot equals exactly 30.48 cm)
"in" inches
"km" kilometers
"li" links
"m" meters
"mi" miles
"mm" millimeters
"nmi" nautical miles (1 nautical mile represents 1852 meters)
"rd" rods
"survey ft" U.S. survey feet (used for 1927 State Plane coordinates; one U.S. Survey Foot equals exactly 12/39.37 meters, or approximately 30.48006 cm)
"yd" yards