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

1 view (last 30 days)
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.
Mini Me
Mini Me on 17 Mar 2022
Edited: Mini Me on 17 Mar 2022
Thanks for your answer. I added union(pgon) as well. But it takes forever to run.

Sign in to comment.

Answers (0)


Find more on Creating and Concatenating Matrices in Help Center and File Exchange




Community Treasure Hunt

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

Start Hunting!