[postgis-users] Invalid OGC WKT (does not start with P, L, M, C or G) - but just on INSERT

Andreas Kalsch andreaskalsch at gmx.de
Sun Aug 9 03:13:23 PDT 2009


Why is this error thrown although the text is valid? When I select, it 
will not be thrown.


b=# insert into feature_geom values('Relation', 1, 
ST_GeomFromText('MULTIPOLYGON(((0 0,1 1,2 2,0 0)))', 4326));
ERROR:  Invalid OGC WKT (does not start with P,L,M,C or G)
CONTEXT:  SQL function "st_geomfromtext" statement 1
PL/pgSQL function "feature_geom_insert" line 6 at assignment


b=# select st_geomfromtext('POINT(0 0)', 4326);
                  st_geomfromtext                   
----------------------------------------------------
 0101000020E610000000000000000000000000000000000000
(1 row)


b=# select st_geomfromtext('MULTIPOLYGON(((0 0)))', 4326);
ERROR:  geometry requires more points
CONTEXT:  SQL function "st_geomfromtext" statement 1
b=# select st_geomfromtext('MULTIPOLYGON(((0 0,1 1,2 2,0 0)))', 4326);
                                                                                   
st_geomfromtext                                                                                   
 
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 0106000020E6100000010000000103000000010000000400000000000000000000000000000000000000000000000000F03F000000000000F03F0000000000000040000000000000004000000000000000000000000000000000


b=# SELECT postgis_full_version() ;
                                
postgis_full_version                                 
-------------------------------------------------------------------------------------
 POSTGIS="1.3.3" GEOS="3.0.0-CAPI-1.4.1" PROJ="Rel. 4.6.1, 21 August 
2008" USE_STATS
(1 row)




More information about the postgis-users mailing list