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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Since MySql 5.1 there are provided GIS functions distance_sphere() and distance_spheroid() functions. There is an explanation of the parametres and how to use them.
The length that is returned by GLength() function can be in either unit the coordinates have. So if the coordinates are in terms of degree there is no meaning of a length metric in degrees. To fix this problem the projections are used.
For WGS84 projection SRID = 4326 but for Spherical Mercator projection, SRID = 900913, which is compatible with the projection used by Google Maps. Spherical Mercator projection Mercator projection uses meters so the GLength function will return the length in terms of meters. This passage is helpful for projections in MySql.