lbs - Mysql POINT类型数据,怎么计算经纬度偏差
高洛峰
高洛峰 2017-04-17 16:17:04
0
2
633

使用新的point类型存储经纬度,现在要将GPS坐标转换成bd坐标,需计算其两值偏差,如果单独拿出经度、纬度计算的话不能完整的利用数据库的索引,如果直接使用point类型计算其经纬度差值,需要用什么方法?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
黄舟

Thank you for paying attention to the answer;
After studying the official MySql document (starting from 5.7 Chapter 13, Section 15, page 1752), there are many functions related to geographical location and space available, such as the ST_Distance function reminded on the first floor, and ST_Intersects() to calculate two Points have the same attributes. ST_Difference() calculates different attributes of two points. Does ST_Buffer() calculate the deviation?
After trying a lot, it still doesn’t work. Then I studied the official PostGis documentation (version 2.3, starting from Chapter 14, page 685). It seems that there are more support functions. I saw ST_Summary and wanted to directly add the deviation value and convert the GPS coordinates to bd, but, This

mysql> SELECT ST_Summary(point(3,4),POINT(4,5));
ERROR 1305 (42000): FUNCTION ST_Summary does not exist
ERROR:  function st_summary(point, point) does not exist
LINE 1: SELECT ST_Summary(point(3,4),POINT(4,5));
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

It makes me very sad

Come back to the OpenGIS documentation. This one does not introduce general functions. It basically introduces how to use it. I then went back to study the built-in functions of PostGIS, which were imported directly using the sql file during installation. In the end, I concluded that I would write a function by myself. Maybe It’s faster, there’s no need to use this!

洪涛

Thanks for the invitation, I am not very familiar with itpoint. I did a rough search of the information. I hope it will be helpful to you. Portal

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!