Added CHIP info

git-svn-id: http://svn.osgeo.org/postgis/trunk@102 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
David Blasby 2001-11-02 23:00:15 +00:00
parent 222f3f5a15
commit 0da16fbc3f
3 changed files with 86 additions and 2 deletions

View file

@ -26,7 +26,7 @@ SO_MINOR_VERSION=6
override CPPFLAGS := -g -I$(srcdir) $(CPPFLAGS) -DFRONTEND -DSYSCONFDIR='"$(sysconfdir)"'
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
OBJS=postgis_debug.o postgis_ops.o postgis_fn.o postgis_inout.o postgis_proj.o
OBJS=postgis_debug.o postgis_ops.o postgis_fn.o postgis_inout.o postgis_proj.o postgis_chip.o
# Add libraries that libpq depends (or might depend) on into the
# shared library link. (The order in which you list them here doesn't

View file

@ -184,6 +184,25 @@ typedef struct
} GEOMETRY;
typedef struct {
int32 size; //postgresql varlength header
int32 endian_hint; // number '1' in the endian of this structure
BOX3D bvol;
int32 SRID;
char future[8]; // for future expantion
int32 datatype; // 1 = float32 (XDR), 2 = unsigned int (XDR), 3 = RGBA, 4 = signed integer (XDR)
// 11 = float32(NDR), 22 = unsigned int (NDR), 44 = signed integer (NDR)
int32 height;
int32 width;
int32 compression; // 0 = no compression
// this is provided for convenience, it should be set to
// sizeof(chip) bytes into the struct because the serialized form is:
// <header><data>
unsigned int *data; // data[0] = bottm left, data[width] = 1st pixel, 2nd row
} CHIP;
//for GiST indexing
//This is the BOX type from geo_decls.h
@ -424,6 +443,15 @@ Datum postgis_gist_sel(PG_FUNCTION_ARGS);
Datum WKB_in(PG_FUNCTION_ARGS);
Datum WKB_out(PG_FUNCTION_ARGS);
Datum CHIP_in(PG_FUNCTION_ARGS);
Datum CHIP_out(PG_FUNCTION_ARGS);
Datum CHIP_to_geom(PG_FUNCTION_ARGS);
Datum srid_chip(PG_FUNCTION_ARGS);
Datum setsrid_chip(PG_FUNCTION_ARGS);
Datum width_chip(PG_FUNCTION_ARGS);
Datum height_chip(PG_FUNCTION_ARGS);
Datum datatype_chip(PG_FUNCTION_ARGS);
Datum compression_chip(PG_FUNCTION_ARGS);
//for GIST index
typedef char* (*BINARY_UNION)(char*, char*, int*);

View file

@ -259,6 +259,62 @@ CREATE TYPE WKB (
storage= extended
);
create function CHIP_in(opaque)
RETURNS CHIP
AS '@MODULE_FILENAME@','CHIP_in'
LANGUAGE 'c' with (isstrict);
create function CHIP_out(opaque)
RETURNS opaque
AS '@MODULE_FILENAME@','CHIP_out'
LANGUAGE 'c' with (isstrict);
CREATE TYPE CHIP (
alignment = double,
internallength = VARIABLE,
input = CHIP_in,
output = CHIP_out,
storage= extended
);
create function geometry(CHIP)
RETURNS GEOMETRY
AS '@MODULE_FILENAME@','CHIP_to_geom'
LANGUAGE 'c' with (isstrict,iscachable);
CREATE FUNCTION srid(chip)
RETURNS INT4
AS '@MODULE_FILENAME@','srid_chip'
LANGUAGE 'c' with (isstrict);
CREATE FUNCTION height(chip)
RETURNS INT4
AS '@MODULE_FILENAME@','height_chip'
LANGUAGE 'c' with (isstrict);
CREATE FUNCTION width(chip)
RETURNS INT4
AS '@MODULE_FILENAME@','width_chip'
LANGUAGE 'c' with (isstrict);
CREATE FUNCTION datatype(chip)
RETURNS INT4
AS '@MODULE_FILENAME@','datatype_chip'
LANGUAGE 'c' with (isstrict);
CREATE FUNCTION compression(chip)
RETURNS INT4
AS '@MODULE_FILENAME@','compression_chip'
LANGUAGE 'c' with (isstrict);
CREATE FUNCTION setSRID(chip,int4)
RETURNS chip
AS '@MODULE_FILENAME@','setsrid_chip'
LANGUAGE 'c' with (isstrict);
create function geometry_in(opaque)
@ -443,7 +499,7 @@ CREATE FUNCTION geometryfromtext(geometry,int4)
CREATE FUNCTION setSRID(geometry,int4)
RETURNS geometry
AS '@MODULE_FILENAME@','geometry_from_text'
LANGUAGE 'c' with (isstrict,iscachable);
LANGUAGE 'c' with (isstrict);
------- spheroid calcs