Documentation Home
MySQL 5.6 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 30.9Mb
PDF (A4) - 31.0Mb
PDF (RPM) - 30.2Mb
EPUB - 7.7Mb
HTML Download (TGZ) - 7.5Mb
HTML Download (Zip) - 7.6Mb
HTML Download (RPM) - 6.5Mb
Eclipse Doc Plugin (TGZ) - 8.2Mb
Eclipse Doc Plugin (Zip) - 10.1Mb
Man Pages (TGZ) - 181.3Kb
Man Pages (Zip) - 292.4Kb
Info (Gzip) - 2.9Mb
Info (Zip) - 2.9Mb
Excerpts from this Manual

11.5.2.3 Point Class

A Point is a geometry that represents a single location in coordinate space.

Point Examples

  • Imagine a large-scale map of the world with many cities. A Point object could represent each city.

  • On a city map, a Point object could represent a bus stop.

Point Properties

  • X-coordinate value.

  • Y-coordinate value.

  • Point is defined as a zero-dimensional geometry.

  • The boundary of a Point is the empty set.


User Comments
  Posted by kristof kotai on June 21, 2012
set @p = GeomFromText('POINT(11 0)');
select x(@p), y(@p);
  Posted by ALEXANDER SKAKUNOV on March 21, 2013
Alternative to POINT data type is 2 simple float fields, "x" and "y", or "latitude" and "longitude" (an approach that we used in our http://astuce.com.ua/ project). It has its own benefit in search speed.

To speed up the spatial data lookup, a spatial index can be used, but you are forced to switch to MyISAM tables to be able to use it, which is not a case if you love InnoDB's foreign keys...

So a solution is 2 float fields + a separate index on them. This approach allows to easily filter points by a square of a desired size:

> SELECT *
> FROM city
> WHERE city.lat BETWEEN @x-0.5 AND @x+0.5
> AND city.lng BETWEEN @y-0.5 AND @y+0.5;

That's is much faster.
Sign Up Login You must be logged in to post a comment.