MySQL GeoSpatial function for ST_Distance_Spheroid? Metric used in return Type of GLength?

ぃ、小莉子 提交于 2019-12-23 02:58:20

问题


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



来源:https://stackoverflow.com/questions/11492294/mysql-geospatial-function-for-st-distance-spheroid-metric-used-in-return-type-o

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!