]> granicus.if.org Git - postgis/commitdiff
Override geometrytype for geography (#1450).
authorSandro Santilli <strk@keybit.net>
Tue, 17 Jan 2012 18:04:58 +0000 (18:04 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 17 Jan 2012 18:04:58 +0000 (18:04 +0000)
The testusite runs without problems so I didn't also add a
geometrytype(text) function [I want the implicit cast!]

git-svn-id: http://svn.osgeo.org/postgis/trunk@8856 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/geography.sql.in.c
regress/tickets.sql
regress/tickets_expected

index c85e85af67ec0766ae1227ce516da87d9702c27b..cb1985cbd1327585ac7a2dd126925331eef6dd60 100644 (file)
@@ -683,6 +683,12 @@ CREATE OR REPLACE FUNCTION ST_AsEWKT(text)
        $$ SELECT ST_AsEWKT($1::geometry);  $$
        LANGUAGE 'SQL' IMMUTABLE STRICT;
 
+-- Availability: 2.0.0
+CREATE OR REPLACE FUNCTION GeometryType(geography)
+       RETURNS text
+       AS 'MODULE_PATHNAME', 'LWGEOM_getTYPE'
+       LANGUAGE 'C' IMMUTABLE STRICT;
+
        
 -----------------------------------------------------------------------------
 
index 095bd1725ff8be7283e011f58b2ff295acf1eef3..56f6d870d06a43c4eb80729b2af9d08111ac01e4 100644 (file)
@@ -527,6 +527,9 @@ SELECT '#1478', 'SRID=1;POINT EMPTY'::geometry::text::geometry;
 SELECT '#745', ST_AsEWKT(ST_Split('POLYGON((-72 42 1,-70 43 1,-71 41 1,-72 42 1))',
                                   'LINESTRING(-10 40 1,-9 41 1)'));
 
+-- #1450
+SELECT '#1450', GeometryType('POINT(0 0)'::geography), GeometryType('POLYGON EMPTY'::geography);
+
 -- Clean up
 DELETE FROM spatial_ref_sys;
 
index bd8f62088d91b98fe12335b40d06cbd0d631fca7..de2316cb534fd95b18ca8231c9f64085da89b893 100644 (file)
@@ -175,3 +175,4 @@ ERROR:  MultiSurface cannot contain MultiPoint element
 #1414|CURVEPOLYGON Z EMPTY
 #1478|01040000200100000000000000
 #745|GEOMETRYCOLLECTION(POLYGON((-72 42 1,-70 43 1,-71 41 1,-72 42 1)))
+#1450|POINT|POLYGON