梦见挖红薯是什么意思| 气胸什么症状| 什么烟好抽又便宜| 总是出汗是什么原因| 睾丸疼痛什么原因| 肺部有阴影是什么原因| 血糖偏高可以吃什么水果| 干咳嗽喉咙痒是什么原因| 本命年犯太岁什么意思| 散片是什么意思| 吃什么排湿气最好最快| 阳绿翡翠属于什么级别| 什么是热伤风| 贫血吃什么补血| 摊手是什么意思| 治字五行属什么| 生肖马和什么生肖最配| 葛粉吃了有什么好处| 血尿酸偏高是什么原因| 马华念什么字| 中学为体西学为用是什么意思| 8朵玫瑰花代表什么意思| 阳历12月是什么星座| 金益什么字| 防字代表什么生肖| 5点至7点是什么时辰| 升米恩斗米仇什么意思| 爱是什么歌曲| 梦见很多坟墓是什么意思| 梦见老公回来了是什么征兆| 根是什么生肖| 左边头疼是什么原因怎么办| 狗头是什么意思| 15度穿什么衣服| 硬脂酸镁是什么| 九月29号是什么星座| 登高是什么意思| 夹生是什么意思| 囟门闭合早有什么影响| 心衰什么症状| 中国的四大发明是什么| 人面桃花相映红是什么意思| 森林里有什么| 金字旁乐读什么| 摩羯座女和什么座最配| 鼻窦炎有什么特效药| 17岁属什么| 空调嗡嗡响是什么原因| 鼻子两侧毛孔粗大是什么原因造成的| 东北方向五行属什么| 1.4什么星座| 男生小便尿道刺痛什么原因| 仁字五行属什么| 怀孕什么时候建档| 印度人口什么时候超过中国| 月经期间头疼是什么原因| 脖子痛什么原因| 黯然泪下是什么意思| 甲木命是什么意思| 早上右眼跳是什么预兆| 健脾益气是什么意思| 霸王硬上弓什么意思| 力挺是什么意思| 口引念什么| 谪仙是什么意思| 脉数是什么意思| 牙龈疼是什么原因| 东坡肉是什么菜系| 4a广告公司什么意思| 每天喝柠檬水有什么好处| xo什么意思| 伤口出水是什么原因| 腹部b超可以检查什么| 用什么可以解开所有的谜| 郁结是什么意思| 焦虑症吃什么中成药能根治| 非什么意思| 四方八面是什么生肖| 女儿取什么名字好听| 肚子疼是什么原因一阵一阵的| 咳嗽吃什么食物好得快| 上呼吸道感染是什么病| 什么叫外阴白斑| 栀子花什么时候开花| 为什么人会打喷嚏| 葡萄代表什么生肖| 面霜什么时候用| 心悸是什么| 跑步大腿痒是什么原因| 为什么会得糖尿病| 梦见狗死了是什么预兆| 牙齿痛吃什么好| 13是什么| 吃秋葵有什么好处| 青少年吃什么钙片有助于长高| 贝字旁的字和什么有关| 右手小拇指发麻是什么原因| 迷糊是什么原因| 竖小拇指什么意思| 卵巢早衰吃什么可以补回来| 结婚8年是什么婚| 牛郎叫什么名字| 三有动物是什么意思| 邪祟是什么意思| 胃酸吃什么药效果最好| 子宫内膜炎症有什么症状| 倒斗是什么意思| conch是什么牌子| 八珍胶囊适合什么人吃| 驾校教练需要什么条件| c反应蛋白是查什么的| 护士资格证有什么用| 点读笔什么牌子好| 血糖高吃什么食物| 甘油三酯低有什么危害| hbcab阳性是什么意思| 不堪入目是什么意思| 米诺地尔搽剂和米诺地尔酊有什么区别| 睡觉后腰疼是什么原因引起的| 周公解梦梦见蛇是什么意思| 老虎属于什么科动物| 春宵一刻值千金什么意思| 红颜知己是什么关系| 补办身份证要带什么| 平顶山为什么叫平顶山| 什么的天山| 北方五行属什么| 胳膊出汗是什么原因| 跳蚤吃什么| 不安腿是什么症状| 什么植物好养又适合放在室内| 痱子粉什么牌子好| 心肌缺血做什么检查能查出来| 子宫偏小是什么原因| 狗狗尾巴溃烂用什么药| 吃榴莲有什么好处| 转氨酶偏低是什么原因| 什么菊花茶降火最好| 女右上眼皮跳是什么预兆| 干涉是什么意思| egfr医学上是什么意思| 徐州有什么好吃的| 口臭什么原因引起的| 雷诺综合症是什么病| 大是什么意思| 梦到捡金子首饰是什么意思| 地米是什么药| 玥字属于五行属什么| 霜和乳有什么区别| 脑瘤有什么症状| 6月26是什么星座| 甲鱼跟什么炖最补| 地级市市委书记是什么级别| 声带白斑是什么病严重吗| 子宫肌瘤伴钙化是什么意思| 青蛙怕什么| cd是什么牌子| 1月30号是什么星座| 象是什么结构的字| 姜枣茶什么季节喝最好| 心脏骤停是什么原因引起的| 辛巳五行属什么| 血脂高可以吃什么水果| dha每天什么时候吃最好| 九月二十三是什么星座| 5月16是什么星座| 什么的东风填词语| joma是什么牌子| 经常中暑的人体内缺什么| 女人喝红酒有什么好处| 陈皮的作用是什么| ff是什么牌子| 宝宝屁多是什么原因| 6月16什么星座| 1938年属什么生肖| 下焦湿热吃什么药| 梦见大蜈蚣是什么预兆| 属虎的生什么属相的宝宝好| 得艾滋病的前兆是什么| 17点到19点是什么时辰| 为什么总是放屁很频繁| 体制内是什么意思| 三点水及念什么| 大同有什么好玩的地方| 什么是纳囊| 小孩吐奶是什么原因| 玻璃五行属什么| 肌肉溶解是什么意思| 肌酸激酶偏高吃什么药| 脉弱是什么原因导致的| 什么叫化疗为什么要化疗| 铁锚是什么意思| 不完全骨折是什么意思| 射手和什么星座最配| 膂力是什么意思| 宝宝大便有泡沫是什么原因| 鳄鱼属于什么动物| 水痘通过什么途径传染| 恶露是什么东西| 抑郁症吃什么食物好| 一飞冲天是什么生肖| 立加羽读什么| 梦见纸人是什么意思| 丝字五行属什么| 什么中药减肥| 儿童办理护照需要什么材料| 手凉是什么原因| 感冒发烧不能吃什么食物| 阴道清洁度三度什么意思| 胃酸是什么酸| 腰椎ct能查出什么| 诚字属于五行属什么| 日木念什么| 拉肚子发烧吃什么药| 肱骨外上髁炎用什么药| 简单是什么意思| 壁虎为什么是五毒之一| 什么面朝天| 过敏能吃什么| 提手旁的字有什么| 钡餐检查能查出什么| 蛇喜欢吃什么| 戳什么意思| pe是什么意思| 硬不起吃什么药| 脊柱疼是什么原因| 耿耿什么| 素数是什么| 窦性心律逆钟向转位是什么意思| 直辖市是什么级别| 什么是肾虚| 前列腺炎有什么症状表现| 节度使是什么意思| 13年属什么| 第一次怀孕有什么反应| 上火了吃什么降火最快| 九月三日是什么日子| 银色是什么颜色| 眉中间有竖纹代表什么| 什么动物最没有方向感| 喜讯是什么意思| 消化快容易饿什么原因| 经常闪腰是什么原因引起的| 真菌感染什么症状| 鹅蛋孕妇吃有什么好处| 金牛座和什么星座不合| 卵泡长得慢是什么原因造成的| 盗窃是什么意思| 心跳过慢吃什么药| 未可以加什么偏旁| 血糖忽高忽低是什么原因| 高考都考什么| mo是什么意思| 耳后淋巴结肿大吃什么消炎药| 心功能一级什么意思| 邓紫棋和华晨宇什么关系| 入职体检挂什么科| 常字五行属什么| 飞蚊症用什么药| 斯里兰卡属于什么国家| 吃榴莲对身体有什么好处| 头皮痛什么原因引起的| 中国的国服是什么服装| 飞鸟集讲的是什么| 百度
Supported Versions: Current (17) / 16 / 15 / 14 / 13
Development Versions: 18 / devel
Unsupported versions: 12 / 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0 / 8.4 / 8.3 / 8.2 / 8.1 / 8.0 / 7.4 / 7.3 / 7.2 / 7.1
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead.

