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

2 vues (au cours des 30 derniers jours)
Mini Me
Mini Me le 14 Mar 2022
Commenté : Juan Jiménez le 29 Mai 2025
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 commentaires
Mini Me
Mini Me le 17 Mar 2022
Modifié(e) : Mini Me le 17 Mar 2022
Thanks for your answer. I added union(pgon) as well. But it takes forever to run.

Connectez-vous pour commenter.

Réponses (0)

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by