Static Point Clouds

The static types come from pgPointCloud. MobilityDB exposes the schema-aware coordinate accessors needed to project pgPointCloud values into the rest of the temporal-types ecosystem.

Constructors

pgPointCloud's pcpoint_in only accepts hex-WKB, so the canonical builder is PC_MakePoint(pcid, ARRAY[…]::float[]). MobilityDB ships two thin SQL overloads on top of it for shorter test literals and ad-hoc queries; the underlying schema-dimension validation still happens inside PC_MakePoint.

  • Build a 2D or 3D pcpoint directly from x/y(/z) coordinates

    pcpoint(pcid integer,x float,y float) → pcpoint
    pcpoint(pcid integer,x float,y float,z float) → pcpoint
    
    SELECT pcpoint(1, 10.0, 20.0, 30.0);
    -- Equivalent to pcpoint(1, 10.0, 20.0, 30.0)
    
  • Build a pcpoint from the coordinates of every dimension of the schema

    pcpoint(pcid integer,coordinates float[]) → pcpoint
    

    The layout of the schema states every dimension, inactive ones included, which is how a schema of more dimensions than the overloads above reach is given its values. That count is the one PC_MakePoint takes and is NOT the count of active dimensions that pointCloudSchemaNDims reports

    SELECT pcpoint(1, ARRAY[10.0, 20.0, 30.0]::float[]);
    
  • Build a pcpatch from the coordinates of its points, one point after another

    pcpatch(pcid integer,coordinates float[]) → pcpatch
    

    Every dimension of the layout of the schema is given for each point, inactive ones included. That count is the one PC_MakePatch takes and is NOT the count of active dimensions that pointCloudSchemaNDims reports; a count that divides evenly by the wrong one of the two builds a patch of the wrong points rather than reporting an error. A patch built this way states the schema itself, there being no point to read it from

    SELECT pcpatch(1, ARRAY[1.0, 1.0, 1.0, 2.0, 2.0, 2.0]::float[]);
    
  • Build a pcpatch from a variadic list of pcpoints sharing the same pcid

    pcpatch(VARIADIC points pcpoint[]) → pcpatch
    
    SELECT pcpatch(pcpoint(1, 1.0, 1.0, 1.0), pcpoint(1, 2.0, 2.0, 2.0));
    -- Equivalent to pcpatch(pcpoint(1, 1.0, 1.0, 1.0), pcpoint(1, 2.0, 2.0, 2.0))
    

Accessors

  • Return the schema id of a pcpoint or pcpatch

    pcid({pcpoint,pcpatch}) → integer
    
    SELECT pcid(pcpoint(1, 10.0, 20.0, 30.0));
    -- 1
    
  • Return a coordinate of a pcpoint, NULL if the dimension is absent from the schema

    getX(pcpoint) → float
    getY(pcpoint) → float
    getZ(pcpoint) → float
    
    WITH pt AS (SELECT pcpoint(1, 10.0, 20.0, 30.0) p)
      SELECT getX(p), getY(p), getZ(p) FROM pt;
    -- 10 | 20 | 30
    
  • Return any named dimension of a pcpoint, NULL if the name is unknown for the schema

    getDim(pcpoint,text) → float
    
    SELECT getDim(pcpoint(1, 10.0, 20.0, 30.0), 'X');
    -- 10
    
  • Return the spatial reference identifier (inherited from the schema)

    SRID({pcpoint,pcpatch}) → integer
    
    SELECT SRID(pcpoint(1, 10.0, 20.0, 30.0));
    -- 0
    SELECT SRID(pcpatch(pcpoint(1, 10.0, 20.0, 30.0), pcpoint(1, 11.0, 21.0, 31.0)));
    -- 0
    
  • Return the multipoint of the positions the points of a patch occupy

    geometry(pcpatch) → geometry
    

    The schema the pcid names decides the SRID and whether the result carries a Z dimension

    SELECT ST_AsText(geometry(pcpatch(pcpoint(1, 1, 1, 1), pcpoint(1, 2, 2, 2))));
    -- MULTIPOINT Z ((1 1 1),(2 2 2))