MapInfo Pro supports two ways to perform calculations of area and length/distance:
You configure this in the Map Preferences dialog on the Projection tab.
Spherical
Spherical calculations are used for distance methods, which attempt to keep the measurement on the curved surface of the earth. The data is first converted to Latitude/Longitude, and then a calculation is produced. Non-Earth projections cannot use spherical calculations.
Cartesian
Cartesian methods are used to perform calculations on data projected onto a flat plane. Cartesian coordinates are a pair of numbers, (x, y), defining the position of a point in a two-dimensional space by its perpendicular projection onto two axes which are at right angles to each other. Long/Lat projections cannot use Cartesian calculations.
Which Calculation Method to Use
From the above, we can draw these two conclusions:
- For Non-earth projections, use Cartesian calculations
- For Long/Lat projections, use Spherical calculations.
Glad to get those sorted and out of the way.
So, that only leaves us with a single remaining projection type: Projected.
For this projection type, which probably includes most projections, I would recommend using Cartesian calculations. I would love to hear when you are using Spherical calculation for projected coordinate systems.
If you, by mistake, use a calculation method that isn't supported for the projection you are using, the measurement will return the value -1.
As the preference controls the default behaviour, I would recommend setting it to the calculation method that you will use most of the time.
MapBasic Measurement Functions
When using MapBasic Measurement Functions, you need to use the specific type, too.
Most of the functions come in 3 versions. Let's look at area calculation as an example.
-
Area(): For the most part, MapInfo Pro performs a Cartesian or Spherical operation. Generally, a spherical operation is performed unless the coordinate system is NonEarth, in which case, a Cartesian operation is performed.
-
SphericalArea(): The SphericalArea() function will always return the area as calculated in a Latitude/Longitude non-projected coordinate system using spherical algorithms. A value of -1 will be returned for data that is in a NonEarth coordinate system since this data cannot be converted into a Latitude/longitude coordinate system.
-
CartesianArea(): The CartesianArea() function will always return the area using a cartesian algorithm. A value of -1 will be returned for data that is in a Latitude/Longitude since the data is not projected
All these measurement functions come in all three versions:
Area()
ObjectLen()
Perimeter()
Distance()
ObjectDistance()
Similarly, you can find several functions modifying spatial objects supporting these three versions: OffsetXY() and Buffer() to name a few.
Which calculation method are you using and why?
Happy #MapInfoMonday!
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------