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/