用于ST_Distance_Spheroid的MySQL GeoSpatial函数?用于回报的度量GLength的类型? [英] MySQL GeoSpatial function for ST_Distance_Spheroid? Metric used in return Type of GLength?

查看:764
本文介绍了用于ST_Distance_Spheroid的MySQL GeoSpatial函数?用于回报的度量GLength的类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



  • 在MySQL的GeoSpatial Support中是否有一个ST_Distance_Sphere,ST_Distance_Spheroid等价函数?

  • 在GLength的返回类型(LineString的长度)中使用的度量是什么? GLength 表示GLength()是非标准名称。它对应于OpenGIS Length()函数。但我找不到OpenGIS Length()的任何Docs。我发现的所有内容都是 ST_Length 它们是否一样?





  • 为了准确,我需要指定SRID(4326)吗?如何在MySQL中执行此操作?




解决方案

由于MySql 5.1提供了GIS函数 distance_sphere() distance_spheroid()函数。有一个参数说明以及如何使用它们。

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

对于WGS84投影SRID = 4326,但对于球面墨卡托投影,SRID = 900913,它与Google地图使用的投影兼容。球形墨卡托投影墨卡托投影使用米,所以GLength函数将以米为单位返回长度。 这一段对MySql中的预测很有帮助。


  • 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?

解决方案

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.

这篇关于用于ST_Distance_Spheroid的MySQL GeoSpatial函数?用于回报的度量GLength的类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