]> granicus.if.org Git - postgis/commitdiff
Added CHIP info
authorDavid Blasby <dblasby@gmail.com>
Fri, 2 Nov 2001 23:00:15 +0000 (23:00 +0000)
committerDavid Blasby <dblasby@gmail.com>
Fri, 2 Nov 2001 23:00:15 +0000 (23:00 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@102 b70326c6-7e19-0410-871a-916f4a2858ee

Makefile
postgis.h
postgis.sql.in

index 1baecddff1b2f3bf77874165b3fc5a91b4e95e60..40181e363bc108c69bbaf70f52818b2c1f7397b4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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
index c65f5b4707a20963542b608a13d5540f4768a151..1d02fbc1e35e40c8fb2f6627dec219a88a4870c2 100644 (file)
--- a/postgis.h
+++ b/postgis.h
@@ -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*);
index e6f64d32fbba2a5bc1a73d5c609be4536d1e30a5..2749b37d696fd76f53c4743b6cb2abc8e9eb0195 100644 (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