9.11. Geometric Functions and Operators

The geometric types point, box, lseg, line, path, polygon, and circle have a large set of native support functions and operators, shown in Table 9.33, Table 9.34, and Table 9.35.

Caution

Note that the same as operator, ~=, represents the usual notion of equality for the point, box, polygon, and circle types. Some of these types also have an = operator, but = compares for equal areas only. The other scalar comparison operators (<= and so on) likewise compare areas for these types.

Table 9.33. Geometric Operators

Operator Description Example
+ Translation box '((0,0),(1,1))' + point '(2.0,0)'
- Translation box '((0,0),(1,1))' - point '(2.0,0)'
* Scaling/rotation box '((0,0),(1,1))' * point '(2.0,0)'
/ Scaling/rotation box '((0,0),(2,2))' / point '(2.0,0)'
# Point or box of intersection box '((1,-1),(-1,1))' # box '((1,1),(-2,-2))'
# Number of points in path or polygon # path '((1,0),(0,1),(-1,0))'
@-@ Length or circumference @-@ path '((0,0),(1,0))'
@@ Center @@ circle '((0,0),10)'
## Closest point to first operand on second operand point '(0,0)' ## lseg '((2,0),(0,2))'
<-> Distance between circle '((0,0),1)' <-> circle '((5,0),1)'
&& Overlaps? (One point in common makes this true.) box '((0,0),(1,1))' && box '((0,0),(2,2))'
<< Is strictly left of? circle '((0,0),1)' << circle '((5,0),1)'
>> Is strictly right of? circle '((5,0),1)' >> circle '((0,0),1)'
&< Does not extend to the right of? box '((0,0),(1,1))' &< box '((0,0),(2,2))'
&> Does not extend to the left of? box '((0,0),(3,3))' &> box '((0,0),(2,2))'
<<| Is strictly below? box '((0,0),(3,3))' <<| box '((3,4),(5,5))'
|>> Is strictly above? box '((3,4),(5,5))' |>> box '((0,0),(3,3))'
&<| Does not extend above? box '((0,0),(1,1))' &<| box '((0,0),(2,2))'
|&> Does not extend below? box '((0,0),(3,3))' |&> box '((0,0),(2,2))'
<^ Is below (allows touching)? circle '((0,0),1)' <^ circle '((0,5),1)'
>^ Is above (allows touching)? circle '((0,5),1)' >^ circle '((0,0),1)'
?# Intersects? lseg '((-1,0),(1,0))' ?# box '((-2,-2),(2,2))'
?- Is horizontal? ?- lseg '((-1,0),(1,0))'
?- Are horizontally aligned? point '(1,0)' ?- point '(0,0)'
?| Is vertical? ?| lseg '((-1,0),(1,0))'
?| Are vertically aligned? point '(0,1)' ?| point '(0,0)'
?-| Is perpendicular? lseg '((0,0),(0,1))' ?-| lseg '((0,0),(1,0))'
?|| Are parallel? lseg '((-1,0),(1,0))' ?|| lseg '((-1,2),(1,2))'
@> Contains? circle '((0,0),2)' @> point '(1,1)'
<@ Contained in or on? point '(1,1)' <@ circle '((0,0),2)'
~= Same as? polygon '((0,0),(1,1))' ~= polygon '((1,1),(0,0))'

