How Do I Calculate the Area of a Polygon in a MySQL Database When the Polygon's Points are Lat Longs?

痞子三分冷 提交于 2019-12-05 11:37:59

You've got to transform those lats and lons into a more appropriate coordinate system.

Since the earth is a sphere, you're talking about calculating an area in spherical coordinates.

The docs say that the MySQL "AREA" function takes a polygon as its input. I would say that if you want area as something like square miles you should convert your lat/lon coordinates into equivalent surface (x, y) coordinates with the right units (e.g., miles). Then pass those into the AREA function.

This link suggests that someone else has had this problem and solved it.

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