<html><body><div style="color:#000; background-color:#fff; font-family:tahoma, new york, times, serif;font-size:12pt"><div><span>Dear Chaitanya ,</span></div><div><span>I checked the contours generation function and it was indeed of a lot of help. First all, I realised that the mistake was located in the bounding box of the SRTM file, also called region in GRASS GIS software. I realised that,&nbsp; the SRTM file had been previously clipped&nbsp; and it cointain large NODATA areas, which for a reason not still clear to me, generated a displacement of GDAL generated contours in relation to the GRASS GIS generated contours. After correcting the Region extent in GRASS GIS, before exporting it, I was able to correct the relative error from +/- 35 meters to 2.5 cm, which is insignificant considering that I am working with a SRTM90 meters.</span></div><div><span>Thanks a lot&nbsp; </span><span>for your hint
 !<br></span></div><div><span>regards</span></div><div><span>Rengifo<br></span></div><div><br></div><div style="font-family: tahoma, new york, times, serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight:bold;">Von:</span></b> Chaitanya kumar CH &lt;chaitanya.ch@gmail.com&gt;<br><b><span style="font-weight: bold;">An:</span></b> Rengifo Ortega &lt;rengifoo@yahoo.de&gt;<br><b><span style="font-weight: bold;">Cc:</span></b> "FWTools@lists.maptools.org" &lt;FWTools@lists.maptools.org&gt;<br><b><span style="font-weight: bold;">Gesendet:</span></b> 15:59 Mittwoch, 31.August 2011 <br><b><span style="font-weight: bold;">Betreff:</span></b> Re: [FWTools] shift in contours lines gdal vs. grass gis<br></font><br><div id="yiv436450677">Rengifo,<br><br>Can you compare the two contours with the pixel values? Which contours are shifted?<br>FYI,
 you can read the algorithm rules in the docs of GDALContourGenerate() function[1].<br><br>[1]: <a rel="nofollow" target="_blank" href="http://www.gdal.org/gdal__alg_8h.html#ceaf98ad40f159cbfb626988c054c085">http://www.gdal.org/gdal__alg_8h.html#ceaf98ad40f159cbfb626988c054c085</a><br>
<br><div class="yiv436450677gmail_quote">On Wed, Aug 31, 2011 at 6:42 PM, Rengifo Ortega <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:rengifoo@yahoo.de" target="_blank" href="mailto:rengifoo@yahoo.de">rengifoo@yahoo.de</a>&gt;</span> wrote:<br><blockquote class="yiv436450677gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex;">
<div><div style="color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);font-family:tahoma, new york, times, serif;font-size:12pt;"><div>

</div><div class="yiv436450677MsoNormal"><span lang="EN-US">Dear gdal
users</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">&nbsp;</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">I hope you
can help me with a question that is puzzling me, since a couple of days. So let
me explain my problem.</span></div>



<div class="yiv436450677MsoNormal"><span lang="EN-US">&nbsp;</span><span lang="EN-US">2 years ago,
I downloaded a SRTM 90m .asc file into GRASS GIS. </span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">A week ago, I
decided to generate some contours lines using gdal_contour command (version FWTools2.4.7)
and compare the contours lines with contours already produced in GRASS GIS. I was quite
disturbed when in fact, I found a horizontal shift of the contours lines to the
south of about -/+35m or to north (unknown distance), with respect to the grass gis- generated contours<br></span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">&nbsp;</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">Technical aspect of my hardware<br></span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">&nbsp;</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">I am<span> </span>in Grass GIS <span>&nbsp;</span>MS Windows environment (native using MinGW)
combined with QGIS for visualisation purposes</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">Using FWtools
2.4.7</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">&nbsp;</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">So, here are
the steps I followed</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">&nbsp;</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">Part I</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">&nbsp;</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US"><span> </span>-Produced 90m contours lines in GRASS
GIS out of the SRTM DEM 90 by using the r.contour command</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US"><span></span>-Visualised the contours lines in QGIS
and saved them as shp format</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">&nbsp;</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">&nbsp;</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">Part II</span></div>

<div><span lang="EN-US"><span>1)<span style="font:7pt;">&nbsp;&nbsp; </span></span></span><span lang="EN-US">-</span><span lang="EN-US">Export SRTM 90 rasterfile as <span>&nbsp;</span>an ESRI ASCII GRID fomat and converted it to .tif
format using FWTools2.4.7</span></div>

<div><span lang="EN-US"><span>2)<span style="font:7pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US"><span>&nbsp;</span>Using gdal_contours utility I generated 90
meters contour lines</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">&nbsp;</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US"><span>&nbsp;</span>Results 1<br></span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">Comparison
between the GRASS-generated and the GDAL- generated contours lines exhibited a horizontal
shift of -/+ 35m to the south in relation to GRASS GIS generated contours</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">&nbsp;</span></div>

<div class="yiv436450677MsoNormal"><span lang="EN-US">Part III</span></div>

<div><span lang="EN-US"><span>1<span style="font:7pt;"></span></span></span><span lang="EN-US">--Export the raster file SRTM90m from
GRASS GIS; as a Geotiff using gdal</span><span lang="EN-US"><br></span></div><div><span lang="EN-US">-Generate 90m contours using gdal</span></div><div><span lang="EN-US"><br></span></div>

<div><span lang="EN-US"><span><span style="font:7pt;"></span></span></span><span lang="EN-US"></span></div>

<div><span lang="EN-US">&nbsp;</span></div>

<div><span lang="EN-US">Result 2 </span></div>

<div><span lang="EN-US">&nbsp;</span></div>

<div><span lang="EN-US">Comparing the GRASS GIS contours with the geotiff- generated contours a
displacement to the north was observed, no distance measured.</span></div><div><br><span lang="EN-US"></span></div><div>I hope you can give some hints..</div><div>best regards <br></div><font color="#888888"><div>Rengifo<br>
<span lang="EN-US"></span></div><div><span lang="EN-US"><br></span></div>

</font></div></div><br>_______________________________________________<br>
FWTools mailing list<br>
<a rel="nofollow" ymailto="mailto:FWTools@lists.maptools.org" target="_blank" href="mailto:FWTools@lists.maptools.org">FWTools@lists.maptools.org</a><br>
<a rel="nofollow" target="_blank" href="http://lists.maptools.org/mailman/listinfo/fwtools">http://lists.maptools.org/mailman/listinfo/fwtools</a><br>
<a rel="nofollow" target="_blank" href="http://fwtools.maptools.org/">http://fwtools.maptools.org/</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br><br>+91-9494447584<br>17.2416N 80.1426E<br>
</div><br><br></div></div></div></body></html>