Skip to content

Commit 5a519ab

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 2ef575c commit 5a519ab

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

doc/src/sgml/datatype.sgml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3369,7 +3369,7 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
33693369
</row>
33703370
<row>
33713371
<entry><type>line</type></entry>
3372-
<entry>32 bytes</entry>
3372+
<entry>24 bytes</entry>
33733373
<entry>Infinite line</entry>
33743374
<entry>{A,B,C}</entry>
33753375
</row>
@@ -3413,6 +3413,11 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
34133413
</tgroup>
34143414
</table>
34153415

3416+
<para>
3417+
In all these types, the individual coordinates are stored as
3418+
<type>double precision</type> (<type>float8</type>) numbers.
3419+
</para>
3420+
34163421
<para>
34173422
A rich set of functions and operators is available to perform various geometric
34183423
operations such as scaling, translation, rotation, and determining
@@ -3603,8 +3608,16 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
36033608
<para>
36043609
Polygons are represented by lists of points (the vertices of the
36053610
polygon). Polygons are very similar to closed paths; the essential
3606-
difference is that a polygon is considered to include the area
3607-
within it, while a path is not.
3611+
semantic difference is that a polygon is considered to include the
3612+
area within it, while a path is not.
3613+
</para>
3614+
3615+
<para>
3616+
An important implementation difference between polygons and
3617+
paths is that the stored representation of a polygon includes its
3618+
smallest bounding box. This speeds up certain search operations,
3619+
although computing the bounding box adds overhead while constructing
3620+
new polygons.
36083621
</para>
36093622

36103623
<para>

0 commit comments

Comments
 (0)