[postgis-users] INSERT geom Problem

Mike Leahy mgleahy at fes.uwaterloo.ca
Sun Jun 12 15:47:15 PDT 2005


Donovan,

If you cast as type 'geometry' instead of 'point', it should work fine...if you
try the following, you'll see that this produces a point geometry:

db=# select
astext('SRID=27582;0101000000000000A053984241000000C0789A3141'::geometry);
            astext
------------------------------
 POINT(2437287.25 1153656.75)
(1 row)

It should work in your insert statement without any trouble...I tried it with a
table of my own that restricts the geometry column to point geometry only, and I
got no error (using PostGIS 1.0).

Mike

P.S. You'll want to make sure you reply to the list...

Quoting Levert Donovan <dono78fr at yahoo.fr>:

> Hello, 
> 
> Thank you for the response, 
> I modified the request with POINT geometry, but I have
> an error : 
> 
> INSERT INTO "popplace"
> ("unique_key","name","the_geom") VALUES
> ('128','test','SRID=27582;0101000000000000A053984241000000C0789A3141'::POINT);
> 
> ERROR:  invalid input syntax for type point:
> "SRID=27582;0101000000000000A053984241000000C0789A3141"
> 
> 
> Best Regards,
> Donovan LEVERT.
> 
> 
> 
> 
> --- Mike Leahy <mgleahy at fes.uwaterloo.ca> a écrit :
> 
> > Levert,
> > 
> > I think you can cast the text as geometry as
> > follows:
> > 
> > INSERT INTO "popplace"
> > ("unique_key","name","the_geom") VALUES
> >
>
('124','London','SRID=27582;0101000000000000A053984241000000C0789A3141'::geometry);
> > 
> > 
> > Mike
> > 
> > Levert Donovan wrote:
> > 
> > >Hello,
> > >This is the continuation of the message Postgis
> > >Problem , I continued on the problem and I discover
> > >where is the problem. 
> > >
> > >It is a problem from INSERT and the
> > AddGeometryColumn.
> > >
> > >this INSERT works fine : 
> > >INSERT INTO "popplace"
> > >("unique_key","name","the_geom") VALUES
> > >('128','pari',GeometryFromText('POINT(0 0
> > >0)',27582));
> > >
> > >But this INSERT doesn't work : 
> > >INSERT INTO "popplace"
> > >("unique_key","name","the_geom") VALUES
> >
> >('124','London','SRID=27582;0101000000000000A053984241000000C0789A3141');
> > >
> > >Do you what is the format of
> >
> >'SRID=27582;0101000000000000A053984241000000C0789A3141',
> > >how can I convert this to GeometryFromText()
> > function
> > >?
> > >
> > >Best Regards.
> > >Donovan LEVERT
> > >
> > >
> > >	
> > >
> > >	
> > >		
> >
> >___________________________________________________________________________
> > 
> > >Appel audio GRATUIT partout dans le monde avec le
> > nouveau Yahoo! Messenger 
> > >Téléchargez cette version sur
> > http://fr.messenger.yahoo.com
> > >_______________________________________________
> > >postgis-users mailing list
> > >postgis-users at postgis.refractions.net
> >
> >http://postgis.refractions.net/mailman/listinfo/postgis-users
> > >
> > >  
> > >
> > 
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> >
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> > 
> 
> 
> 
> 	
> 
> 	
> 		
> ___________________________________________________________________________ 
> Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
> Téléchargez cette version sur http://fr.messenger.yahoo.com
> 




----------------------------------------
This mail sent through www.mywaterloo.ca



More information about the postgis-users mailing list