<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
<style>p.MsoNormal, li.MsoNormal, div.MsoNormal { margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: "Times New Roman"; }div.Section1 { page: Section1; }</style>
<p class="MsoNormal"><span style="" lang="EN">Hi !<br style="">
<br style="">
</span></p>
<p class="MsoNormal"><span style="" lang="EN">I apologize in
advance for my english which I not very fluent. I have some
questions about the
tool ogr2ogr (and also about gdalwarp and gdal_translate) and
the rounding of
coordinates.</span></p>
<p class="MsoNormal"><span style="" lang="EN"><br>
Let me explain:<br>
<br>
Some databases (particularly IGN – France databases) have
coordinates
rounded to the meter (BD CARTO for example) or the decimeter (BD
TOPO for
example).<br>
<br>
I will explain my comment with for bases the coordinates of a
point of BD CARTO
to support my comments :<br>
<br>
In an original *.shp in Lambert93 - France, a point has the
following coordinates
(provided by ogrinfo):<br>
<br>
X = 993366 m
Y = 6304044 m<br>
<br>
We import this in PostGIS with shp2pgsql, and the point has
always these coordinates:<br>
<br>
X = 993366 m
Y = 6304044 m<br>
<br>
It’s good ! <br>
<br>
If we try to export this PostGIS layer through ogr2ogr (in
*.shp, *.tab or
*.mif), a ogrinfo gives us the same point of the layer
resulting, with the
following coordinates:<br>
<br>
X = and Y = 993366.00000000058 6304043.9999999898)<br>
<br>
This means that ogr2ogr (identical tests performed on a raster
layer bounding
box with reprojection (gdalwarp) or without (gdal_translate))
changes the
number of decimal coordinates of origin, which can be annoying
in some cases (when
we need to recover a given output with the same number of
decimal than in entry.<br>
<br>
<span style="color: black; background: none repeat scroll 0% 0%
rgb(230, 236, 249);">I tried to find a setting to force
ogr2ogr (or gdal and related functions) to round the
coordinates to a given
number of decimal (as can be done with CS2CS) and I have not
found any answer.</span><br>
<br>
Is it possible to set the number of decimal places in output
(and ideally keep
the same as input) ? And if so, how?<br>
<br>
Thank you in advance to all who have good ideas and / or
directions to follow.</span><span style="font-family: Arial;"
lang="EN-GB"></span></p>
<div class="moz-signature">
<div class="Section1">
<p class="MsoNormal"><o:p><br>
Sylvain Maffren<br>
</o:p></p>
</div>
</div>
</body>
</html>