point��box��lseg��line��path��polygon�������circle�����ǡ������ˤϡ�PostgreSQL���������ݡ��Ȥ��Ƥ���ؿ��ȱ黻�Ҥ�˭�٤�·�äƤ��ޤ���表9-29��表9-30�������表9-31�Ȥ��Ƥ��������ˡ�
注意 |
"Ʊ����"~=�黻�Ҥ�point��box��polygon�������circle�����Ф��̾��������ǰ�����Ȥ����դ��Ƥ��������������Τ����Ĥ��η��Ϥޤ�=�黻�Ҥ�����ޤ�����=��������areas�Τߤ���Ӥ��ޤ�������¾�Υ����顼��ӱ黻�ҡ�<=�ʤɡˤϤ����η����ΰ�Τ�����Ӥ��ޤ��� |
表 9-29. �����ǡ����黻��
�黻�� | ���� | �� |
---|---|---|
+ | ʿ��ư | box '((0,0),(1,1))' + point '(2.0,0)' |
- | ʿ��ư | box '((0,0),(1,1))' - point '(2.0,0)' |
* | ����̾�/��ž | box '((0,0),(1,1))' * point '(2.0,0)' |
/ | ����̾�/��ž | box '((0,0),(2,2))' / point '(2.0,0)' |
# | ��������� | '((1,-1),(-1,1))' # '((1,1),(-1,-1))' |
# | ��ϩ�⤷����¿�ѷ������ο� | # '((1,0),(0,1),(-1,0))' |
@-@ | Ĺ���⤷���ϱ� | @-@ path '((0,0),(1,0))' |
@@ | �濴 | @@ circle '((0,0),10)' |
## | ��1�黻���ܤ���2�黻���ܤȤζ����� | point '(0,0)' ## lseg '((2,0),(0,2))' |
<-> | ��Υ | circle '((0,0),1)' <-> circle '((5,0),1)' |
&& | �ŤʤäƤ��뤫�ɤ����� | box '((0,0),(1,1))' && box '((0,0),(2,2))' |
<< | ��̩�˺�¦�ˤ��뤫�� | circle '((0,0),1)' << circle '((5,0),1)' |
>> | ��̩�˱�¦�ˤ��뤫�� | circle '((5,0),1)' >> circle '((0,0),1)' |
&< | ��¦�ˤϤ߽Ф��ʤ����� | box '((0,0),(1,1))' &< box '((0,0),(2,2))' |
&> | ��¦�ˤϤ߽Ф��ʤ����� | box '((0,0),(3,3))' &> box '((0,0),(2,2))' |
<<| | ��̩�˲�¦�ˤ��뤫�� | box '((0,0),(3,3))' <<| box '((3,4),(5,5))' |
|>> | ��̩�˾�¦�ˤ��뤫�� | box '((3,4),(5,5))' |>> box '((0,0),(3,3))' |
&<| | ��¦�˽ФƤ��ʤ����� | box '((0,0),(1,1))' &<| box '((0,0),(2,2))' |
|&> | ��¦�˽ФƤ��ʤ����� | box '((0,0),(3,3))' |&> box '((0,0),(2,2))' |
<^ | ���ܿ�����Ĥ��˲�¦�ˤ��뤫�� | circle '((0,0),1)' <^ circle '((0,5),1)' |
>^ | ���ܿ�����Ĥ��˾�¦�ˤ��뤫�� | circle '((0,5),1)' >^ circle '((0,0),1)' |
?# | ���뤫�� | lseg '((-1,0),(1,0))' ?# box '((-2,-2),(2,2))' |
?- | ��ʿ���� | ?- lseg '((-1,0),(1,0))' |
?- | ��ʿ������·�äƤ��뤫�� | point '(1,0)' ?- point '(0,0)' |
?| | ��ľ���� | ?| lseg '((-1,0),(1,0))' |
?| | ��ľ������·�äƤ��뤫�� | point '(0,1)' ?| point '(0,0)' |
?-| | ľ�Ѥ�ʤ��Ƥ��뤫�� | lseg '((0,0),(0,1))' ?-| lseg '((0,0),(1,0))' |
?|| | ʿ�Ԥ��� | lseg '((-1,0),(1,0))' ?|| lseg '((-1,2),(1,2))' |
@> | ��ޤ��Ƥ��뤫�� | circle '((0,0),2)' @> point '(1,1)' |
<@ | ��ޤ⤷���϶������ޤफ�� | point '(1,1)' <@ circle '((0,0),2)' |
~= | Ʊ������ | polygon '((0,0),(1,1))' ~= polygon '((1,1),(0,0))' |
注意: PostgreSQL 8.2������Ǥϡ���ͭ�黻��@>�����<@�Ϥ��줾��~�����@�Ȥ���̾���Ǥ�����������̾���Ϥޤ����ѤǤ��ޤ������ѻ�ͽ���ͽ��ʤ��Ǥʤ��ʤ뤫�⤷��ޤ���
表 9-30. �����ǡ������ؿ�
�ؿ� | ����� | ���� | �� |
---|---|---|---|
area (object) | double precision | ���� | area(box '((0,0),(1,1))') |
center (object) | point | �濴 | center(box '((0,0),(1,2))') |
diameter (circle) | double precision | �ߤ�ľ�� | diameter(circle '((0,0),2.0)') |
height (box) | double precision | ����ι⤵ | height(box '((0,0),(1,1))') |
isclosed (path) | boolean | �ķ�ϩ���� | isclosed(path '((0,0),(1,1),(2,0))') |
isopen (path) | boolean | ����ϩ���� | isopen(path '[(0,0),(1,1),(2,0)]') |
length (object) | double precision | �� | length(path '((-1,0),(1,0))') |
npoints (path) | int | ���ο� | npoints(path '[(0,0),(1,1),(2,0)]') |
npoints (polygon) | int | ���ο� | npoints(polygon '((1,1),(0,0))') |
pclose (path) | path | �ķ�ϩ���Ѵ� | pclose(path '[(0,0),(1,1),(2,0)]') |
popen (path) | path | ����ϩ���Ѵ� | popen(path '((0,0),(1,1),(2,0))') |
radius (circle) | double precision | �ߤ�Ⱦ�� | radius(circle '((0,0),2.0)') |
width (box) | double precision | ������� | width(box '((0,0),(1,1))') |
表 9-31. �������Ѵ��ؿ�
�ؿ� | ����� | ���� | �� |
---|---|---|---|
box (circle) | box | �ߤ����� | box(circle '((0,0),2.0)') |
box (point, point) | box | ��ɸ���������Ѵ� | box(point '(0,0)', point '(1,1)') |
box (polygon) | box | ¿�ѷ��������Ѵ� | box(polygon '((0,0),(1,1),(2,0))') |
circle (box) | circle | �����ߤ��Ѵ� | circle(box '((0,0),(1,1))') |
circle (point, double precision) | circle | �濴��Ⱦ�¤���ߤ��Ѵ� | circle(point '(0,0)', 2.0) |
circle (polygon) | circle | ¿�ѷ���ߤ��Ѵ� | circle(polygon '((0,0),(1,1),(2,0))') |
lseg (box) | lseg | ������г�������ʬ���Ѵ� | lseg(box '((-1,0),(1,0))') |
lseg (point, point) | lseg | ��ɸ������ʬ���Ѵ� | lseg(point '(-1,0)', point '(1,0)') |
path (polygon) | point | ¿�ѷ����ϩ���Ѵ� | path(polygon '((0,0),(1,1),(2,0))') |
point (double
precision, double precision) | point | ��ɸ���ι��� | point(23.4, -44.5) |
point (box) | point | ������濴 | point(box '((-1,0),(1,0))') |
point (circle) | point | �ߤ��濴 | point(circle '((0,0),2.0)') |
point (lseg) | point | ��ʬ���濴 | point(lseg '((-1,0),(1,0))') |
point (polygon) | point | ������濴 | point(polygon '((0,0),(1,1),(2,0))') |
polygon (box) | polygon | �������4ĺ����¿�ѷ� | polygon(box '((0,0),(1,1))') |
polygon (circle) | polygon | �ߤ���12�ѷ� | polygon(circle '((0,0),2.0)') |
polygon (npts, circle) | polygon | �ߤ���npts�ѷ� | polygon(12, circle '((0,0),2.0)') |
polygon (path) | polygon | ��ϩ����¿�ѷ� | polygon(path '((0,0),(1,1),(2,0))') |
point��2�Ĥι������Ǥϡ�ź��0��1��ͭ��������˥�����������Τ�Ʊ���褦�ˡ������������뤳�Ȥ��Ǥ��ޤ����㤨�С�t.p��point��ξ�硢SELECT p[0] FROM t�Ȥ�������X��ɸ������ФǤ��ޤ����ޤ���UPDATE t SET p[1] = ...��Y��ɸ�����ѹ��Ǥ��ޤ���Ʊ�ͤˡ�box�ޤ���lseg�Ǥ⡢2�Ĥ�point����ʤ�����Τ褦�˰����ޤ���
area
�ؿ��ϡ�box��circle��path�����Ф���ư��ޤ���path�ǡ��������Ф���area
�ؿ��ϡ�����path�����ʤ����ˤΤ�ư��ޤ����㤨�С�'((0,0),(0,1),(2,1),(2,2),(1,2),(1,0),(0,0))'::PATH�Ȥ���path��ư��ޤ��������������ܤ�Ʊ���Ǥ�����'((0,0),(0,1),(1,1),(1,2),(2,2),(2,1),(1,1),(1,0),(0,0))'::PATH�Ȥ���path�Ǥ�ư��ޤ���path�θ��롢���ʤ��Ȥ�����ǰ���褯�狼��ʤ���С����2�Ĥ�path���¤٤ƥ�����ѻ�˽ƤߤƤ���������