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


How do I calculate the area of ​​a polygon stored in a MySQL database? Pieces of polygon are long long. Therefore, there is a problem in degree and minute.

I tried:

  `my_table` from SELECT AREA (my_polygon) where name = 'newport'  

because, Points are long, I get strange results.

(I can not switch to Postgrowth). Is there a way to do this in MySQL? I want to get results in square meters or square km or square mile - none of these will be fine.

You have to change those latters and be long in the more appropriate coordination system.

Since the earth is a spherical, so you are talking about calculating an area in spherical coordinates.

Documents say that MySQL takes a polygon as its input, I would say that if you want something like square mile to area then you have the equivalent surface of your latitude / long coordinate (x, y ) Should coordinate with the right units (like miles). Then pass those areas in the array function.

It suggests that someone has faced this problem and has solved it.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -