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

Paragon Corporation lr at pcorp.us
Sun Aug 9 15:21:03 PDT 2009


 Andreas,

You really should qualify the columns you are inserting into. Most likely
the is is the order of columns in your table is different from how you are
inserting.  Its quite possible you are not inserting the geometry into the
geometry column.  Do something like this instead then you don't have to
worry about the physical order of your columns

insert into feature_geom(some_field, gid, the_geom)
 values('Relation', 1, 
ST_GeomFromText('MULTIPOLYGON(((0 0,1 1,2 2,0 0)))', 4326));

Leo

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Andreas
Kalsch
Sent: Sunday, August 09, 2009 6:13 AM
To: PostGIS Users Discussion
Subject: [postgis-users] Invalid OGC WKT (does not start with P, L, M, C or
G) - but just on INSERT

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

 
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------------------------
 
0106000020E61000000100000001030000000100000004000000000000000000000000000000
00000000000000000000F03F000000000000F03F000000000000004000000000000000400000
0000000000000000000000000000


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)

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users





More information about the postgis-users mailing list