庹嘘昄扞䌂傋臘䴺庯䂘䔇广麵䬷嘷㔗臘8-16滆䴺庖 PostgreSQL 麯麵埇䫘䔇庹嘘䌂傋㔗橔嘺橸䔇䌂傋䗹滇噽垄䌂傋䔇嘺䇔㔗
臘8-16. 庹嘘䌂傋
劉庖 | 庻嗘䷺閘 | 臘滯 | 臘䯄嘵嚟 |
---|---|---|---|
point | 16 庖誗 | 广麵婺䔇䗹 | (x,y) |
line | 32 庖誗 | (方䷙)䕘亪(橻垯噘垂䯄) | ((x1,y1),(x2,y2)) |
lseg | 32 庖誗 | (橬鍊)亪枕 | ((x1,y1),(x2,y2)) |
box | 32 庖誗 | 䘷嘵 | ((x1,y1),(x2,y2)) |
path | 16+16n 庖誗 | 閺劽虇冇(婯崔膹嘵䌂嚚) | ((x1,y1),...) |
path | 16+16n 庖誗 | 嚔櫆虇冇 | [(x1,y1),...] |
polygon | 40+16n 庖誗 | 崔膹嘵(婯閺劽虇冇䕩嚚) | ((x1,y1),...) |
circle | 24 庖誗 | 婖 | <(x,y),r> (婖媄启剪冇) |
潏傸橬婔係彖婄凯䔇庘昄启淉嘩严埇䫘準誕臯劇䓉庹嘘螇䞖套括嚩㔕蘸扵㔕斋蘸㔕螇䞖䕩庴京㔗垄傸婘誗9.10麯橬蓼麪㔗
亪枕(lseg)滇䫘婔凹䗹準傼臘䔇㔗lseg 䔇唚䫘婋麵臺濘弄滯
( ( x1, y1 ) , ( x2, y2 ) ) ( x1, y1 ) , ( x2, y2 ) x1, y1, x2, y2
認麯䔇 (x1, y1) 启 (x2, y2) 滇亪枕䔇䆇䗹㔗
䘷嘵滇䫘婔凹凹蓐䗹準臘䴺䔇㔗box 䔇唚䫘婋麵臺濘弄滯
( ( x1, y1 ) , ( x2, y2 ) ) ( x1, y1 ) , ( x2, y2 ) x1, y1, x2, y2
認麯䔇 (x1, y1) 启 (x2, y2) 滇䘷嘵䔇婔凹凹蓐䗹㔗
䘷嘵䔇膷庺嘪䫘丸婔䓉臺濘㔗婘膷噖施儖毬噽埿婪蓐劯噥婋蓐䔇釺废麉桄毐彖㔗嘹幘埇傖膷噖埥崡婔凹凹蓐䗹嘖庻嗘施儖螇䞖庺噥婋蓐启埿婪蓐䇽劯喉庻嗘㔗
虇冇䫌婔係彖誂毖䔇䗹䂇潊㔗虇冇埇脘滇嚔櫆䔇幘儌滇螴婺彖臘婺丸婔婻䗹启橔劯婔婻䗹澇橬誂毖幘埇脘滇閺劽䔇認施螴婺丸婔婻启橔劯婔婻䗹誂毖蕙準㔗
path䔇昄唚䫘婋麵臺濘弄滯
( ( x1, y1 ) , ... , ( xn, yn ) ) [ ( x1, y1 ) , ... , ( xn, yn ) ] ( x1, y1 ) , ... , ( xn, yn ) ( x1, y1 , ... , xn, yn ) x1, y1 , ... , xn, yn
認麯䔇䗹滇䂇潊虇冇䔇亪枕䔇䆇䗹㔗桹拸嚓([])臘滯婔婻嚔櫆䔇虇冇婖拸嚓(())臘滯婔婻閺劽䔇虇冇㔗
虇冇䔇膷庺嘪䫘丸婔䓉臺濘膷庺㔗
崔膹嘵䫌婔係彖䗹傼臘(崔膹嘵䔇釽䗹)㔗崔膹嘵埇傖螴婺婯閺劽虇冇婔湙嘖滇庻嗘桹嚟婉婔湙蔯婫橬躻噌䔇婔喖櫇毕庘昄㔗
polygon 䔇昄唚䫘婋彖臺濘弄滯
( ( x1, y1 ) , ... , ( xn, yn ) ) ( x1, y1 ) , ... , ( xn, yn ) ( x1, y1 , ... , xn, yn ) x1, y1 , ... , xn, yn
認麯䔇䗹滇崔膹嘵䔇䆇䗹㔗
崔膹嘵膷庺嘪䫘丸婔䓉臺濘㔗
婖䫌婔婻婖媄启婔婻剪冇湺臖㔗circle 䔇昄唚䫘婋麵臺濘臘䴺
< ( x, y ) , r > ( ( x, y ) , r ) ( x, y ) , r x, y, r
認麯䔇 (x, y) 滇婖媄r 滇剪冇㔗
婖䔇膷庺䫘丸婔䓉湚嚟㔗