Micheal, Check out repl_val.py in the GDAL/python samples. http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/
Changing it slightly you can do what you want. original replace single value: scanline = numpy.choose( numpy.equal( scanline, inNoData), (scanline, outNoData) ) "Greater" scanline = numpy.choose( numpy.*greater*( scanline, inNoData), (scanline, outNoData) ) "Less" scanline = numpy.choose( numpy.*less*( scanline, inNoData), (scanline, outNoData) ) Does that help? -Trent On Wed, Jan 9, 2013 at 9:33 AM, Smith, Michael <michael.sm...@maine.gov>wrote: > 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.**** > > ** ** > > 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? **** > > ** ** > > =============================== > *Michael Smith MS GISP* > State GIS Manager, Maine Office of GIS > State of Maine, Office of Information Technology > michael.smith _at_ maine.gov > 207-215-5530 > > Board Member, Maine GeoLibrary > Education Chair, Maine GIS Users Group > State Rep, National States Geographic Information Council > ****[image: icons] > > ***NOTE NEW ADDRESS*** > > State House Station 145 > 51 Commerce Drive > Augusta, ME 04333-0145 > 69o 47' 58.9"W 44o 21' 54.8"N**** > > _______________________________________________ > gdal-dev mailing list > gdal-dev@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/gdal-dev >
<<image002.jpg>>
<<image001.png>>
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev