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
} 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
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*);
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)
CREATE FUNCTION setSRID(geometry,int4)
RETURNS geometry
AS '@MODULE_FILENAME@','geometry_from_text'
- LANGUAGE 'c' with (isstrict,iscachable);
+ LANGUAGE 'c' with (isstrict);
------- spheroid calcs