[postgis-devel] ST_GeometryType output is this right?

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Tue Apr 14 08:26:05 PDT 2009


Paragon Corporation wrote:

> I was doing some tests on ST_GeometryType and noticed it just returns
> ST_Geometry for CurvedPolygon and CircularString.  I thought these are
> supported in the SQL MM specs so why does it return a generic when the old
> returns something more meaningful.
> 
> So not sure if this is a bug or by design?  Same behavior for both 1.3 and
> 1.4
> 
> Example:
> 
> SELECT ST_GeometryType(geom) As newname, GeometryType(geom) as oldname
> FROM ( VALUES (ST_GeomFromText('POLYGON((-0.25 -1.25,-0.25 1.25,2.5 1.25,2.5
> -1.25,-0.25 -1.25),
> (2.25 0,1.25 1,1.25 -1,2.25 0),(1 -1,1 1,0 0,1 -1))') ),
> ( ST_Point(1,2) ),
> ( ST_Buffer(ST_Point(1,2), 3) ),
> ( ST_LineToCurve(ST_Buffer(ST_Point(1,2), 3)) ) ,
> ( ST_LineToCurve(ST_Boundary(ST_Buffer(ST_Point(1,2), 3))) ) 
> 
>  ) As foo(geom);
> 
> Gives me:
> 
>    newname   |    oldname
> -------------+----------------
>  ST_Polygon  | POLYGON
>  ST_Point    | POINT
>  ST_Polygon  | POLYGON
>  ST_Geometry | CURVEPOLYGON
>  ST_Geometry | CIRCULARSTRING

I'd say this is a bug, although we don't know if any 1.3 users are 
reliant on this existing behaviour. Feel free to patch SVN trunk to 
return the correct ST_ names for CURVEPOLYGON and CIRCULARSTRING though.


ATB,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063



More information about the postgis-devel mailing list