<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Sorry to come out so often with GMT solutions in this GDAL list but
    somethings are so trivial there.<br>
    <br>
    If you can trust that all your negative values are (mean)seawater,
    this will do the job<br>
    <br>
    grdclip yourGrid -Sb0/0 -Gclipped_grid.nc<br>
    <br>
    Note, one need the dev GMT5 version to read all grid formats through
    GDAL, otherwise (GMT4) "yourGrid" should be netCDF<br>
     <br>
    Joaquim<br>
    <br>
    <blockquote
cite="mid:CALtm4h0RGQk0nSCEa+EjYmfUCbnWE8UbfyN10f6FpJHG35FQgg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>Michael,<br>
            <br>
          </div>
          I'm not sure if you can do this using one of the existing
          utilities, you may be able to do this my creating a virtual
          file (gdalbuildvrt) and modifying it see - <a
            moz-do-not-send="true"
            href="http://www.gdal.org/gdal_vrttut.html">http://www.gdal.org/gdal_vrttut.html</a>,
          but I have not attempted this.  An alternative is to do this
          using the API and something like numpy to choose and rewrite
          pixel values.<br>
        </div>
        See the following for a example in python <a
          moz-do-not-send="true"
href="http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/val_repl.py">http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/val_repl.py</a><br>
        <br>
        <div>   <br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On 9 January 2013 11:33, Smith, Michael
          <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:Michael.Smith@maine.gov" target="_blank">Michael.Smith@maine.gov</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div link="blue" vlink="purple" lang="EN-US">
              <div>
                <p class="MsoNormal">I have some DEMs that are created
                  from lidar.  For reasons related to seeing currents
                  and wind effect, we did not ask for the water to be
                  flattened, but rather it shows waves.  This is cool,
                  and what we wanted.  BUT of course now we want to
                  create a second set of DEMs with a  nice flat ocean.</p>
                <p class="MsoNormal"> </p>
                <p class="MsoNormal">I have numerous pixels out in the
                  ocean which are slightly less than 0.  So how does one
                  select out all pixels < 0 and substitute them with
                  0 with GDAL? 
                </p>
                <p class="MsoNormal"> </p>
                <p class="MsoNormal"><span
                    style="font-size:12.0pt;font-family:"Times New
                    Roman","serif"">===============================<br>
                  </span><b><span style="font-size:10.0pt">Michael Smith
                      MS GISP</span></b><span style="font-size:10.0pt"><br>
                    State GIS Manager, Maine Office of GIS<br>
                    State of Maine, Office of Information Technology<br>
                    michael.smith _at_ <a moz-do-not-send="true"
                      href="http://maine.gov" target="_blank">maine.gov</a><br>
                    <a moz-do-not-send="true" href="tel:207-215-5530"
                      value="+12072155530" target="_blank">207-215-5530</a><br>
                    <br>
                    Board Member, Maine GeoLibrary<br>
                    Education Chair, Maine GIS Users Group<br>
                    State Rep, National States Geographic Information
                    Council<br>
                  </span><span
                    style="margin-left:0px;margin-top:0px;width:298px;min-height:67px"><img
                      src="cid:part6.00060102.09010109@ualg.pt"
                      height="67" width="298"></span><span
                    style="font-size:12.0pt;font-family:"Times New
                    Roman","serif""><img
                      src="cid:part7.00060302.03080808@ualg.pt"
                      alt="icons" height="68" width="299"></span><span
                    style="font-size:12.0pt;font-family:"Times New
                    Roman","serif""><br>
                    <br>
                  </span><span style="font-size:10.0pt">***NOTE NEW
                    ADDRESS***<br>
                    <br>
                  </span><span style="font-size:8.0pt">State House
                    Station 145<br>
                    51 Commerce Drive<br>
                    Augusta, ME 04333-0145<br>
                    69<sup>o</sup> 47' 58.9"W  44<sup>o</sup> 21' 54.8"N</span></p>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            gdal-dev mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.osgeo.org/mailman/listinfo/gdal-dev"
              target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
    </blockquote>
    <br>
  </body>
</html>