[postgis-users] Help with simple query

Emilia Venturato venturato at faunalia.it
Mon Aug 25 10:18:38 PDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Adam Vande More ha scritto:
> From the example here: 
> http://postgis.refractions.net/documentation/manual-1.3/ch04.html#id2620496
> This query works perfectly
> 
> INSERT INTO phone_points ( the_geom ) VALUES (
> GeomFromText('POINT(-79.988 40.449)'));
> 
> However this one fails
> 
> INSERT INTO phone_points ( the_geom ) VALUES (
> GeomFromText('POINT(-122.38 37.731'));
> 
> with
> 
> ERROR: parse error - invalid geometry
> SQL state: XX000
> Context: SQL function "geomfromtext" statement 1
> 
> Can someone explain why that is an invalide geometery?
> 
> Thanks
> 

Try with:

INSERT INTO phone_points ( the_geom ) VALUES (st_geomfromtext ('POINT('
|| -79.988 || ' ' || 40.449 || ')',[SRID]);

caution: [SRID] must be replaced with correct SRID (or -1 if you don't
know the correct srid).

bye
Lia




- --
Emilia Venturato
email+jabber: venturato at faunalia.it
www.faunalia.it
Tel: (+39) 347-2770007 Tel+Fax: (+39) 0587-213742
Piazza Garibaldi 5 - 56025 Pontedera (PI), Italy
http://www.faunalia.it/ev
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkiy6W0ACgkQOsndmJr6cvZWwQCgqi7NvOPnqOcYmwgysTZVbuYt
JMIAnRuzOdRsDGA/MWYxSncROtlGM9wf
=nbba
-----END PGP SIGNATURE-----



More information about the postgis-users mailing list