ST_Distance_Spheroid 的 MySQL GeoSpatial 函数?返回 GLength 类型时使用的指标?

标签 mysql geolocation geospatial latitude-longitude geo

  • Is there a ST_Distance_Sphere, ST_Distance_Spheroid equivalent function in MySQL's GeoSpatial Support?

  • If not, any way to emulate this?


  • What is the metric used in return type of GLength (length of the LineString)?

  • The manual for GLength says that GLength() is a nonstandard name. It corresponds to the OpenGIS Length() function. But I couldn't find any Docs for OpenGIS Length(). All I found was for ST_Length are they the same?


  • Also for accuracy do I need to specify the SRID(4326)? How Do I do this in MySQL?

最佳答案

从 MySql 5.1 开始,提供了 GIS 函数 distance_sphere()distance_spheroid() 函数。有一个 explanation的参数以及如何使用它们。

GLength() 函数返回的长度可以采用坐标所具有的任一单位。因此,如果坐标以度为单位,则以度为单位的长度度量没有任何意义。为了解决这个问题,使用了投影。

对于 WGS84 投影 SRID = 4326 但对于球形墨卡托投影,SRID = 900913,这与 Google map 使用的投影兼容。球面墨卡托投影墨卡托投影使用米,因此 GLength 函数将返回以米为单位的长度。 This passage 有助于在 MySql 中进行投影。

关于ST_Distance_Spheroid 的 MySQL GeoSpatial 函数?返回 GLength 类型时使用的指标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11492294/

相关文章:

mongodb - $geoNear - mongodb 聚合中的 $maxDistance 不起作用

php - 使用 PHP 给出日期,使用 SQL 获取数据

mysql - 这是一个 t sql 存储过程吗

mysql - SUBSTRING_INDEX 获取第 n 个值

php - 如何计算 my_sql

c# - 如何找到距某个点 X 距离的经纬度?

algorithm - 给定 n 个重叠的多边形,如何以最少的多边形数量获得覆盖范围最大的集合

mysql - 如何正确设置MySql数据库中具有类型点的字段的值?

javascript - meteor JS : Display Posts with locations within x miles of current location

java - 如何查询postgres数据库以获取特定坐标10公里半径内的所有点