Point クラス

Point は、座標空間内の単一の位置を表す幾何図形です。

Point の例

  • 多数の都市を含む大規模な世界地図を想像してください。Point オブジェクトは各都市を表すことができます。

  • 市内地図で、Point オブジェクトはバス停を表すことができます。

Point のプロパティー

  • X 座標値。

  • Y 座標値。

  • Point は 0 次元の幾何図形として定義されています。

  • Point の境界は空セットになります。

Download this Manual
EPUB - 7.5Mb
HTML Download (TGZ) - 7.1Mb
HTML Download (Zip) - 7.2Mb
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:

> 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.