MATLAB Answers

extract point data from plot

1 view (last 30 days)
zheng on 10 Mar 2011
Is it possible to program a function which can extract point data from plot? In my case, I have 2D coordinates data point(over 300k) that come from road network. Based on original information, I only have easting and northing for each point. When they are plotted in figure, the approximate road network geometry can be shown. is there any suggestion how to identify which point data are belong to same road?
for instance, all points belong to the same road will be assigned a value (1 to n)
at the end, those values will be added into orignal data table as third column.
Many thanks

Answers (1)

Walter Roberson
Walter Roberson on 10 Mar 2011
If you were to grid the data in the manner I discussed in response to your other question and were to convert that to binary, then you would be able to use tools such as bwlabel() to find connected rounds. You have a difficulty, though, in identifying which road continues where when roads cross.
It seems to me that it should be possible to imdilate() with a kernel that separated lines at places that had more neighbours (e.g., roads crossing or joining)... though I am having difficulty thinking of an appropriate kernel. Perhaps imerode() thin lines leaving only the places with higher connectivity, find those places in the binary map and zero them out, and then bwlabel what remains.

Community Treasure Hunt

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

Start Hunting!

Translated by