MATLAB Answers


comparing two data sets and extract specific data from one of them

Asked by bero latef on 21 Aug 2019
Latest activity Commented on by bero latef on 21 Aug 2019
Accepted Answer by KSSV
Hello everyone i am working on geodata of railway tracks and i have two files now in shape format and i am reading that normally and plotting that normaly, what i am asking for now i have tunnel data which represented by lines and i have the track data which represented with more than one track so i need to extract from the track data the real tracks which is pathing through a tunnel.
please see the attached photo for clear understanding , the blue lines represent the the track data and the red lines represent the tunnel data , what i need the two blue line which is pathing through that tunnel to be extracted in different data set, thats only an example the data set really large.
Thanks and regards Tunnel and tracks.PNG


Sign in to comment.




1 Answer

Answer by KSSV
on 21 Aug 2019
Edited by KSSV
on 21 Aug 2019
 Accepted Answer

YOu can make your blue lines a closed polygon.......and use inpolygon to get the points lying inside and on the blue lines. Read about inpolygon.


thanks for your reply but the blue lines are railway tracks lines , i just crop the photo to see it, its very long lines of whole germany so its not just that line. I know about inpolygon it needs only closed shape to use it.
So thanks for your reply.
Use knnsearch ..get the distance and decide..
Any other idea because machine learning toolbox not available in my matlab license

Sign in to comment.