<HTML dir=ltr><HEAD><TITLE>Re: [postgis-users] Does ST_AsText truncate or round</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2900.3314" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText43356 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Havard,</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>I think as Mark mentioned  if it did it would violate the spec.  I think somewhere in the spec is some specification of guaranteed precision of WKT and if there isn't - text can never represent floating to complete accuracy.  The AsBinary I think on the other hand is exact fidelity.  So simply trying to make them equal would probably irritate people who need precision higher than what the WKT spec offers.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>In my particular case of course this would be ideal - but I can't be selfish  :)</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>So I can live with the general rule that </FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>ST_GeomFromText(ST_AsText(geom), srid here) != geom</FONT></DIV><FONT size=2></FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>As long as I can override it by  updating my millions of geometries to so and 300 someodd tables with </FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>SET the_geom = ST_GeomFromText(ST_AsText(geom))</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>without too many weird side effects.  I may just try it and see if it causes other problems elsewhere.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>testing with the badly edited records  it seems to at least make my other geometries just as inprecise as the edited ones so I get intersection where I should again.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>Thanks,</FONT></DIV>
<DIV dir=ltr><FONT size=2>Regina</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><BR></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> postgis-users-bounces@postgis.refractions.net on behalf of Havard Tveite<BR><B>Sent:</B> Fri 5/16/2008 2:41 PM<BR><B>To:</B> PostGIS Users Discussion<BR><B>Subject:</B> Re: [postgis-users] Does ST_AsText truncate or round<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>Sorry, for not making much sense here.  What I wanted to<BR>say was that ST_AsText(geom) should be equivalent to geom,<BR>meaning that if you go from the database/binary<BR>representation of the geometry to the text representation<BR>of the geometry (using ST_AsText) and then back to the<BR>database/binary representation (using ST_GeomFromText),<BR>you should end up with the same geometry that you<BR>started out with.  This is important for applications<BR>that use when WKT when talking to PostGIS.<BR><BR>Håvard<BR><BR><BR>Mark Cave-Ayland wrote:<BR>> Håvard Tveite wrote:<BR>>> ST_GeomFromText(ST_AsText(geom)) != geom<BR>>><BR>>> sounds like a bug to me (ignoring the SRS).<BR>>><BR>>> Håvard<BR>><BR>> No, since the SFS 1.1 specification supports only 2 dimensions with no<BR>> SRS (and ST_AsText() is spec compliant). If you need the SRS then you<BR>> should use the PostGIS-enhanced ST_EWKT() function which will output the<BR>> extra information, but is not spec-compliant.<BR>><BR>><BR>> ATB,<BR>><BR>> Mark.<BR>><BR>> --<BR>> Mark Cave-Ayland<BR>> Sirius Corporation - The Open Source Experts<BR>> <A href="http://www.siriusit.co.uk/">http://www.siriusit.co.uk</A><BR>> T: +44 870 608 0063<BR>> _______________________________________________<BR>> postgis-users mailing list<BR>> postgis-users@postgis.refractions.net<BR>> <A href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR>_______________________________________________<BR>postgis-users mailing list<BR>postgis-users@postgis.refractions.net<BR><A href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR></FONT></P></DIV></BODY></HTML>
<HTML><BODY><P><hr size=1></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></BODY></HTML>

<P><hr size=1></P>
<P><STRONG><font size="2" color="339900"> Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper. </p> <p> </font></STRONG></P>