How to find the centroid of some points on map?

조회 수: 11 (최근 30일)
Aqua22
Aqua22 2015년 5월 28일
댓글: Aqua22 2015년 5월 29일
I have a set of points on map whose latitude and longitudes are known to me. Points form an L shape or cross shape to be particular. I want to know the lat-lon of the centroid of these points. How can I find that?

답변 (1개)

Image Analyst
Image Analyst 2015년 5월 28일
Using your known latitutes and longitudes of your known set of points, you can get a spatial calibration - it's just a simple line formula if your map does not cover much curvature of the earth.
Then use ginput() to have the user select the points, and plug the x,y into your formulas to get the actual latitude and longitude. It's just simple algebra. Really.
  댓글 수: 3
Image Analyst
Image Analyst 2015년 5월 29일
Oh, okay. Why can't you just take the mean of the x and y values to get the average (centroid) location?
Aqua22
Aqua22 2015년 5월 29일
Yes, that's what I did. Got the solution.

댓글을 달려면 로그인하십시오.

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by