@@ -49,11 +49,11 @@ of the polygon and the area to the left is inside the polygon. In other words, the net rotation of the vertexes is counter-clockwise.

For example, the following JSON describes an isosceles triangle, sitting
-on the X access and with an area of 0.5:
+on the X axis and with an area of 0.5:

-Querys (and also DELETE and UPDATE statements) in which the WHERE +Queries (and also DELETE and UPDATE statements) in which the WHERE clause contains a bare geopoly_overlap() or geopoly_within() function make use of the underly R*Tree data structures for a fast lookup that only has to examine a subset of the rows in the table. The number of rows examines depends, of course, on the size of the $query_polygon. Large $query_polygons will normally need to look at more rows than small @@ -148,11 +148,11 @@ true if there is any overlap between P1 and P2, or it returns false if P1 and P2 completely disjoint. If either P1 or P2 is not a polygon, this routine returns NULL.

-The geopoly_overlap(P1,p2) function is special in that the geopoly virtual +The geopoly_overlap(P1,P2) function is special in that the geopoly virtual table knows how to use R*Tree indexes to optimize queries in which the WHERE clause uses geopoly_overlap() as a boolean function. Only the geopoly_overlap(P1,P2) and geopoly_within(P1,P2) functions have this capability. @@ -164,11 +164,11 @@ true if P2 is completely contained within P1, or it returns false if any part of P2 is outside of P1. If P1 and P2 are the same polygon, this routine returns true. If either P1 or P2 is not a polygon, this routine returns NULL.

-The geopoly_within(P1,p2) function is special in that the geopoly virtual
+The geopoly_within(P1,P2) function is special in that the geopoly virtual
table knows how to use R*Tree indexes to optimize queries in which the
WHERE clause uses geopoly_within() as a boolean function. Only the
geopoly_within(P1,P2) and geopoly_overlap(P1,P2) functions have this
capability.
@@ -190,11 +190,11 @@

If P is a polygon, then geopoly_json(P) returns the GeoJSON representation
-of that polygon as a TEPT string.
+of that polygon as a TEXT string.
If P is not a polygon, geopoly_json(P) returns NULL.

-If P is a polygon, then geopoly_bbox(P) returns the a new polygon that is
-the smallest rectangle completely enclosing P.
+If P is a polygon, then geopoly_bbox(P) returns a new polygon that is
+the smallest (axis-aligned) rectangle completely enclosing P.
If P is not a polygon, geopoly_bbox(P) returns NULL.

The geopoly_xform(P,A,B,C,D,E,F) returns a new polygon that is a -linear transformation of the polygon P and where the transformation +affine transformation of the polygon P and where the transformation is defined by values A,B,C,D,E,F. If P is not a valid polygon, this routine returns NULL.

The transformation converts each vertex of the polygon according to the @@ -278,17 +278,17 @@

Geopoly stores all polygons internally using a binary format. A binary -polygon consists of a 4-byte header following by an array coordinate -pairs which each dimension of each coordinate is of 32-byte floating point +polygon consists of a 4-byte header following by an array of coordinate +pairs in which each dimension of each coordinate is of 32-byte floating point number.

The first byte of the header is a flag byte. The least significant bit -of the flag byte determines whether the coordinate pairs the follow the +of the flag byte determines whether the coordinate pairs that follow the header are stored big-endian or little-endian. A value of 0 for the least significant bit means big-endian and a value of 1 means little endian. Other bits of the first byte in the header are reserved for future expansion.