How to evalutate AREA from connected points?

3 次查看(过去 30 天)
I have a group of points and their connectivity matrix (how the points are connected, actually I'm working on a water network). I need to evaluate all the areas between all the lines (you can see the example picture). I've found different functions but I don't know if there is something more specific. I thought first to create polygons and then to evaluate the area but I don't know how to create polygons using the connectivity matrix.
The image above represents my points as a graph
  2 个评论
Veronica Taurino
Veronica Taurino 2017-8-30
编辑:Veronica Taurino 2017-8-30
Hi, thank you.
I've seen it before but I don't know how to use it in my case. I have 2 matrices: 1) the first one identified the points of my net (x, y coordinates for each point); 2) the second one has connecvity matrix, it means 3 columns: the first 2 columns defined the 2 linked nodes, the third column define the distance between them.
To use 'patch' I should reorder my points and I can't do it manually, they are 20'000 nodes. Moreover now I can just SEE the network (points connected with lines, using the connectivity matrix) but I have no information on the 'closed shape' defined, that means you see them but you can't interact with them (they are just lines, not polygons).
My net is very big (20'000 nodes) so I need to find a way to do everything with code.

请先登录,再进行评论。

采纳的回答

Veronica Taurino
Veronica Taurino 2019-11-26
编辑:Veronica Taurino 2021-2-25
Back then I solved my problem with a second software: I used ArcGIS!
Thank you for all your suggestions, it helped me to change my PoV on the matter.

更多回答(2 个)

Guillaume
Guillaume 2017-8-30
There are a fair number of graph analysis functions that were introduced in R2015b, I'm not sure any of them are that useful for your purpose though.
The main difficulty will be to identify the smallest polygons created by your graph. I'm not sure how you'd do that. It's probably been done before so I would search the literature. Once you have identified the polygons, calculating their area is done with polyarea.
  5 个评论
Veronica Taurino
Veronica Taurino 2017-8-31
编辑:Veronica Taurino 2017-8-31
Have you got any suggestions about free alternative? Thank you
José-Luis
José-Luis 2017-9-1
If you want a GUI, then probably GRASS or SAGA.

请先登录,再进行评论。


John D'Errico
John D'Errico 2017-8-31
编辑:John D'Errico 2017-8-31
It is often true that what looks easy to the eye/brain is not so trivial do do by computer. And even if it may be easy, but if nobody else ever identifies a need to do that, then somebody will need to write the code for it. I've never seen anyone else asking for this, so what do you expect?
I'd suggest a simple algorithm.
1. Identify any nodes that have only one edge that touches them. This will prune away all edges that cannot belong to any polygon. Repeat this step if new nodes appear that connect to only one other node.
2. Find any closed polygon. Does that polygon have any nodes that branch off internally into the polygon? If so, then unless that branch terminates, then you can split the polygon into smaller polygons. Repeat the dissection on each piece recursively, until all polygons are minimal. Now find another polygon, one that does not include those you have already found. (This last part may be the least easy.)
Another simple scheme:
0. Maintain a list of all polygons that have been found so far. The list will be empty to start.
1. Identify any nodes that have only one edge that touches them. This will prune away all edges that cannot belong to any polygon. Repeat this step if new nodes appear that connect to only one other node.
2. Pick any point at random in the domain. Does it belong to a polygon that is in our list? If not, then any ray that extends from the point will intersect some edge of the enclosing polygon. Follow that polygon, going in a consistent direction (clockwise, for example.) When the polygon closes on itself, add it to the list of identified minimal polygons.
Repeat step 2 until the sum of all identified polygonal areas is the total area. You are now done.
I'm sure I can think of other heuristics that will be workable.
  1 个评论
Veronica Taurino
Veronica Taurino 2017-8-31
编辑:Veronica Taurino 2021-2-25
My problem actually is HOW identify polygons with matlab: I have 15'000 nodes and 19'000 links, how can I detect them with matlab? I can't do it manually of course.
As I said, I'm using this now: https://it.mathworks.com/matlabcentral/fileexchange/10722-count-loops-in-a-graph
the problem is the huge amount of loops, it's been 24 hours of elaborations now, maybe it's the wrong way to do it

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by