From d151d321636a9129f713b8bc54c9d163c6cb890c Mon Sep 17 00:00:00 2001 From: Blottiere Paul Date: Sat, 19 Jul 2025 23:12:16 +0200 Subject: [PATCH] Add doc for utils and schema functions --- doc/concepts/compressions.rst | 6 +- doc/functions/index.rst | 2 + doc/functions/patchs.rst | 340 +++++++++++++++++----------------- doc/functions/points.rst | 91 +++++---- doc/functions/postgis.rst | 117 ++++++------ doc/functions/schema.rst | 33 ++++ doc/functions/utils.rst | 120 ++++++++++++ doc/functions/wkb.rst | 31 ++-- 8 files changed, 445 insertions(+), 295 deletions(-) create mode 100644 doc/functions/schema.rst create mode 100644 doc/functions/utils.rst diff --git a/doc/concepts/compressions.rst b/doc/concepts/compressions.rst index 5f84235f..e94078e8 100644 --- a/doc/concepts/compressions.rst +++ b/doc/concepts/compressions.rst @@ -9,7 +9,7 @@ data volumes, PostgreSQL Pointcloud allows schemas to declare their preferred compression method in the ```` block of the schema document. In the example schema, we declared our compression as follows: -.. code-block:: sql +.. code-block:: xml dimensional @@ -35,7 +35,7 @@ Dimensional compression first flips the patch representation from a list of N points containing M dimension values to a list of M dimensions each containing N values. -.. code-block:: sql +.. code-block:: json {"pcid":1,"pts":[ [-126.99,45.01,1,0],[-126.98,45.02,2,0],[-126.97,45.03,3,0], @@ -44,7 +44,7 @@ N values. Becomes, notionally: -.. code-block:: sql +.. code-block:: json {"pcid":1,"dims":[ [-126.99,-126.98,-126.97,-126.96,-126.95,-126.94], diff --git a/doc/functions/index.rst b/doc/functions/index.rst index b82ef855..fce14c84 100644 --- a/doc/functions/index.rst +++ b/doc/functions/index.rst @@ -7,7 +7,9 @@ Functions .. toctree:: :maxdepth: 2 + schema points patchs wkb postgis + utils diff --git a/doc/functions/patchs.rst b/doc/functions/patchs.rst index 800a274d..0eaa50b5 100644 --- a/doc/functions/patchs.rst +++ b/doc/functions/patchs.rst @@ -5,204 +5,211 @@ PcPatch ******************************************************************************** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_Patch +PC_AsText ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_Patch(pts pcpoint[]) returns pcpatch: +:PC_AsText(p pcpatch) returns text: -Aggregate function that collects a result set of pcpoint values into a pcpatch. +Returns a JSON version of the data in that patch. .. code-block:: - INSERT INTO patches (pa) - SELECT PC_Patch(pt) FROM points GROUP BY id/10; + SELECT PC_AsText(pa) FROM patches LIMIT 1; + + {"pcid":1,"pts":[ + [-126.99,45.01,1,0],[-126.98,45.02,2,0],[-126.97,45.03,3,0], + [-126.96,45.04,4,0],[-126.95,45.05,5,0],[-126.94,45.06,6,0], + [-126.93,45.07,7,0],[-126.92,45.08,8,0],[-126.91,45.09,9,0] + ]} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_MakePatch +PC_Compress ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_MakePatch(pcid integer, vals float8[]) returns pcpatch: - -Given a valid pcid schema number and an array of doubles that matches the -schema, construct a new pcpatch. Array size must be a multiple of the number of -dimensions. +:PC_Compress(p pcpatch,global_compression_scheme text,compression_config text) returns pcpatch: -.. code-block:: +Compress a patch with a manually specified scheme. The compression_config +semantic depends on the global compression scheme. Allowed global compression +schemes are: - SELECT PC_AsText(PC_MakePatch(1, ARRAY[-126.99,45.01,1,0, -126.98,45.02,2,0, -126.97,45.03,3,0])); +- auto: determined by pcid +- laz: no compression config supported +- dimensional: configuration is a comma-separated list of per-dimension compressions from this list - {"pcid":1,"pts":[ - [-126.99,45.01,1,0],[-126.98,45.02,2,0],[-126.97,45.03,3,0] - ]} + - auto: determined automatically from values stats + - zlib: deflate compression + - sigbits: significant bits removal + - rle: run-length encoding ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_NumPoints +PC_Explode ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_NumPoints(p pcpatch) returns integer: +:PC_Explode(p pcpatch) returns SetOf[pcpoint]: -Return the number of points in this patch. +Set-returning function, converts patch into result set of one point record for +each point in the patch. .. code-block:: - SELECT PC_NumPoints(pa) FROM patches LIMIT 1; + SELECT PC_AsText(PC_Explode(pa)), id + FROM patches WHERE id = 7; - 9 + pc_astext | id + --------------------------------------+---- + {"pcid":1,"pt":[-126.5,45.5,50,5]} | 7 + {"pcid":1,"pt":[-126.49,45.51,51,5]} | 7 + {"pcid":1,"pt":[-126.48,45.52,52,5]} | 7 + {"pcid":1,"pt":[-126.47,45.53,53,5]} | 7 + {"pcid":1,"pt":[-126.46,45.54,54,5]} | 7 + {"pcid":1,"pt":[-126.45,45.55,55,5]} | 7 + {"pcid":1,"pt":[-126.44,45.56,56,5]} | 7 + {"pcid":1,"pt":[-126.43,45.57,57,5]} | 7 + {"pcid":1,"pt":[-126.42,45.58,58,5]} | 7 + {"pcid":1,"pt":[-126.41,45.59,59,5]} | 7 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_PCId +PC_FilterBetween ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_PCId(p pcpatch) returns integer: +:PC_FilterBetween(p pcpatch, dimname text, float8 value1, float8 value2) returns pcpatch: -Return the pcid schema number of points in this patch. +Returns a patch with only points whose values are between (excluding) the +supplied values for the requested dimension. -.. code-block:: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_FilterEquals +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SELECT PC_PCId(pa) FROM patches LIMIT 1; +:PC_FilterEquals(p pcpatch, dimname text, float8 value) returns pcpatch: - 1 +Returns a patch with only points whose values are the same as the supplied +values for the requested dimension. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_AsText +PC_FilterGreaterThan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_AsText(p pcpatch) returns text: +:PC_FilterGreaterThan(p pcpatch, dimname text, float8 value) returns pcpatch: -Return a JSON version of the data in that patch. +Returns a patch with only points whose values are greater than the supplied +value for the requested dimension. .. code-block:: - SELECT PC_AsText(pa) FROM patches LIMIT 1; + SELECT PC_AsText(PC_FilterGreaterThan(pa, 'y', 45.57)) + FROM patches WHERE id = 7; - {"pcid":1,"pts":[ - [-126.99,45.01,1,0],[-126.98,45.02,2,0],[-126.97,45.03,3,0], - [-126.96,45.04,4,0],[-126.95,45.05,5,0],[-126.94,45.06,6,0], - [-126.93,45.07,7,0],[-126.92,45.08,8,0],[-126.91,45.09,9,0] - ]} + {"pcid":1,"pts":[[-126.42,45.58,58,5],[-126.41,45.59,59,5]]} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_Summary +PC_FilterLessThan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_Summary(p pcpatch) returns text (from 1.1.0): - -Return a JSON formatted summary of the data in that point. - -.. code-block:: - - SELECT PC_Summary(pa) FROM patches LIMIT 1; +:PC_FilterLessThan(p pcpatch, dimname text, float8 value) returns pcpatch: - {"pcid":1, "npts":9, "srid":4326, "compr":"dimensional","dims":[{"pos":0,"name":"X","size":4,"type":"int32_t","compr":"sigbits","stats":{"min":-126.99,"max":-126.91,"avg":-126.95}},{"pos":1,"name":"Y","size":4,"type":"int32_t","compr":"sigbits","stats":{"min":45.01,"max":45.09,"avg":45.05}},{"pos":2,"name":"Z","size":4,"type":"int32_t","compr":"sigbits","stats":{"min":1,"max":9,"avg":5}},{"pos":3,"name":"Intensity","size":2,"type":"uint16_t","compr":"rle","stats":{"min":0,"max":0,"avg":0}}]} +Returns a patch with only points whose values are less than the supplied value +for the requested dimension. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_Uncompress +PC_Intersects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_Uncompress(p pcpatch) returns pcpatch: +:PC_Intersects(p1 pcpatch, p2 pcpatch) returns boolean: -Returns an uncompressed version of the patch (compression type ``none``). In -order to return an uncompressed patch on the wire, this must be the outer -function with return type pcpatch in your SQL query. All other functions that -return pcpatch will compress output to the schema-specified compression before -returning. +Returns true if the bounds of p1 intersect the bounds of p2. .. code-block:: - SELECT PC_Uncompress(pa) FROM patches - WHERE PC_NumPoints(pa) = 1; + -- Patch should intersect itself + SELECT PC_Intersects( + '01010000000000000001000000C8CEFFFFF8110000102700000A00'::pcpatch, + '01010000000000000001000000C8CEFFFFF8110000102700000A00'::pcpatch); - 01010000000000000001000000C8CEFFFFF8110000102700000A00 + t + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_IsSorted +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_IsSorted(p pcpatch, dimnames text[], strict boolean default true) returns boolean: +Checks whether a pcpatch is sorted lexicographically along the given +dimensions. The ``strict`` option further checks that the ordering is strict +(no duplicates). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_Union +PC_MakePatch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_Union(p pcpatch[]) returns pcpatch: +:PC_MakePatch(pcid integer, vals float8[]) returns pcpatch: -Aggregate function merges a result set of pcpatch entries into a single pcpatch. +Given a valid pcid schema number and an array of doubles that matches the +schema, construct a new pcpatch. Array size must be a multiple of the number of +dimensions. .. code-block:: - -- Compare npoints(sum(patches)) to sum(npoints(patches)) - SELECT PC_NumPoints(PC_Union(pa)) FROM patches; - SELECT Sum(PC_NumPoints(pa)) FROM patches; - - 100 + SELECT PC_AsText(PC_MakePatch(1, ARRAY[-126.99,45.01,1,0, -126.98,45.02,2,0, -126.97,45.03,3,0])); + {"pcid":1,"pts":[ + [-126.99,45.01,1,0],[-126.98,45.02,2,0],[-126.97,45.03,3,0] + ]} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_Intersects +PC_MemSize ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_Intersects(p1 pcpatch, p2 pcpatch) returns boolean: +:PC_MemSize(p pcpatch) returns int4: -Returns true if the bounds of p1 intersect the bounds of p2. +Returns the memory size of a pcpatch. .. code-block:: - -- Patch should intersect itself - SELECT PC_Intersects( - '01010000000000000001000000C8CEFFFFF8110000102700000A00'::pcpatch, - '01010000000000000001000000C8CEFFFFF8110000102700000A00'::pcpatch); + SELECT PC_MemSize(PC_Patch(PC_MakePoint(1, ARRAY[-127, 45, 124.0, 4.0]))); - t + 161 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_Explode +PC_NumPoints ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_Explode(p pcpatch) returns SetOf[pcpoint]: +:PC_NumPoints(p pcpatch) returns integer: -Set-returning function, converts patch into result set of one point record for -each point in the patch. +Returns the number of points in this patch. .. code-block:: - SELECT PC_AsText(PC_Explode(pa)), id - FROM patches WHERE id = 7; - - pc_astext | id - --------------------------------------+---- - {"pcid":1,"pt":[-126.5,45.5,50,5]} | 7 - {"pcid":1,"pt":[-126.49,45.51,51,5]} | 7 - {"pcid":1,"pt":[-126.48,45.52,52,5]} | 7 - {"pcid":1,"pt":[-126.47,45.53,53,5]} | 7 - {"pcid":1,"pt":[-126.46,45.54,54,5]} | 7 - {"pcid":1,"pt":[-126.45,45.55,55,5]} | 7 - {"pcid":1,"pt":[-126.44,45.56,56,5]} | 7 - {"pcid":1,"pt":[-126.43,45.57,57,5]} | 7 - {"pcid":1,"pt":[-126.42,45.58,58,5]} | 7 - {"pcid":1,"pt":[-126.41,45.59,59,5]} | 7 + SELECT PC_NumPoints(pa) FROM patches LIMIT 1; + 9 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_PatchMin +PC_PCId ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_PatchMin(p pcpatch, dimname text) returns numeric: +:PC_PCId(p pcpatch) returns integer: -Reads the values of the requested dimension for all points in the patch and -returns the minimum of those values. Dimension name must exist in the schema. +Returns the pcid schema number of points in this patch. .. code-block:: - SELECT PC_PatchMin(pa, 'y') - FROM patches WHERE id = 7; + SELECT PC_PCId(pa) FROM patches LIMIT 1; - 45.5 + 1 -:PC_PatchMin(p pcpatch) returns pcpoint: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_Patch +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Returns a PcPoint with the minimum values of each dimension in the patch. +:PC_Patch(pts pcpoint[]) returns pcpatch: -.. code-block:: +Aggregate function that collects a result set of pcpoint values into a pcpatch. - SELECT PC_PatchMin(pa) - FROM patches WHERE id = 7; +.. code-block:: - {"pcid":1,"pt":[-126.5,45.5,50,5]} + INSERT INTO patches (pa) + SELECT PC_Patch(pt) FROM points GROUP BY id/10; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PC_PatchAvg @@ -259,85 +266,61 @@ Returns a PcPoint with the maximum values of each dimension in the patch. {"pcid":1,"pt":[-126.41,45.59,59,5]} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_FilterGreaterThan +PC_PatchMin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_FilterGreaterThan(p pcpatch, dimname text, float8 value) returns pcpatch: +:PC_PatchMin(p pcpatch, dimname text) returns numeric: -Returns a patch with only points whose values are greater than the supplied -value for the requested dimension. +Reads the values of the requested dimension for all points in the patch and +returns the minimum of those values. Dimension name must exist in the schema. .. code-block:: - SELECT PC_AsText(PC_FilterGreaterThan(pa, 'y', 45.57)) + SELECT PC_PatchMin(pa, 'y') FROM patches WHERE id = 7; - {"pcid":1,"pts":[[-126.42,45.58,58,5],[-126.41,45.59,59,5]]} - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_FilterLessThan -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 45.5 -:PC_FilterLessThan(p pcpatch, dimname text, float8 value) returns pcpatch: +:PC_PatchMin(p pcpatch) returns pcpoint: -Returns a patch with only points whose values are less than the supplied value -for the requested dimension. +Returns a PcPoint with the minimum values of each dimension in the patch. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_FilterBetween -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. code-block:: -:PC_FilterBetween(p pcpatch, dimname text, float8 value1, float8 value2) returns pcpatch: + SELECT PC_PatchMin(pa) + FROM patches WHERE id = 7; -Returns a patch with only points whose values are between (excluding) the -supplied values for the requested dimension. + {"pcid":1,"pt":[-126.5,45.5,50,5]} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_FilterEquals +PC_PointN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_FilterEquals(p pcpatch, dimname text, float8 value) returns pcpatch: +:PC_PointN(p pcpatch, n int4) returns pcpoint: -Returns a patch with only points whose values are the same as the supplied -values for the requested dimension. +Returns the n-th point of the patch with 1-based indexing. Negative n counts +point from the end. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_Compress +PC_Range ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_Compress(p pcpatch,global_compression_scheme text,compression_config text) returns pcpatch: - -Compress a patch with a manually specified scheme. The compression_config -semantic depends on the global compression scheme. Allowed global compression -schemes are: - -- auto: determined by pcid -- laz: no compression config supported -- dimensional: configuration is a comma-separated list of per-dimension compressions from this list +:PC_Range(p pcpatch, start int4, n int4) returns pcpatch: - - auto: determined automatically from values stats - - zlib: deflate compression - - sigbits: significant bits removal - - rle: run-length encoding +Returns a patch containing n points. These points are selected from the +start-th point with 1-based indexing. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_PointN +PC_SetPCId ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_PointN(p pcpatch, n int4) returns pcpoint: - -Returns the n-th point of the patch with 1-based indexing. Negative n counts -point from the end. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_IsSorted -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +:PC_SetPCId(p pcpatch, pcid int4, def float8 default 0.0) returns pcpatch: -:PC_IsSorted(p pcpatch, dimnames text[], strict boolean default true) returns boolean: +Sets the schema on a ``PcPatch``, given a valid ``pcid`` schema number. -Checks whether a pcpatch is sorted lexicographically along the given -dimensions. The ``strict`` option further checks that the ordering is strict -(no duplicates). +For dimensions that are in the "new" schema but not in the "old" schema the +value ``def`` is set in the points of the output patch. ``def`` is optional, +its default value is ``0.0``. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PC_Sort @@ -349,25 +332,18 @@ Returns a copy of the input patch lexicographically sorted along the given dimensions. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_Range +PC_Summary ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_Range(p pcpatch, start int4, n int4) returns pcpatch: - -Returns a patch containing n points. These points are selected from the -start-th point with 1-based indexing. +:PC_Summary(p pcpatch) returns text (from 1.1.0): -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_SetPCId -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Returns a JSON formatted summary of the data in that point. -:PC_SetPCId(p pcpatch, pcid int4, def float8 default 0.0) returns pcpatch: +.. code-block:: -Sets the schema on a ``PcPatch``, given a valid ``pcid`` schema number. + SELECT PC_Summary(pa) FROM patches LIMIT 1; -For dimensions that are in the "new" schema but not in the "old" schema the -value ``def`` is set in the points of the output patch. ``def`` is optional, -its default value is ``0.0``. + {"pcid":1, "npts":9, "srid":4326, "compr":"dimensional","dims":[{"pos":0,"name":"X","size":4,"type":"int32_t","compr":"sigbits","stats":{"min":-126.99,"max":-126.91,"avg":-126.95}},{"pos":1,"name":"Y","size":4,"type":"int32_t","compr":"sigbits","stats":{"min":45.01,"max":45.09,"avg":45.05}},{"pos":2,"name":"Z","size":4,"type":"int32_t","compr":"sigbits","stats":{"min":1,"max":9,"avg":5}},{"pos":3,"name":"Intensity","size":2,"type":"uint16_t","compr":"rle","stats":{"min":0,"max":0,"avg":0}}]} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PC_Transform @@ -387,15 +363,37 @@ data if dimension interpretations, scales or offsets are different in the new schema. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_MemSize +PC_Uncompress ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_MemSize(p pcpatch) returns int4: +:PC_Uncompress(p pcpatch) returns pcpatch: -Return the memory size of a pcpatch. +Returns an uncompressed version of the patch (compression type ``none``). In +order to return an uncompressed patch on the wire, this must be the outer +function with return type pcpatch in your SQL query. All other functions that +return pcpatch will compress output to the schema-specified compression before +returning. .. code-block:: - SELECT PC_MemSize(PC_Patch(PC_MakePoint(1, ARRAY[-127, 45, 124.0, 4.0]))); + SELECT PC_Uncompress(pa) FROM patches + WHERE PC_NumPoints(pa) = 1; - 161 + 01010000000000000001000000C8CEFFFFF8110000102700000A00 + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_Union +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_Union(p pcpatch[]) returns pcpatch: + +Aggregate function merges a result set of pcpatch entries into a single pcpatch. + +.. code-block:: + + -- Compare npoints(sum(patches)) to sum(npoints(patches)) + SELECT PC_NumPoints(PC_Union(pa)) FROM patches; + SELECT Sum(PC_NumPoints(pa)) FROM patches; + + 100 diff --git a/doc/functions/points.rst b/doc/functions/points.rst index a12464ac..f4441050 100644 --- a/doc/functions/points.rst +++ b/doc/functions/points.rst @@ -4,6 +4,45 @@ PcPoint ******************************************************************************** +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_AsText +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_AsText(p pcpoint) returns text: + +Returns a JSON version of the data in that point. + +.. code-block:: + + SELECT PC_AsText('010100000064CEFFFF94110000703000000400'::pcpoint); + + {"pcid":1,"pt":[-127,45,124,4]} + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_Get +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_Get(pt pcpoint) returns float8[]: + +Returns values of all dimensions in an array. + +.. code-block:: + + SELECT PC_Get('010100000064CEFFFF94110000703000000400'::pcpoint); + + {-127,45,124,4} + +:PC_Get(pt pcpoint, dimname text) returns numeric: + +Returns the numeric value of the named dimension. The dimension name must exist +in the schema. + +.. code-block:: + + SELECT PC_Get('010100000064CEFFFF94110000703000000400'::pcpoint, 'Intensity'); + + 4 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PC_MakePoint ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -35,19 +74,18 @@ Insert some test values into the points table: ) AS values; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_AsText +PC_MemSize ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_AsText(p pcpoint) returns text: +:PC_MemSize(pt pcpoint) returns int4: -Return a JSON version of the data in that point. +Returns the memory size of a pcpoint. .. code-block:: - SELECT PC_AsText('010100000064CEFFFF94110000703000000400'::pcpoint); - - {"pcid":1,"pt":[-127,45,124,4]} + SELECT PC_MemSize(PC_MakePoint(1, ARRAY[-127, 45, 124.0, 4.0])); + 25 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PC_PCId @@ -55,49 +93,10 @@ PC_PCId :PC_PCId(p pcpoint) returns integer (from 1.1.0): -Return the pcid schema number of this point. +Returns the pcid schema number of this point. .. code-block:: SELECT PC_PCId('010100000064CEFFFF94110000703000000400'::pcpoint); 1 - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_Get -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -:PC_Get(pt pcpoint) returns float8[]: - -Return values of all dimensions in an array. - -.. code-block:: - - SELECT PC_Get('010100000064CEFFFF94110000703000000400'::pcpoint); - - {-127,45,124,4} - -:PC_Get(pt pcpoint, dimname text) returns numeric: - -Return the numeric value of the named dimension. The dimension name must exist -in the schema. - -.. code-block:: - - SELECT PC_Get('010100000064CEFFFF94110000703000000400'::pcpoint, 'Intensity'); - - 4 - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_MemSize -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -:PC_MemSize(pt pcpoint) returns int4: - -Return the memory size of a pcpoint. - -.. code-block:: - - SELECT PC_MemSize(PC_MakePoint(1, ARRAY[-127, 45, 124.0, 4.0])); - - 25 diff --git a/doc/functions/postgis.rst b/doc/functions/postgis.rst index 8d272f3d..6065501a 100644 --- a/doc/functions/postgis.rst +++ b/doc/functions/postgis.rst @@ -1,4 +1,4 @@ -.. _points: +.. _postgis: ******************************************************************************** PostGIS @@ -17,61 +17,55 @@ Geometry and doing spatial filtering on point cloud data. The CREATE EXTENSION pointcloud_postgis; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_Intersects +Geometry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_Intersects(p pcpatch, g geometry) returns boolean: +:Geometry(pcpoint) returns geometry: -:PC_Intersects(g geometry, p pcpatch) returns boolean: +:pcpoint::geometry returns geometry: -Returns true if the bounds of the patch intersect the geometry. +Casts ``PcPoint`` to the PostGIS geometry equivalent, placing the x/y/z/m of the +``PcPoint`` into the x/y/z/m of the PostGIS point. .. code-block:: - SELECT PC_Intersects('SRID=4326;POINT(-126.451 45.552)'::geometry, pa) - FROM patches WHERE id = 7; + SELECT ST_AsText(PC_MakePoint(1, ARRAY[-127, 45, 124.0, 4.0])::geometry); - t + POINT Z (-127 45 124) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_Intersection +PC_BoundingDiagonalGeometry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_Intersection(pcpatch, geometry) returns pcpatch: +:PC_BoundingDiagonalGeometry(pcpatch) returns geometry: -Returns a PcPatch which only contains points that intersected the geometry. +Returns the bounding diagonal of a patch. This is a LineString (2D), a +LineString Z or a LineString M or a LineString ZM, based on the existence of +the Z and M dimensions in the patch. This function is useful for creating an +index on a patch column. .. code-block:: - SELECT PC_AsText(PC_Explode(PC_Intersection( - pa, - 'SRID=4326;POLYGON((-126.451 45.552, -126.42 47.55, -126.40 45.552, -126.451 45.552))'::geometry - ))) - FROM patches WHERE id = 7; - - pc_astext - -------------------------------------- - {"pcid":1,"pt":[-126.44,45.56,56,5]} - {"pcid":1,"pt":[-126.43,45.57,57,5]} - {"pcid":1,"pt":[-126.42,45.58,58,5]} - {"pcid":1,"pt":[-126.41,45.59,59,5]} - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Geometry -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -:Geometry(pcpoint) returns geometry: - -:pcpoint::geometry returns geometry: + SELECT ST_AsText(PC_BoundingDiagonalGeometry(pa)) FROM patches; + st_astext + ------------------------------------------------ + LINESTRING Z (-126.99 45.01 1,-126.91 45.09 9) + LINESTRING Z (-126 46 100,-126 46 100) + LINESTRING Z (-126.2 45.8 80,-126.11 45.89 89) + LINESTRING Z (-126.4 45.6 60,-126.31 45.69 69) + LINESTRING Z (-126.3 45.7 70,-126.21 45.79 79) + LINESTRING Z (-126.8 45.2 20,-126.71 45.29 29) + LINESTRING Z (-126.5 45.5 50,-126.41 45.59 59) + LINESTRING Z (-126.6 45.4 40,-126.51 45.49 49) + LINESTRING Z (-126.9 45.1 10,-126.81 45.19 19) + LINESTRING Z (-126.7 45.3 30,-126.61 45.39 39) + LINESTRING Z (-126.1 45.9 90,-126.01 45.99 99) -Casts ``PcPoint`` to the PostGIS geometry equivalent, placing the x/y/z/m of the -``PcPoint`` into the x/y/z/m of the PostGIS point. +For example, this is how one may want to create an index: .. code-block:: - SELECT ST_AsText(PC_MakePoint(1, ARRAY[-127, 45, 124.0, 4.0])::geometry); - - POINT Z (-127 45 124) + CREATE INDEX ON patches USING GIST(PC_BoundingDiagonalGeometry(patch) gist_geometry_ops_nd); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PC_EnvelopeGeometry @@ -94,37 +88,42 @@ For example, this is how one may want to create an index: CREATE INDEX ON patches USING GIST(PC_EnvelopeGeometry(patch)); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_BoundingDiagonalGeometry +PC_Intersection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:PC_BoundingDiagonalGeometry(pcpatch) returns geometry: +:PC_Intersection(pcpatch, geometry) returns pcpatch: -Returns the bounding diagonal of a patch. This is a LineString (2D), a -LineString Z or a LineString M or a LineString ZM, based on the existence of -the Z and M dimensions in the patch. This function is useful for creating an -index on a patch column. +Returns a PcPatch which only contains points that intersected the geometry. .. code-block:: - SELECT ST_AsText(PC_BoundingDiagonalGeometry(pa)) FROM patches; - st_astext - ------------------------------------------------ - LINESTRING Z (-126.99 45.01 1,-126.91 45.09 9) - LINESTRING Z (-126 46 100,-126 46 100) - LINESTRING Z (-126.2 45.8 80,-126.11 45.89 89) - LINESTRING Z (-126.4 45.6 60,-126.31 45.69 69) - LINESTRING Z (-126.3 45.7 70,-126.21 45.79 79) - LINESTRING Z (-126.8 45.2 20,-126.71 45.29 29) - LINESTRING Z (-126.5 45.5 50,-126.41 45.59 59) - LINESTRING Z (-126.6 45.4 40,-126.51 45.49 49) - LINESTRING Z (-126.9 45.1 10,-126.81 45.19 19) - LINESTRING Z (-126.7 45.3 30,-126.61 45.39 39) - LINESTRING Z (-126.1 45.9 90,-126.01 45.99 99) + SELECT PC_AsText(PC_Explode(PC_Intersection( + pa, + 'SRID=4326;POLYGON((-126.451 45.552, -126.42 47.55, -126.40 45.552, -126.451 45.552))'::geometry + ))) + FROM patches WHERE id = 7; -For example, this is how one may want to create an index: + pc_astext + -------------------------------------- + {"pcid":1,"pt":[-126.44,45.56,56,5]} + {"pcid":1,"pt":[-126.43,45.57,57,5]} + {"pcid":1,"pt":[-126.42,45.58,58,5]} + {"pcid":1,"pt":[-126.41,45.59,59,5]} + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_Intersects +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_Intersects(p pcpatch, g geometry) returns boolean: + +:PC_Intersects(g geometry, p pcpatch) returns boolean: + +Returns true if the bounds of the patch intersect the geometry. .. code-block:: - CREATE INDEX ON patches USING GIST(PC_BoundingDiagonalGeometry(patch) gist_geometry_ops_nd); + SELECT PC_Intersects('SRID=4326;POINT(-126.451 45.552)'::geometry, pa) + FROM patches WHERE id = 7; + + t diff --git a/doc/functions/schema.rst b/doc/functions/schema.rst new file mode 100644 index 00000000..97c5925e --- /dev/null +++ b/doc/functions/schema.rst @@ -0,0 +1,33 @@ +.. _schema: + +******************************************************************************** +Schema +******************************************************************************** + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_SchemaGetNDims +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_SchemaGetNDims(pcid integer) returns integer: + +Return the number of dimensions in the corresponding schema. + +.. code-block:: + + SELECT PC_SchemaGetNDims(1); + + 18 + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_SchemaIsValid +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_SchemaIsValid(xml text) returns boolean: + +Return `true` if the pointcloud schema is valid. + +.. code-block:: + + SELECT PC_SchemaIsValid(schema) FROM pointcloud_formats LIMIT 1; + + t diff --git a/doc/functions/utils.rst b/doc/functions/utils.rst new file mode 100644 index 00000000..37a48036 --- /dev/null +++ b/doc/functions/utils.rst @@ -0,0 +1,120 @@ +.. _utils: + +******************************************************************************** +Utils +******************************************************************************** + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_Full_Version +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_Full_Version() returns text: + +Return a composite version string summarizing pointcloud system components. +Includes library, SQL, libxml2, PostgreSQL interface versions, and LAZperf +support flag. Useful for debugging or verifying runtime compatibility of the +pointcloud extension. + +.. code-block:: + + SELECT PC_Full_Version(); + + POINTCLOUD="1.2.5 2346cc2" PGSQL="170" LIBXML2="2.14.3 LAZPERF enabled=false + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_Lazperf_Enabled +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_Lazperf_Enabled() returns boolean: + +Return `true` if the pointcloud extension includes LAZperf compression support. + +.. code-block:: + + SELECT PC_Lazperf_Enabled(); + + t + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_LibXML2_Version +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_LibXML2_Version() returns text: + +Return the `libxml2` version number. + +.. code-block:: + + SELECT PC_LibXML2_Version(); + + 2.14.3 + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_Lib_Version +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_Lib_Version() returns text: + +Return the library version number. + +.. code-block:: + + SELECT PC_Lib_Version(); + + 1.2.5 2346cc2 + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_PGSQL_Version +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_PGSQL_Version() returns text: + +Return the `pgsql` version number. + +.. code-block:: + + SELECT PC_PGSQL_Version(); + + 170 + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_PostGIS_Version +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_PostGIS_Version() returns text: + +Return the PostGIS extension version number. + +.. code-block:: + + SELECT PC_PostGIS_Version(); + + 1.2.5 + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_Script_Version +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_Script_Version() returns text: + +Return the script version number. + +.. code-block:: + + SELECT PC_Script_Version(); + + 1.2.5 + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_Version +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_Version() returns text: + +Return the extension version number. + +.. code-block:: + + SELECT PC_Version(); + + 1.2.5 diff --git a/doc/functions/wkb.rst b/doc/functions/wkb.rst index 2f2100ac..7cc1634c 100644 --- a/doc/functions/wkb.rst +++ b/doc/functions/wkb.rst @@ -1,4 +1,4 @@ -.. _points: +.. _wkb: ******************************************************************************** WKB @@ -18,6 +18,20 @@ Return the OGC "well-known binary" format for the point. \x01010000800000000000c05fc000000000008046400000000000005f40 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PC_BoundingDiagonalAsBinary +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:PC_BoundingDiagonalAsBinary(p pcpatch) returns bytea: + +Return the OGC "well-known binary" format for the bounding diagonal of the +patch. + +.. code-block:: + + SELECT PC_BoundingDiagonalAsBinary( PC_Patch(ARRAY[ PC_MakePoint(1, ARRAY[0.,0.,0.,10.]), PC_MakePoint(1, ARRAY[1.,1.,1.,10.]), PC_MakePoint(1, ARRAY[10.,10.,10.,10.])])); + + \x01020000a0e610000002000000000000000000000000000000000000000000000000000000000000000000244000000000000024400000000000002440 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PC_EnvelopeAsBinary @@ -40,18 +54,3 @@ Useful for performing 2D intersection tests with geometries. ``PC_Envelope`` is an alias to ``PC_EnvelopeAsBinary``. But ``PC_Envelope`` is deprecated and will be removed in a future version (2.0) of the extension. ``PC_EnvelopeAsBinary`` is to be used instead. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -PC_BoundingDiagonalAsBinary -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -:PC_BoundingDiagonalAsBinary(p pcpatch) returns bytea: - -Return the OGC "well-known binary" format for the bounding diagonal of the -patch. - -.. code-block:: - - SELECT PC_BoundingDiagonalAsBinary( PC_Patch(ARRAY[ PC_MakePoint(1, ARRAY[0.,0.,0.,10.]), PC_MakePoint(1, ARRAY[1.,1.,1.,10.]), PC_MakePoint(1, ARRAY[10.,10.,10.,10.])])); - - \x01020000a0e610000002000000000000000000000000000000000000000000000000000000000000000000244000000000000024400000000000002440