資源簡(jiǎn)介
在GIS領(lǐng)域,拓?fù)洌╰opology)算法是一個(gè)很重要的算法。它把平面上的線段、折線,自動(dòng)連接成網(wǎng)絡(luò),進(jìn)而構(gòu)成封閉的區(qū)域。 從而形成面和面之間、面和線之間、線和結(jié)點(diǎn)之間等各種空間關(guān)系。 通過(guò)這個(gè)算法,可以把給定區(qū)域內(nèi)的線的集合構(gòu)成網(wǎng)絡(luò)或面,因此拓?fù)涫菙?shù)據(jù)處理、空間分析領(lǐng)域的一個(gè)極為重要的運(yùn)算工具。幾乎所有的重要的GIS系統(tǒng)都提供這樣的算法。然而即使是最出名的系統(tǒng),提供的算法僅是讓用戶使用而已。本文根據(jù)作者多年的經(jīng)驗(yàn),總結(jié)出這樣一套C語(yǔ)言的算法,不敢說(shuō)是目前出現(xiàn)的最好的算法,起碼在互聯(lián)網(wǎng)上,搜索不到比這個(gè)更精煉和優(yōu)美的算法實(shí)現(xiàn)。
代碼片段和文件信息
/****************************************************************************************
?*?list.c???????????????????????????????????????????????????????????????????????????????*
?* Generic?sequential?linked?list?node?structure?--?can?hold?any?type?data.????????*
?* cheungmine??????????????????????????????????????????????????????????????????????*
?*??????Mar.?22?2008.??All?rights?reserved.????????????????????????????????????????????*
?****************************************************************************************/
#include?“l(fā)ist.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
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????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
評(píng)論
共有 條評(píng)論