<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi Regina,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> 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. </FONT></DIV>
<DIV><FONT face=Arial size=2> Thanks too for the dimension
concept!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Gus</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=robe.dnd@cityofboston.gov
href="mailto:robe.dnd@cityofboston.gov">Obe, Regina</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=postgis-users@postgis.refractions.net
href="mailto:postgis-users@postgis.refractions.net">PostGIS Users
Discussion</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, June 04, 2007 2:23 PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [postgis-users] Problems
with MakePoint</DIV>
<DIV><BR></DIV>
<DIV dir=ltr align=left><SPAN class=577272012-04062007><FONT face=Arial
color=#0000ff size=2>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</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=577272012-04062007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=577272012-04062007><FONT face=Arial
size=2>update montouto2000 set the_geom=setsrid(MakePoint(x,y),
23029)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=577272012-04062007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=577272012-04062007><FONT face=Arial
size=2>Now if your x y are in long lat, you will need to do something
like</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=577272012-04062007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=577272012-04062007><FONT face=Arial
size=2><SPAN class=577272012-04062007><FONT face=Arial size=2>update
montouto2000 set the_geom=transform(setsrid(MakePoint(x,y), 4326),
23029)</FONT></SPAN></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=577272012-04062007><FONT face=Arial
size=2><SPAN class=577272012-04062007></SPAN></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=577272012-04062007><FONT face=Arial
size=2><SPAN class=577272012-04062007>Yes the dimension is number of
coordinates. So if you had a z coordinate for your point, it would be
3.</SPAN></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=577272012-04062007><FONT face=Arial
size=2><SPAN class=577272012-04062007></SPAN></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=577272012-04062007><FONT face=Arial
size=2><SPAN class=577272012-04062007>Hope that
helps,</SPAN></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=577272012-04062007><FONT face=Arial
size=2><SPAN class=577272012-04062007>Regina</SPAN></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=577272012-04062007><FONT face=Arial
size=2><SPAN class=577272012-04062007></SPAN></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=577272012-04062007><FONT face=Arial
size=2><SPAN class=577272012-04062007></SPAN></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=577272012-04062007><FONT face=Arial
size=2></FONT></SPAN> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of
</B>Gustavo Ces<BR><B>Sent:</B> Monday, June 04, 2007 6:42 AM<BR><B>To:</B>
PostGIS Users Discussion<BR><B>Subject:</B> [postgis-users] Problems with
MakePoint<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2>Hi all,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> iīm trying to makepoints from
coordinate data ( x and y column) in one table( montouto2000). This is what i
do..</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>SELECT AddGeometryColumn('public',
'montouto2000', 'the_geom', 23029, 'POINT', 2)<BR>update montouto2000 set
the_geom=MakePoint(x,y)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>and Postgis says...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>ERROR: new row for relation "montouto2000"
violates check constraint "enforce_srid_the_geom"<BR>Estado
SQL:23514</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Iīve got two questions:</FONT></DIV>
<DIV><FONT face=Arial size=2>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.</FONT></DIV>
<DIV><FONT face=Arial size=2>2. What happens with SRID? why does PostGis
Scream?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Gus</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> </FONT></DIV>
<P>
<HR SIZE=1>
<P></P>
<P><STRONG>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. </STRONG></P>
<P>
<HR>
<P></P>_______________________________________________<BR>postgis-users
mailing
list<BR>postgis-users@postgis.refractions.net<BR>http://postgis.refractions.net/mailman/listinfo/postgis-users<BR></BLOCKQUOTE></BODY></HTML>