point
geometric point on a plane
当前阅读 PG 18·选择有来源记录的版本
此版本暂无所选语言的定义,以下显示原始英文内容。
- Catalog name
- pg_catalog.point
- Type OID
- 600
- Type kind
- Base type
- Declared length
- 16 bytes
- Storage strategy
- plain
- Input function
- point_in
- Output function
- point_out
- Documented declaration
- point
- Storage Size
- 16 bytes
- Manual description
- Point on a plane
- Representation
- (x,y)
- aliases
- 未知
- coverage
- source inventory; exact declared input types for operator classes
- manual documentation
- dedicated family chapter
- manual path
- datatype-geometric.html
- ranges
- 未知
- signature
- point
版本定义 PG 18
8.8. Geometric Types
Geometric data types represent two-dimensional spatial objects. Table 8.20 shows the geometric types available in PostgreSQL.
Table 8.20. Geometric Types
| Name | Storage Size | Description | Representation |
|---|---|---|---|
point |
16 bytes | Point on a plane | (x,y) |
line |
24 bytes | Infinite line | {A,B,C} |
lseg |
32 bytes | Finite line segment | [(x1,y1),(x2,y2)] |
box |
32 bytes | Rectangular box | (x1,y1),(x2,y2) |
path |
16+16n bytes | Closed path (similar to polygon) | ((x1,y1),...) |
path |
16+16n bytes | Open path | [(x1,y1),...] |
polygon |
40+16n bytes | Polygon (similar to closed path) | ((x1,y1),...) |
circle |
24 bytes | Circle | <(x,y),r> (center point and radius) |
In all these types, the individual coordinates are stored as double precision (float8) numbers.
A rich set of functions and operators is available to perform various geometric operations such as scaling, translation, rotation, and determining intersections. They are explained in Section 9.11.
8.8.1. Points
Points are the fundamental two-dimensional building block for geometric types. Values of type point are specified using either of the following syntaxes:
(x,y)x,y
where x and y are the respective coordinates, as floating-point numbers.
Points are output using the first syntax.
8.8.2. Lines
Lines are represented by the linear equation Ax + By + C = 0, where A and B are not both zero. Values of type line are input and output in the following form:
{ A, B, C }
Alternatively, any of the following forms can be used for input:
[ (x1,y1) , (x2,y2) ] ( (x1,y1) , (x2,y2) ) (x1,y1) , (x2,y2)x1,y1,x2,y2
where ( and x1,y1)( are two different points on the line.x2,y2)
8.8.3. Line Segments
Line segments are represented by pairs of points that are the endpoints of the segment. Values of type lseg are specified using any of the following syntaxes:
[ (x1,y1) , (x2,y2) ] ( (x1,y1) , (x2,y2) ) (x1,y1) , (x2,y2)x1,y1,x2,y2
where ( and x1,y1)( are the end points of the line segment.x2,y2)
Line segments are output using the first syntax.
8.8.4. Boxes
Boxes are represented by pairs of points that are opposite corners of the box. Values of type box are specified using any of the following syntaxes:
( (x1,y1) , (x2,y2) ) (x1,y1) , (x2,y2)x1,y1,x2,y2
where ( and x1,y1)( are any two opposite corners of the box.x2,y2)
Boxes are output using the second syntax.
Any two opposite corners can be supplied on input, but the values will be reordered as needed to store the upper right and lower left corners, in that order.
8.8.5. Paths
Paths are represented by lists of connected points. Paths can be open, where the first and last points in the list are considered not connected, or closed, where the first and last points are considered connected.
Values of type path are specified using any of the following syntaxes:
[ (x1,y1) , ... , (xn,yn) ] ( (x1,y1) , ... , (xn,yn) ) (x1,y1) , ... , (xn,yn) (x1,y1, ... ,xn,yn)x1,y1, ... ,xn,yn
where the points are the end points of the line segments comprising the path. Square brackets ([]) indicate an open path, while parentheses (()) indicate a closed path. When the outermost parentheses are omitted, as in the third through fifth syntaxes, a closed path is assumed.
Paths are output using the first or second syntax, as appropriate.
8.8.6. Polygons
Polygons are represented by lists of points (the vertices of the polygon). Polygons are very similar to closed paths; the essential semantic difference is that a polygon is considered to include the area within it, while a path is not.
An important implementation difference between polygons and paths is that the stored representation of a polygon includes its smallest bounding box. This speeds up certain search operations, although computing the bounding box adds overhead while constructing new polygons.
Values of type polygon are specified using any of the following syntaxes:
( (x1,y1) , ... , (xn,yn) ) (x1,y1) , ... , (xn,yn) (x1,y1, ... ,xn,yn)x1,y1, ... ,xn,yn
where the points are the end points of the line segments comprising the boundary of the polygon.
Polygons are output using the first syntax.
8.8.7. Circles
Circles are represented by a center point and radius. Values of type circle are specified using any of the following syntaxes:
< (x,y) ,r> ( (x,y) ,r) (x,y) ,rx,y,r
where ( is the center point and x,y)r is the radius of the circle.
Circles are output using the first syntax.
比较版本
完整来源事实
casts
map[castcontext:a castfunc:box(point) castmethod:f castsource:point casttarget:box], map[castcontext:e castfunc:point(lseg) castmethod:f castsource:lseg casttarget:point], map[castcontext:e castfunc:point(box) castmethod:f castsource:box casttarget:point], map[castcontext:e castfunc:point(polygon) castmethod:f castsource:polygon casttarget:point], map[castcontext:e castfunc:point(circle) castmethod:f castsource:circle casttarget:point]
catalog
{"array_type_name":"_point","array_type_oid":"1017","descr":"geometric point, format '(x,y)'","oid":"600","typacl":"_null_","typalign":"d","typanalyze":"-","typarray":"0","typbasetype":"0","typbyval":"f","typcategory":"G","typcollation":"0","typdefault":"_null_","typdefaultbin":"_null_","typdelim":"','","typelem":"float8","typinput":"point_in","typisdefined":"t","typispreferred":"f","typlen":"16","typmodin":"-","typmodout":"-","typname":"point","typnamespace":"pg_catalog","typndims":"0","typnotnull":"f","typoutput":"point_out","typowner":"POSTGRES","typreceive":"point_recv","typrelid":"0","typsend":"point_send","typstorage":"p","typsubscript":"raw_array_subscript_handler","typtype":"b","typtypmod":"-1"}operator classes
map[opcdefault:t opcfamily:gist/point_ops opcintype:point opckeytype:box opcmethod:gist opcname:point_ops opcnamespace:pg_catalog opcowner:POSTGRES], map[opcdefault:t opcfamily:spgist/quad_point_ops opcintype:point opckeytype:0 opcmethod:spgist opcname:quad_point_ops opcnamespace:pg_catalog opcowner:POSTGRES], map[opcdefault:f opcfamily:spgist/kd_point_ops opcintype:point opckeytype:0 opcmethod:spgist opcname:kd_point_ops opcnamespace:pg_catalog opcowner:POSTGRES]
operators
map[descr:deprecated, use |>> instead oid:506 oprcanhash:f oprcanmerge:f oprcode:point_above oprcom:0 oprjoin:positionjoinsel oprkind:b oprleft:point oprname:>^ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:positionsel oprresult:bool oprright:point], map[descr:is left of oid:507 oprcanhash:f oprcanmerge:f oprcode:point_left oprcom:0 oprjoin:positionjoinsel oprkind:b oprleft:point oprname:<< oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:positionsel oprresult:bool oprright:point], map[descr:is right of oid:508 oprcanhash:f oprcanmerge:f oprcode:point_right oprcom:0 oprjoin:positionjoinsel oprkind:b oprleft:point oprname:>> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:positionsel oprresult:bool oprright:point], map[descr:deprecated, use <<| instead oid:509 oprcanhash:f oprcanmerge:f oprcode:point_below oprcom:0 oprjoin:positionjoinsel oprkind:b oprleft:point oprname:<^ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:positionsel oprresult:bool oprright:point], map[descr:same as oid:510 oprcanhash:f oprcanmerge:f oprcode:point_eq oprcom:~=(point,point) oprjoin:eqjoinsel oprkind:b oprleft:point oprname:~= oprnamespace:pg_catalog oprnegate:<>(point,point) oprowner:POSTGRES oprrest:eqsel oprresult:bool oprright:point], map[descr:point inside box oid:511 oprcanhash:f oprcanmerge:f oprcode:on_pb oprcom:@>(box,point) oprjoin:contjoinsel oprkind:b oprleft:point oprname:<@ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:contsel oprresult:bool oprright:box], map[descr:contains oid:433 oprcanhash:f oprcanmerge:f oprcode:box_contain_pt oprcom:<@(point,box) oprjoin:contjoinsel oprkind:b oprleft:box oprname:@> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:contsel oprresult:bool oprright:point], map[descr:point within closed path, or point on open path oid:512 oprcanhash:f oprcanmerge:f oprcode:on_ppath oprcom:@>(path,point) oprjoin:- oprkind:b oprleft:point oprname:<@ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:bool oprright:path], map[descr:distance between oid:517 oprcanhash:f oprcanmerge:f oprcode:point_distance oprcom:<->(point,point) oprjoin:- oprkind:b oprleft:point oprname:<-> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:float8 oprright:point], map[descr:distance between oid:613 oprcanhash:f oprcanmerge:f oprcode:dist_pl oprcom:<->(line,point) oprjoin:- oprkind:b oprleft:point oprname:<-> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:float8 oprright:line], map[descr:distance between oid:760 oprcanhash:f oprcanmerge:f oprcode:dist_lp oprcom:<->(point,line) oprjoin:- oprkind:b oprleft:line oprname:<-> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:float8 oprright:point], map[descr:distance between oid:614 oprcanhash:f oprcanmerge:f oprcode:dist_ps oprcom:<->(lseg,point) oprjoin:- oprkind:b oprleft:point oprname:<-> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:float8 oprright:lseg], map[descr:distance between oid:761 oprcanhash:f oprcanmerge:f oprcode:dist_sp oprcom:<->(point,lseg) oprjoin:- oprkind:b oprleft:lseg oprname:<-> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:float8 oprright:point], map[descr:distance between oid:615 oprcanhash:f oprcanmerge:f oprcode:dist_pb oprcom:<->(box,point) oprjoin:- oprkind:b oprleft:point oprname:<-> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:float8 oprright:box], map[descr:distance between oid:606 oprcanhash:f oprcanmerge:f oprcode:dist_bp oprcom:<->(point,box) oprjoin:- oprkind:b oprleft:box oprname:<-> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:float8 oprright:point], map[descr:distance between oid:618 oprcanhash:f oprcanmerge:f oprcode:dist_ppath oprcom:<->(path,point) oprjoin:- oprkind:b oprleft:point oprname:<-> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:float8 oprright:path], map[descr:distance between oid:784 oprcanhash:f oprcanmerge:f oprcode:dist_pathp oprcom:<->(point,path) oprjoin:- oprkind:b oprleft:path oprname:<-> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:float8 oprright:point], map[descr:not equal oid:713 oprcanhash:f oprcanmerge:f oprcode:point_ne oprcom:<>(point,point) oprjoin:neqjoinsel oprkind:b oprleft:point oprname:<> oprnamespace:pg_catalog oprnegate:~=(point,point) oprowner:POSTGRES oprrest:neqsel oprresult:bool oprright:point], map[descr:add points (translate) oid:731 oprcanhash:f oprcanmerge:f oprcode:point_add oprcom:+(point,point) oprjoin:- oprkind:b oprleft:point oprname:+ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:point oprright:point], map[descr:subtract points (translate) oid:732 oprcanhash:f oprcanmerge:f oprcode:point_sub oprcom:0 oprjoin:- oprkind:b oprleft:point oprname:- oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:point oprright:point], map[descr:multiply points (scale/rotate) oid:733 oprcanhash:f oprcanmerge:f oprcode:point_mul oprcom:*(point,point) oprjoin:- oprkind:b oprleft:point oprname:* oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:point oprright:point], map[descr:divide points (scale/rotate) oid:734 oprcanhash:f oprcanmerge:f oprcode:point_div oprcom:0 oprjoin:- oprkind:b oprleft:point oprname:/ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:point oprright:point], map[descr:add (translate path) oid:736 oprcanhash:f oprcanmerge:f oprcode:path_add_pt oprcom:0 oprjoin:- oprkind:b oprleft:path oprname:+ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:path oprright:point], map[descr:subtract (translate path) oid:737 oprcanhash:f oprcanmerge:f oprcode:path_sub_pt oprcom:0 oprjoin:- oprkind:b oprleft:path oprname:- oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:path oprright:point], map[descr:multiply (rotate/scale path) oid:738 oprcanhash:f oprcanmerge:f oprcode:path_mul_pt oprcom:0 oprjoin:- oprkind:b oprleft:path oprname:* oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:path oprright:point], map[descr:divide (rotate/scale path) oid:739 oprcanhash:f oprcanmerge:f oprcode:path_div_pt oprcom:0 oprjoin:- oprkind:b oprleft:path oprname:/ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:path oprright:point], map[descr:contains oid:755 oprcanhash:f oprcanmerge:f oprcode:path_contain_pt oprcom:<@(point,path) oprjoin:- oprkind:b oprleft:path oprname:@> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:bool oprright:point], map[descr:is contained by oid:756 oprcanhash:f oprcanmerge:f oprcode:pt_contained_poly oprcom:@>(polygon,point) oprjoin:contjoinsel oprkind:b oprleft:point oprname:<@ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:contsel oprresult:bool oprright:polygon], map[descr:contains oid:757 oprcanhash:f oprcanmerge:f oprcode:poly_contain_pt oprcom:<@(point,polygon) oprjoin:contjoinsel oprkind:b oprleft:polygon oprname:@> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:contsel oprresult:bool oprright:point], map[descr:is contained by oid:758 oprcanhash:f oprcanmerge:f oprcode:pt_contained_circle oprcom:@>(circle,point) oprjoin:contjoinsel oprkind:b oprleft:point oprname:<@ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:contsel oprresult:bool oprright:circle], map[descr:contains oid:759 oprcanhash:f oprcanmerge:f oprcode:circle_contain_pt oprcom:<@(point,circle) oprjoin:contjoinsel oprkind:b oprleft:circle oprname:@> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:contsel oprresult:bool oprright:point], map[descr:add point to box (translate) oid:804 oprcanhash:f oprcanmerge:f oprcode:box_add oprcom:0 oprjoin:- oprkind:b oprleft:box oprname:+ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:box oprright:point], map[descr:subtract point from box (translate) oid:805 oprcanhash:f oprcanmerge:f oprcode:box_sub oprcom:0 oprjoin:- oprkind:b oprleft:box oprname:- oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:box oprright:point], map[descr:multiply box by point (scale) oid:806 oprcanhash:f oprcanmerge:f oprcode:box_mul oprcom:0 oprjoin:- oprkind:b oprleft:box oprname:* oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:box oprright:point], map[descr:divide box by point (scale) oid:807 oprcanhash:f oprcanmerge:f oprcode:box_div oprcom:0 oprjoin:- oprkind:b oprleft:box oprname:/ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:box oprright:point], map[descr:horizontally aligned oid:808 oprcanhash:f oprcanmerge:f oprcode:point_horiz oprcom:?-(point,point) oprjoin:- oprkind:b oprleft:point oprname:?- oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:bool oprright:point], map[descr:vertically aligned oid:809 oprcanhash:f oprcanmerge:f oprcode:point_vert oprcom:?|(point,point) oprjoin:- oprkind:b oprleft:point oprname:?| oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:bool oprright:point], map[descr:add oid:1516 oprcanhash:f oprcanmerge:f oprcode:circle_add_pt oprcom:0 oprjoin:- oprkind:b oprleft:circle oprname:+ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:circle oprright:point], map[descr:subtract oid:1517 oprcanhash:f oprcanmerge:f oprcode:circle_sub_pt oprcom:0 oprjoin:- oprkind:b oprleft:circle oprname:- oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:circle oprright:point], map[descr:multiply oid:1518 oprcanhash:f oprcanmerge:f oprcode:circle_mul_pt oprcom:0 oprjoin:- oprkind:b oprleft:circle oprname:* oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:circle oprright:point], map[descr:divide oid:1519 oprcanhash:f oprcanmerge:f oprcode:circle_div_pt oprcom:0 oprjoin:- oprkind:b oprleft:circle oprname:/ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:circle oprright:point], map[descr:distance between oid:1522 oprcanhash:f oprcanmerge:f oprcode:dist_pc oprcom:<->(circle,point) oprjoin:- oprkind:b oprleft:point oprname:<-> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:float8 oprright:circle], map[descr:distance between oid:3291 oprcanhash:f oprcanmerge:f oprcode:dist_cpoint oprcom:<->(point,circle) oprjoin:- oprkind:b oprleft:circle oprname:<-> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:float8 oprright:point], map[descr:distance between oid:3276 oprcanhash:f oprcanmerge:f oprcode:dist_ppoly oprcom:<->(polygon,point) oprjoin:- oprkind:b oprleft:point oprname:<-> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:float8 oprright:polygon], map[descr:distance between oid:3289 oprcanhash:f oprcanmerge:f oprcode:dist_polyp oprcom:<->(point,polygon) oprjoin:- oprkind:b oprleft:polygon oprname:<-> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:float8 oprright:point], map[descr:point on line oid:1546 oprcanhash:f oprcanmerge:f oprcode:on_pl oprcom:0 oprjoin:- oprkind:b oprleft:point oprname:<@ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:bool oprright:line], map[descr:is contained by oid:1547 oprcanhash:f oprcanmerge:f oprcode:on_ps oprcom:0 oprjoin:- oprkind:b oprleft:point oprname:<@ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:bool oprright:lseg], map[descr:closest point to A on B oid:1557 oprcanhash:f oprcanmerge:f oprcode:close_pl oprcom:0 oprjoin:- oprkind:b oprleft:point oprname:## oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:point oprright:line], map[descr:closest point to A on B oid:1558 oprcanhash:f oprcanmerge:f oprcode:close_ps oprcom:0 oprjoin:- oprkind:b oprleft:point oprname:## oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:point oprright:lseg], map[descr:closest point to A on B oid:1559 oprcanhash:f oprcanmerge:f oprcode:close_pb oprcom:0 oprjoin:- oprkind:b oprleft:point oprname:## oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:point oprright:box], map[descr:is above oid:4161 oprcanhash:f oprcanmerge:f oprcode:point_above oprcom:0 oprjoin:positionjoinsel oprkind:b oprleft:point oprname:|>> oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:positionsel oprresult:bool oprright:point], map[descr:is below oid:4162 oprcanhash:f oprcanmerge:f oprcode:point_below oprcom:0 oprjoin:positionjoinsel oprkind:b oprleft:point oprname:<<| oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:positionsel oprresult:bool oprright:point]
来源引用
定义来源
center · PostgreSQL 18 · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f
正文语言: en · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f