<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19412"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
class=734140614-16042013>And what about round(st_y(geom)::numeric, 6)
?</SPAN></SPAN></DIV>
<DIV dir=ltr align=left><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
class=734140614-16042013></SPAN></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN
class=734140614-16042013>Hug</SPAN></SPAN></DIV>
<DIV> </DIV><BR>
<DIV dir=ltr lang=fr class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> postgis-users-bounces@lists.osgeo.org
[mailto:postgis-users-bounces@lists.osgeo.org] <B>On Behalf Of </B>Carsten
Hogertz<BR><B>Sent:</B> Tuesday, April 16, 2013 4:05 PM<BR><B>To:</B> PostGIS
Users Discussion<BR><B>Subject:</B> Re: [postgis-users] Cut lat/lon to six
decimal digits<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr>Thanks.
<DIV>Indead I did. I also tried </DIV>
<DIV><BR></DIV>
<DIV>trunc(ST_Y(geom), 6)</DIV>
<DIV><BR></DIV>
<DIV>But it gives back:</DIV>
<DIV><BR></DIV>
<DIV>Function round(double precision, integer) does not exist<BR></DIV>
<DIV><BR></DIV></DIV>
<DIV class=gmail_extra><BR><BR>
<DIV class=gmail_quote>2013/4/16 Hugues François <SPAN dir=ltr><<A
href="mailto:hugues.francois@irstea.fr"
target=_blank>hugues.francois@irstea.fr</A>></SPAN><BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote><U></U>
<DIV>
<DIV dir=ltr align=left><FONT color=#0000ff
face=Arial><SPAN>Hello,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff
face=Arial><SPAN></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff face=Arial><SPAN>Did you simply
try</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff
face=Arial><SPAN></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff face=Arial><SPAN>round(ST_Y(geom),
6) as lat</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff
face=Arial><SPAN><SPAN>round(ST_X(geom), 6) as lon</SPAN></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff
face=Arial><SPAN><SPAN></SPAN></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff
face=Arial><SPAN><SPAN>Hugues.</SPAN></SPAN></FONT></DIV><BR>
<DIV dir=ltr lang=fr align=left>
<HR>
<FONT face=Tahoma><B>From:</B> <A
href="mailto:postgis-users-bounces@lists.osgeo.org"
target=_blank>postgis-users-bounces@lists.osgeo.org</A> [mailto:<A
href="mailto:postgis-users-bounces@lists.osgeo.org"
target=_blank>postgis-users-bounces@lists.osgeo.org</A>] <B>On Behalf Of
</B>Carsten Hogertz<BR><B>Sent:</B> Tuesday, April 16, 2013 3:51
PM<BR><B>To:</B> PostGIS Users Discussion<BR><B>Subject:</B> [postgis-users]
Cut lat/lon to six decimal digits<BR></FONT><BR></DIV>
<DIV>
<DIV class=h5>
<DIV></DIV>
<DIV dir=ltr>Hi everyone,
<DIV>I've got the following SQL to extract the lat/lon of a polygone:</DIV>
<DIV><BR></DIV>
<DIV>SELECT </DIV>
<DIV>ROW_NUMBER () over () as id, </DIV>
<DIV>name, </DIV>
<DIV>geom, </DIV>
<DIV>ST_Y(geom) as lat, </DIV>
<DIV>ST_X(geom) as lon </DIV>
<DIV>FROM (SELECT name, (ST_DumpPoints(geom)).* FROM timezones20032013) as
foo</DIV>
<DIV><BR></DIV>
<DIV>It gives me back the lat and lon as a number with a lot of digits,
e.g.:</DIV>
<DIV>42.4734992980957</DIV>
<DIV>1.71096694469452</DIV>
<DIV><BR></DIV>
<DIV>Instead what I need is:</DIV>
<DIV>42.473499</DIV>
<DIV>1.710967</DIV>
<DIV><BR></DIV>
<DIV>How could I change my SQL to get the result cut/rounded?</DIV>
<DIV><BR></DIV>
<DIV>Any help would be appreciated.</DIV>
<DIV><BR></DIV>
<DIV>Thanks in advance</DIV>
<DIV>Carsten</DIV></DIV></DIV></DIV></DIV><BR>_______________________________________________<BR>postgis-users
mailing list<BR><A
href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</A><BR><A
href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users"
target=_blank>http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>