Graph with undirected edges from Shapefile

I want to use two shapefiles containing:
  1. Streets as 'Lines', with x and y coordinates, streetnames, length, etc.
  2. Road Nodes as 'Points', with x and y coordinates, nodenames, ...
How do I combine those shp Files an create a Graph with undirected edges?
I can load them both into Matlab and display them using mapshow():
Any help would be incredible!

댓글 수: 1

Sim
Sim 2022년 7월 6일
편집: Sim 2022년 7월 6일
A starting point
S1 = shaperead(('BKM_point.shp'));
S2 = shaperead(('ABSCHNITTEAESTE_line.shp'));
hold on
for i = 1 : size(S1,1)
plot(S1(i).X, S1(i).Y,'Color','k','Marker','o','MarkerSize',3)
end
for i = 1 : 2000 % I put "2000" instead of "size(S2,1)" since too large
plot(S2(i).X, S2(i).Y,'Color','b','Marker','o','MarkerSize',3)
end
hold off
Here,
S1.X
S1.Y
are the nodes coordinates for "BKM_point.shp", and
S2.X
S2.Y
are the nodes coordinates for "ABSCHNITTEAESTE_line.shp", but
where is the information about the edges ??

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

질문:

2021년 2월 9일

편집:

Sim
2022년 7월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by