Documentation Home
MySQL 5.6 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 31.4Mb
PDF (A4) - 31.4Mb
PDF (RPM) - 29.8Mb
HTML Download (TGZ) - 7.5Mb
HTML Download (Zip) - 7.5Mb
HTML Download (RPM) - 6.4Mb
Man Pages (TGZ) - 177.2Kb
Man Pages (Zip) - 287.5Kb
Info (Gzip) - 3.0Mb
Info (Zip) - 3.0Mb
Excerpts from this Manual

11.5.2.9 MultiPoint Class

A MultiPoint is a geometry collection composed of Point elements. The points are not connected or ordered in any way.

MultiPoint Examples

  • On a world map, a MultiPoint could represent a chain of small islands.

  • On a city map, a MultiPoint could represent the outlets for a ticket office.

MultiPoint Properties

  • A MultiPoint is a zero-dimensional geometry.

  • A MultiPoint is simple if no two of its Point values are equal (have identical coordinate values).

  • The boundary of a MultiPoint is the empty set.


User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
  Posted by ALEXANDER SKAKUNOV on March 26, 2013
Re comparing equality of 2 points.

Although that sounds easy, it can be counter-intuitive. The problem is the precision of coordinates. For example, in our project ( http://dobrotvor.com/ ) we bumped into this due to the fact that the precision of geo coordinates incapsulates the zoom value of Google Maps points. It's not right just to compare (X1 == X2) AND (Y1 == Y2) since the results can be wrong in many cases.

To make it work right, it's better to use special function (couldn't find anything better built-in):

[code]
DELIMITER //

DROP FUNCTION IF EXISTS ArePointsEqual; //
CREATE FUNCTION ArePointsEqual(p1 POINT, p2 POINT) RETURNS BOOLEAN NO SQL DETERMINISTIC
BEGIN
RETURN IsZero(X(p1) - X(p2)) AND IsZero(Y(p1) - Y(p2));
END; //

DROP FUNCTION IF EXISTS IsZero; //
CREATE FUNCTION IsZero(n DOUBLE) RETURNS BOOLEAN NO SQL DETERMINISTIC
BEGIN
DECLARE epsilon DOUBLE DEFAULT 0.00000000001;
RETURN (ABS(n) <= epsilon);
END; //
[/code]

The trick is not to use 0 as "zero value", but to use a very small difference (called "epsilon") instead for comparison.
  Posted by Shane Bester on December 8, 2013
The above IsZero function is needed due to the explanations give in the manual:
http://dev.mysql.com/doc/refman/5.6/en/problems-with-float.html
Sign Up Login You must be logged in to post a comment.