mirror of
https://github.com/pgpointcloud/pointcloud.git
synced 2025-12-08 20:36:04 +00:00
Rejigging
This commit is contained in:
parent
b87389e818
commit
3655ec0ab2
@ -83,6 +83,13 @@ enum DIMCOMPRESSIONS {
|
||||
PC_DIM_ZLIB = 3
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
PC_GT,
|
||||
PC_LT,
|
||||
PC_EQUALS,
|
||||
PC_BETWEEN
|
||||
} PC_FILTERTYPE;
|
||||
|
||||
/** What is the endianness of this system? */
|
||||
char machine_endian(void);
|
||||
|
||||
@ -222,6 +229,7 @@ uint64_t pc_bytes_sigbits_count_64(const PCBYTES *pcb, uint32_t *nsigbits);
|
||||
/** Initialize with very large mins and very small maxes */
|
||||
void pc_bounds_init(PCBOUNDS *b);
|
||||
PCSTATS* pc_stats_clone(const PCSTATS *stats);
|
||||
size_t pc_stats_size(const PCSCHEMA *schema);
|
||||
|
||||
|
||||
#endif /* _PC_API_INTERNAL_H */
|
||||
58
lib/pc_filter.c
Normal file
58
lib/pc_filter.c
Normal file
@ -0,0 +1,58 @@
|
||||
/***********************************************************************
|
||||
* pc_filter.c
|
||||
*
|
||||
* Pointclound patch filtering.
|
||||
*
|
||||
* Copyright (c) 2013 OpenGeo
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
#include "pc_api_internal.h"
|
||||
|
||||
typedef PC_BITMAP uint8_t;
|
||||
|
||||
static PC_BITMAP *
|
||||
pc_bitmap_new(uint32_t npoints)
|
||||
{
|
||||
if ( npoints == 0 )
|
||||
return NULL
|
||||
else
|
||||
return (PC_BITMAP*)pcalloc(sizeof(PC_BITMAP)*npoints);
|
||||
}
|
||||
static void
|
||||
pc_bitmap_free(PCBITMAP *map)
|
||||
{
|
||||
pcfree(map);
|
||||
}
|
||||
|
||||
static PC_BITMAP *
|
||||
pc_patch_uncompressed_bitmap(const PCPATCH *pa, PC_FILTERTYPE filter, double val1, double val2)
|
||||
{
|
||||
int i;
|
||||
PCPOINT pt;
|
||||
pt.readonly = PC_TRUE;
|
||||
pt.schema = pa->schema;
|
||||
uint8_t *buf = pa->data
|
||||
|
||||
for ( i = 0; i < pa->npoints; i++ )
|
||||
{
|
||||
pt.data = pa->
|
||||
}
|
||||
|
||||
PC_BITMAP *
|
||||
pc_patch_bitmap(const PCPATCH *pa, PC_FILTERTYPE filter, double val1, double val2)
|
||||
{
|
||||
if ( ! pa ) return NULL;
|
||||
switch ( pa->type )
|
||||
{
|
||||
case PC_NONE:
|
||||
return pc_patch_uncompressed_bitmap((PCPATCH_UNCOMPRESSED*)pa, filter, val1, val2);
|
||||
case PC_GHT:
|
||||
// return pc_patch_ght_bitmap((PCPATCH_GHT*)pa, filter, val1, val2);
|
||||
case PC_DIMENSIONAL:
|
||||
// return pc_patch_dimensional_bitmap((PCPATCH_DIMENSIONAL*)pa, filter, val1, val2);
|
||||
default:
|
||||
pc_error("%s: failure", __func__);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -285,4 +285,5 @@ pc_patch_dimensional_from_pointlist(const PCPOINTLIST *pdl)
|
||||
PCPATCH_DIMENSIONAL *dimpatch = pc_patch_dimensional_from_uncompressed(patch);
|
||||
pc_patch_uncompressed_free(patch);
|
||||
return dimpatch;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -405,3 +405,4 @@ pc_patch_uncompressed_add_point(PCPATCH_UNCOMPRESSED *c, const PCPOINT *p)
|
||||
|
||||
return PC_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
/***********************************************************************
|
||||
* pc_stats.c
|
||||
*
|
||||
* Pointclound schema handling. Parse and emit the XML format for
|
||||
* representing packed multidimensional point data.
|
||||
* Pointclound patch statistics generation.
|
||||
*
|
||||
* Copyright (c) 2013 OpenGeo
|
||||
*
|
||||
@ -203,6 +202,11 @@ pc_patch_uncompressed_compute_stats(PCPATCH_UNCOMPRESSED *pa)
|
||||
return PC_SUCCESS;
|
||||
}
|
||||
|
||||
size_t
|
||||
pc_stats_size(const PCSCHEMA *schema)
|
||||
{
|
||||
return 3*schema->size;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user