[Gdal-dev] [GDAL_Contours]Different gridcellsizes

Paul Meems meems at soilcompany.nl
Thu Mar 2 02:02:40 EST 2006


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1529" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=590033607-01032006><FONT face=Arial><FONT size=2><SPAN 
class=402375906-02032006><FONT 
color=#000000>H</FONT></SPAN>i,</FONT></FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>This is my first 
post to this list.</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>I'm a member of the 
MapWindow Developing Team (<A 
href="http://www.mapwindow.org">www.mapwindow.org</A>) and MapWindow (MW) is 
using GDAL.</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>One of the used 
functions of GDAL is the 'Generate Contours from Grid'.</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>Regarding this 
function I have some questions.</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>I want to use it to 
convert Surfer 7 gridfiles (<A 
href="http://www.goldensoftware.com">www.goldensoftware.com</A>) to shapefiles. 
Using the current GDAL_Contour function&nbsp;it is allmost working. A shapefile 
is produced but because Surfer uses different gridcellsizes for X and Y the 
created contours are shifted.</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>So my question is 
can GDAL_Contour be altered so it can handle different 
gridcellsizes?</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>The difference 
between a 'normal' gridfile and a gridfile with different gridcellsizes is in 
the header:</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>A normal 
gridfile:</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial 
size=2>NCOLS&nbsp;96<BR>NROWS&nbsp;83<BR>XLLCENTER&nbsp;200022.735<BR>YLLCENTER&nbsp;598252.6382<BR>CELLSIZE 
3.49626421052656<BR>NODATA_VALUE&nbsp;-99</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>A different 
gridcellsizes gridfile:</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial 
size=2>NCOLS&nbsp;96<BR>NROWS&nbsp;83<BR>XLLCENTER&nbsp;200022.735<BR>YLLCENTER&nbsp;598252.6382<BR>DX&nbsp;3.49626421052656<BR>DY&nbsp;3.50804024390172<BR>NODATA_VALUE&nbsp;-99</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>Notice the DX and DY 
lines comparing with the CELLSIZE line in the equal one.<BR>The new gridobject 
in MW is handling this correctly.</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial color=#0000ff size=2><SPAN 
class=402375906-02032006>I've&nbsp;made a zipfile with some sample&nbsp;data. 
It's available at <A 
href="http://bugs.mapwindow.org/show_bug.cgi?id=88">http://bugs.mapwindow.org/show_bug.cgi?id=88</A>&nbsp;</SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>The&nbsp;zipfile 
containes a ppt-file with the gridfile overlaid with the correct contoured 
shapefile by my own function (this file, Correct_contour.shp is included as 
well) and with a shapefile (grid_with_different_gridsizes_Contour.shp, included 
as well) created by the<BR>Contour-function of MW (using the GDAL_Contour), this 
one is in red and is shifted.<BR>I also&nbsp;include two gridfiles who have the 
same data only different headers.<BR>One is with equal gridcellsizes 
(grid_with_equal_gridsizes.asc) and the other is with different gridcellsizes 
(grid_with_different_gridsizes.asc).</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>I'm just a VB6 
programmer so I hope someone of the GDAL Developing Team would look into 
it.</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>When GDAL handles 
the different gridcellsizes correctly MapWindow will as 
well.</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>And I would be very 
happy because the GDAL_Contour is much faster than my own VB6 function 
;)</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>Thanks in 
advanced.</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>Paul 
Meems</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial size=2>The 
Netherlands</FONT></SPAN></DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=590033607-01032006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV></BODY></HTML>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20060302/41b8851e/attachment.html


More information about the Gdal-dev mailing list