Skip to content

Commit b261649

Browse files
committed
Doc: small improvements in discussion of geometric data types.
State explicitly that the coordinates in our geometric data types are float8. Also explain that polygons store their bounding box. While here, fix the table of geometric data types to show type "line"'s size correctly: it's 24 bytes not 32. This has somehow escaped notice since that table was made in 1998. Per suggestion from Sebastian Skałacki. The size error seems important enough to justify back-patching. Discussion: https://postgr.es/m/172000045661.706.1822177575291548794@wrigleys.postgresql.org
1 parent f699ce8 commit b261649

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

doc/src/sgml/datatype.sgml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3308,7 +3308,7 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
33083308
</row>
33093309
<row>
33103310
<entry><type>line</type></entry>
3311-
<entry>32 bytes</entry>
3311+
<entry>24 bytes</entry>
33123312
<entry>Infinite line</entry>
33133313
<entry>{A,B,C}</entry>
33143314
</row>
@@ -3352,6 +3352,11 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
33523352
</tgroup>
33533353
</table>
33543354

3355+
<para>
3356+
In all these types, the individual coordinates are stored as
3357+
<type>double precision</type> (<type>float8</type>) numbers.
3358+
</para>
3359+
33553360
<para>
33563361
A rich set of functions and operators is available to perform various geometric
33573362
operations such as scaling, translation, rotation, and determining
@@ -3541,8 +3546,17 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
35413546

35423547
<para>
35433548
Polygons are represented by lists of points (the vertexes of the
3544-
polygon). Polygons are very similar to closed paths, but are
3545-
stored differently and have their own set of support routines.
3549+
polygon). Polygons are very similar to closed paths; the essential
3550+
semantic difference is that a polygon is considered to include the
3551+
area within it, while a path is not.
3552+
</para>
3553+
3554+
<para>
3555+
An important implementation difference between polygons and
3556+
paths is that the stored representation of a polygon includes its
3557+
smallest bounding box. This speeds up certain search operations,
3558+
although computing the bounding box adds overhead while constructing
3559+
new polygons.
35463560
</para>
35473561

35483562
<para>

0 commit comments

Comments
 (0)