<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br><div class="plainMail">> Hi,<br>> <br>> I am trying to use gdal_grid to interpolate some data and I am having<br>> trouble making gdal_grid treat spatial data (WGS84 lat/lon coordinates) as<br>> points on a continuous plane.  It seems to be ignoring the dateline so for<br>> example values at 45, 179 are not properly interacting with values at 45,<br>> -179 and so on.  I'm using the following gdal_grid command:<br>> <br><br>Hi Andrew, <br><br>A common problem for us in New Zealand :-)<br><br>convert your data to 0-360 longitudinal space instead of +-180, it moves the problem to the other side of the world. Add 360 to all negative longitudes. One easy way, given that you'll have proj.4 installed with gdal:<br><br>Proj.4
 supports the parameter "+lon_wrap" (ignored by proj, but supported in cs2cs) which assigns any given central meridian to the output coords, & you want a central meridian of 180 instead of 0. <br><br>eg:<br>echo "179 -45 -179 -45" | cs2cs +proj=longlat +datum=WGS84 +to +proj=longlat +datum=WGS84+lon_wrap=180 -f '%0.6f'<br>179.000000      -45.000000 0.000000<br>181.000000      -45.000000 0.000000<br><br>Documented at:<br><a href="http://trac.osgeo.org/proj/wiki/GenParms#lon_wrapover-LongitudeWrapping">http://trac.osgeo.org/proj/wiki/GenParms#lon_wrapover-LongitudeWrapping</a><br><br>HTH,<br><br>   Brent Wood<br><a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank"></a></div></blockquote></td></tr></table>