[postgis-users] Problems with MakePoint
Gustavo Ces
g.ces at pettra.es
Tue Jun 5 23:41:56 PDT 2007
Hi Regina,
i thought PostGis set the SRID when you add the geometry column so makepoint interprets the data inserted in it with the proper SRID. But it makes sense.
Thanks too for the dimension concept!
Gus
----- Original Message -----
From: Obe, Regina
To: PostGIS Users Discussion
Sent: Monday, June 04, 2007 2:23 PM
Subject: RE: [postgis-users] Problems with MakePoint
When you do a makepoint alone it returns a geometry with no SRID (or ather SRID = -1). Assuming your x and y points are in srid 23029 then you should do instead
update montouto2000 set the_geom=setsrid(MakePoint(x,y), 23029)
Now if your x y are in long lat, you will need to do something like
update montouto2000 set the_geom=transform(setsrid(MakePoint(x,y), 4326), 23029)
Yes the dimension is number of coordinates. So if you had a z coordinate for your point, it would be 3.
Hope that helps,
Regina
------------------------------------------------------------------------------
From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Gustavo Ces
Sent: Monday, June 04, 2007 6:42 AM
To: PostGIS Users Discussion
Subject: [postgis-users] Problems with MakePoint
Hi all,
i´m trying to makepoints from coordinate data ( x and y column) in one table( montouto2000). This is what i do..
SELECT AddGeometryColumn('public', 'montouto2000', 'the_geom', 23029, 'POINT', 2)
update montouto2000 set the_geom=MakePoint(x,y)
and Postgis says...
ERROR: new row for relation "montouto2000" violates check constraint "enforce_srid_the_geom"
Estado SQL:23514
I´ve got two questions:
1. What is the column dimension? i try to set it as 0 (poinst are no dimension geometries) but it says there´s a problem with the dim constraint, so i supose dimesion=number of coordinates? I don´t know, please, help.
2. What happens with SRID? why does PostGis Scream?
Thanks in advance,
Gus
------------------------------------------------------------------------------
The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer.
------------------------------------------------------------------------------
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070606/86297e1b/attachment.html>
More information about the postgis-users
mailing list