[postgis-devel] [PostGIS] #332: WKT geometry tag match and mismatch

PostGIS trac at osgeo.org
Wed Dec 2 09:06:59 PST 2009


#332: WKT geometry tag match and mismatch
---------------------+------------------------------------------------------
 Reporter:  mloskot  |       Owner:  pramsey
     Type:  defect   |      Status:  new    
 Priority:  medium   |   Milestone:         
Component:  postgis  |     Version:  trunk  
 Keywords:           |  
---------------------+------------------------------------------------------
 Depending on the manner of geometry construction from Well-Known-Text
 representation, WKT geometry tag is case sensitive or not (POLYGON vs
 polygon).

 Here are details:

  * Construction using ST_GeomFromText is case-sensitive
 {{{
 test=# SELECT ST_GeomFromText('polygon((0 0,4 0,4 4,0 4,0 0))');
 ERROR:  Invalid OGC WKT (does not start with P,L,M,C or G)
 }}}

  * Construction using explicit cast to GEOMETRY is '''not''' case-
 sensitive
 {{{

 test=# SELECT 'polygon((0 0,4 0,4 4,0 4,0 0))'::geometry;
 geometry

 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 010300000001000000050000000000000000000000000000000000000000000000000010400000000000000000000000000000104000000000000010400000000000000000000000000000104000000000000000000000000000000000
 (1 row)

 test=# SELECT ST_AsText('polygon((0 0,4 0,4 4,0 4,0 0))'::geometry);
            st_astext
 --------------------------------
  POLYGON((0 0,4 0,4 4,0 4,0 0))
 (1 row)
 }}}

 Environment:

  * OS: Windows
  * PostgreSQL
 {{{
 test=# select version();
                            version
 -------------------------------------------------------------
  PostgreSQL 8.4.0, compiled by Visual C++ build 1400, 32-bit
 (1 row)
 }}}
  * PostGIS installed from Regina's packages
 {{{
 test=# SELECT postgis_full_version();
                                   postgis_full_version
 ----------------------------------------------------------------------------------------
  POSTGIS="1.5.0SVN" GEOS="3.2.0-CAPI-1.6.0" PROJ="Rel. 4.6.1, 21 August
 2008" USE_STATS
 (1 row)
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/332>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list