Note

Before PostgreSQL 8.2, the containment operators @> and <@ were respectively called ~ and @. These names are still available, but are deprecated and will eventually be removed.

Table 9.34. Geometric Functions

Function Return Type Description Example
area(object) double precision area area(box '((0,0),(1,1))')
center(object) point center center(box '((0,0),(1,2))')
diameter(circle) double precision diameter of circle diameter(circle '((0,0),2.0)')
height(box) double precision vertical size of box height(box '((0,0),(1,1))')
isclosed(path) boolean a closed path? isclosed(path '((0,0),(1,1),(2,0))')
isopen(path) boolean an open path? isopen(path '[(0,0),(1,1),(2,0)]')
length(object) double precision length length(path '((-1,0),(1,0))')
npoints(path) int number of points npoints(path '[(0,0),(1,1),(2,0)]')
npoints(polygon) int number of points npoints(polygon '((1,1),(0,0))')
pclose(path) path convert path to closed pclose(path '[(0,0),(1,1),(2,0)]')
popen(path) path convert path to open popen(path '((0,0),(1,1),(2,0))')
radius(circle) double precision radius of circle radius(circle '((0,0),2.0)')
width(box) double precision horizontal size of box width(box '((0,0),(1,1))')

Table 9.35. Geometric Type Conversion Functions

