Initial commit, extension framework, dumb headers,

BSD license.
This commit is contained in:
Paul Ramsey 2013-01-07 12:57:20 -08:00
parent 0cc6098928
commit be2ceb8554
7 changed files with 141 additions and 3 deletions

30
COPYRIGHT Normal file
View File

@ -0,0 +1,30 @@
Copyright (c) 2012, OpenGeo
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
Neither the name of the OpenGeo nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

17
Makefile Normal file
View File

@ -0,0 +1,17 @@
# pointcloud
MODULE_big = pointcloud
OBJS= pc_core.o
EXTENSION = pointcloud
DATA = pointcloud--1.0.sql
REGRESS = pointcloud
SHLIB_LINK += $(filter -lm, $(LIBS))
# We are going to use PGXS for sure
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)

View File

@ -1,4 +1,11 @@
pointcloud
==========
Point Cloud
===========
A PostgreSQL extension for storing point cloud (LIDAR) data.
Requires
========
- PostgreSQL 9.1+ (support for extensions)
- PostgreSQL compiled --with-xml
A PostgreSQL extension for storing point cloud (LIDAR) data.

10
pc_core.c Normal file
View File

@ -0,0 +1,10 @@
/***********************************************************************
* pc_core.c
*
* Core routines for point clouds
*
* Portions Copyright (c) 2012, OpenGeo
*
***********************************************************************/
#include "pc_core.h"

46
pc_core.h Normal file
View File

@ -0,0 +1,46 @@
/***********************************************************************
* pc_core.h
*
* Structures and function signatures for point clouds
*
* Portions Copyright (c) 2012, OpenGeo
*
***********************************************************************/
/* PostgreSQL types and functions */
#include "postgres.h"
/**
* Point type for clouds. Variable length, because there can be
* an arbitrary number of dimensions. The pcid is a foreign key
* reference to the POINTCLOUD_REFERENCE_SYSTEMS table, where
* the underlying structure of the data is described in XML,
* the spatial reference system is indicated, and the data
* packing scheme is indicated.
*/
typedef struct
{
uint32 size; /* PgSQL VARSIZE */
uint16 pcid;
uint8 data[1];
} PCPOINT;
/**
* Generic patch type (collection of points) for clouds.
* Variable length, because there can be
* an arbitrary number of points encoded within.
* The pcid is a foriegn key reference to the
* POINTCLOUD_REFERENCE_SYSTEMS table, where
* the underlying structure of the data is described in XML,
* the spatial reference system is indicated, and the data
* packing scheme is indicated.
*/
typedef struct
{
uint32 size; /* PgSQL VARSIZE */
uint16 pcid;
uint32 npoints;
uint8 data[1];
} PCPATCH;

21
pointcloud--1.0.sql Normal file
View File

@ -0,0 +1,21 @@
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION pointcloud" to load this file. \quit
-- We need this for every point cloud, so we won't bury it in the XML
CREATE DOMAIN pointcloud_compression AS TEXT
CHECK (
VALUE = 'GHT' OR
VALUE = 'NONE'
);
-- Metadata table describing contents of pcpoints
CREATE TABLE pointcloud_formats (
pcid INTEGER PRIMARY KEY,
srid INTEGER, -- REFERENCE spatial_ref_sys(srid)
compression pointcloud_compression,
format XML
);
-- Register pointcloud_formats table so the contents are included in pg_dump output
SELECT pg_catalog.pg_extension_config_dump('pointcloud_formats', '');

7
pointcloud.control Normal file
View File

@ -0,0 +1,7 @@
# pointcloud extension
comment = 'data type for lidar point clouds'
default_version = '1.0'
module_pathname = '$libdir/pointcloud'
relocatable = true
superuser = true
#requires = 'postgis'