資源簡介
在GIS領域,拓撲(topology)算法是一個很重要的算法。它把平面上的線段、折線,自動連接成網絡,進而構成封閉的區域。 從而形成面和面之間、面和線之間、線和結點之間等各種空間關系。 通過這個算法,可以把給定區域內的線的集合構成網絡或面,因此拓撲是數據處理、空間分析領域的一個極為重要的運算工具。幾乎所有的重要的GIS系統都提供這樣的算法。然而即使是最出名的系統,提供的算法僅是讓用戶使用而已。本文根據作者多年的經驗,總結出這樣一套C語言的算法,不敢說是目前出現的最好的算法,起碼在互聯網上,搜索不到比這個更精煉和優美的算法實現。
代碼片段和文件信息
/****************************************************************************************
?*?list.c???????????????????????????????????????????????????????????????????????????????*
?* Generic?sequential?linked?list?node?structure?--?can?hold?any?type?data.????????*
?* cheungmine??????????????????????????????????????????????????????????????????????*
?*??????Mar.?22?2008.??All?rights?reserved.????????????????????????????????????????????*
?****************************************************************************************/
#include?“list.h“
void?
list_traverse(list_t?*in_list?pfunc_list_callback?pfcb)
{
listnode_t*?node;
if?(pfcb)?{
node?=?in_list->head;
while?(node)?{
(*pfcb)(node);
node?=?node->next;
}
}
}
list_t*?
list_create()
{
list_t *li
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????6284??2008-11-08?16:05??topo\list.c
?????文件???????4454??2008-11-08?16:05??topo\list.h
?????文件??????28350??2009-05-10?13:20??topo\rtree_2d.c
?????文件???????6366??2008-07-21?15:42??topo\rtree_2d.h
?????文件???????2352??2008-07-15?11:55??topo\test.c
?????文件???????5019??2010-05-12?10:59??topo\test_topo\test.c
?????文件????????882??2008-07-19?10:45??topo\test_topo\test_topo.sln
????..A..H.?????13312??2010-06-25?20:35??topo\test_topo\test_topo.suo
?????文件???????4365??2008-07-21?15:43??topo\test_topo\test_topo.vcproj
?????目錄??????????0??2010-06-25?20:36??topo\test_topo
?????文件??????32753??2008-12-27?14:01??topo\topo.c
?????文件???????6203??2008-08-02?16:40??topo\topo.h
?????文件??????57506??2008-07-27?23:49??topo\topo.lin
?????文件???????2116??2009-05-23?11:14??topo\unistd.h
?????目錄??????????0??2009-05-23?11:14??topo
-----------?---------??----------?-----??----
???????????????169962????????????????????15
- 上一篇:C鏈表實現一元多項式的相加
- 下一篇:最短哈密頓回路算法C語言實現
評論
共有 條評論