Do a union of polygons and add the associated values for overlapping coordinates

조회 수: 5 (최근 30일)
I have 6 matrices of lat, Lon and power values. 3 of them have the same size for lat, lon and power. The other 3 have the same matrix size for lat, lon and power. But different size from the other coordinates. So they both form a polygon would power values but one polygon is bigger and there some overlap. I wanted to do a union between the coordinates and where ever the lat and lon overlap, add the power values together.Since the data are matrices, I tried to convert them into vectors to do a polyshape of lats and lons and do a union after. But that does not seem to work. Well I don’t know for sure because one of the matrices is too big and took forever to be converted into a vector.
Poly1 =polyshape(lat1,lon1); Poly2 = polyshape(lat2,lon2); polyout =union(Poly1,Poly2);
Since polyshape function does not take a 3rd variable I have not figured how to add the power values together for overlapping coordinates. Is there any other approach I can take to achieve that.
  댓글 수: 5
Mini Me
Mini Me 2022년 3월 17일
편집: Mini Me 2022년 3월 17일
Thanks for your answer. I added union(pgon) as well. But it takes forever to run.

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

답변 (0개)

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by