[postgis-users] Problems with MakePoint

Obe, Regina robe.dnd at cityofboston.gov
Mon Jun 4 05:23:14 PDT 2007


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070604/69bbd78f/attachment.html>


More information about the postgis-users mailing list