Function Return Type Description Example
box(circle) box circle to box box(circle '((0,0),2.0)')
box(point) box point to empty box box(point '(0,0)')
box(point, point) box points to box box(point '(0,0)', point '(1,1)')
box(polygon) box polygon to box box(polygon '((0,0),(1,1),(2,0))')
bound_box(box, box) box boxes to bounding box bound_box(box '((0,0),(1,1))', box '((3,3),(4,4))')
circle(box) circle box to circle circle(box '((0,0),(1,1))')
circle(point, double precision) circle center and radius to circle circle(point '(0,0)', 2.0)
circle(polygon) circle polygon to circle circle(polygon '((0,0),(1,1),(2,0))')
line(point, point) line points to line line(point '(-1,0)', point '(1,0)')
lseg(box) lseg box diagonal to line segment lseg(box '((-1,0),(1,0))')
lseg(point, point) lseg points to line segment lseg(point '(-1,0)', point '(1,0)')
path(polygon) path polygon to path path(polygon '((0,0),(1,1),(2,0))')
point(double precision, double precision) point construct point point(23.4, -44.5)
point(box) point center of box point(box '((-1,0),(1,0))')
point(circle) point center of circle point(circle '((0,0),2.0)')
point(lseg) point center of line segment point(lseg '((-1,0),(1,0))')
point(polygon) point center of polygon point(polygon '((0,0),(1,1),(2,0))')
polygon(box) polygon box to 4-point polygon polygon(box '((0,0),(1,1))')
polygon(circle) polygon circle to 12-point polygon polygon(circle '((0,0),2.0)')
polygon(npts, circle) polygon circle to npts-point polygon polygon(12, circle '((0,0),2.0)')
polygon(path) polygon path to polygon polygon(path '((0,0),(1,1),(2,0))')

It is possible to access the two component numbers of a point as though the point were an array with indexes 0 and 1. For example, if t.p is a point column then SELECT p[0] FROM t retrieves the X coordinate and UPDATE t SET p[1] = ... changes the Y coordinate. In the same way, a value of type box or lseg can be treated as an array of two point values.

The area function works for the types box, circle, and path. The area function only works on the path data type if the points in the path are non-intersecting. For example, the path '((0,0),(0,1),(2,1),(2,2),(1,2),(1,0),(0,0))'::PATH will not work; however, the following visually identical path '((0,0),(0,1),(1,1),(1,2),(2,2),(2,1),(1,1),(1,0),(0,0))'::PATH will work. If the concept of an intersecting versus non-intersecting path is confusing, draw both of the above paths side by side on a piece of graph paper.

勃起是什么意思 最快的减肥运动是什么 出虚汗是什么原因引起的怎么调理 怀孕不可以吃什么东西 测血型挂什么科
芹菜榨汁有什么功效 多囊为什么要跳绳而不是跑步 新生儿痤疮是什么引起的 肺炎吃什么药 结膜炎吃什么消炎药
睛可以组什么词 岩茶属于什么茶 陈真属什么生肖 麻子是什么意思 甲钴胺不能和什么药一起服用
什么是有氧运动和无氧运动 手链突然断了预示什么 最近嗜睡是什么原因 天官是什么意思 什么药消肿最快最有效
什么水果美白hcv8jop6ns2r.cn 伤残鉴定什么时候做hcv8jop8ns8r.cn 细菌感染是什么原因引起的jinxinzhichuang.com 大林木是什么数字hcv9jop4ns2r.cn 为什么叫中日友好医院hcv7jop6ns9r.cn
金木水火土代表什么hcv9jop2ns8r.cn 男人硬不起来该吃什么药hcv8jop7ns7r.cn 专科医院是什么意思hcv7jop9ns5r.cn 梦见牙掉了一颗是什么意思zsyouku.com 眼角红肿用什么药hcv7jop6ns9r.cn
狗咬到什么程度需要打针hcv8jop6ns3r.cn 皮肤属于什么系统hcv7jop6ns1r.cn 经期吃榴莲有什么好处和坏处hcv9jop3ns0r.cn 鼻窦炎是什么hcv8jop9ns1r.cn tg医学上是什么意思hcv9jop3ns4r.cn
拉肚子恶心想吐吃什么药jingluanji.com 拨备覆盖率是什么意思hcv7jop6ns3r.cn 淋巴净排是什么服务hcv8jop0ns3r.cn 喝水多尿多是什么原因男性hcv8jop8ns4r.cn 碧玺是什么意思hcv8jop1ns8r.cn
百度