From 424a6fde1a78d6f3a8e5bdf732eed111734c51ed Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Wed, 8 Sep 2004 16:34:36 +0000 Subject: [PATCH] some bug fixes... geometry_analyze added git-svn-id: http://svn.osgeo.org/postgis/trunk@788 b70326c6-7e19-0410-871a-916f4a2858ee --- lwgeom/TODO | 7 +++++-- lwgeom/lwgeom_inout.c | 11 +++++------ lwgeom/lwpostgis.sql.in | 8 +++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lwgeom/TODO b/lwgeom/TODO index a0daedf96..58eeed06f 100644 --- a/lwgeom/TODO +++ b/lwgeom/TODO @@ -1,11 +1,14 @@ + +- WKB: what to do with that ? do we want to keep it as a type ? + +- size computation functions for deserialized objects + - Implement lwexploded_serialize_buf for speedup of GEOS<=>POSTGIS conversion and more! - box extractor functions writing to a pointer or returning an actual object should probably find a way to return NULL (for empty geometries). -- WKB: what to do with that ? do we want to keep it as a type ? - - Check spheroid misure functions o can't understand if 3d computation works since I get same result w/ 2d and 3d. diff --git a/lwgeom/lwgeom_inout.c b/lwgeom/lwgeom_inout.c index a86a35a43..f974189bc 100644 --- a/lwgeom/lwgeom_inout.c +++ b/lwgeom/lwgeom_inout.c @@ -12,6 +12,9 @@ #include "fmgr.h" #include "utils/elog.h" +#if USE_VERSION > 73 +# include "lib/stringinfo.h" // for binary input +#endif #include "lwgeom.h" @@ -30,11 +33,6 @@ extern unsigned char parse_hex(char *str); extern void deparse_hex(unsigned char str, unsigned char *result); extern char *parse_lwgeom_wkt(char *wkt_input); - -// 3d or 4d. There is NOT a (x,y,m) point type!!! -#define WKB3DOFFSET 0x80000000 -#define WKB4DOFFSET 0x40000000 - Datum LWGEOMFromWKB(PG_FUNCTION_ARGS); Datum WKBFromLWGEOM(PG_FUNCTION_ARGS); @@ -92,7 +90,8 @@ Datum LWGEOM_in(PG_FUNCTION_ARGS) { //its WKB //PG_RETURN_POINTER(parse_lwgeom_serialized_form(str)); - PG_RETURN_POINTER( parse_lwgeom_wkt(str) ); // this function handles wkt and wkb (in hex-form) + // this function handles wkt and wkb (in hex-form) + PG_RETURN_POINTER( parse_lwgeom_wkt(str) ); } else if ( (start == 'P') || (start == 'L') || (start == 'M') || (start == 'G') || (start == 'p') || (start == 'l') || diff --git a/lwgeom/lwpostgis.sql.in b/lwgeom/lwpostgis.sql.in index 182e8c993..beb27142b 100644 --- a/lwgeom/lwpostgis.sql.in +++ b/lwgeom/lwpostgis.sql.in @@ -104,6 +104,9 @@ CREATE TYPE geometry ( internallength = variable, input = geometry_in, output = geometry_out, +#if USE_VERSION >= 80 + analyze = geometry_analyze, +#endif // USE_VERSION >= 80 storage = main ); @@ -1053,11 +1056,6 @@ CREATEFUNCTION AsText(geometry) AS '@MODULE_FILENAME@','LWGEOM_asText' LANGUAGE 'C' WITH (isstrict,iscachable); -CREATEFUNCTION GeometryFromText(geometry, int4) - RETURNS geometry - AS '@MODULE_FILENAME@','LWGEOM_from_text' - LANGUAGE 'C' WITH (isstrict,iscachable); - CREATEFUNCTION GeometryFromText(geometry) RETURNS geometry AS '@MODULE_FILENAME@','LWGEOM_from_text' -- 2.40.0