Hi Chaitanya,
This works great. Thanks so much. GDAL/Python is a really powerful
combination.
Cheers,
Derek
On 2/23/2012 9:31 AM, Chaitanya kumar CH wrote:
Derek,
You can assign a color table.
Ex: (0,0,0) for 0, (255,255,255) for 1.
You can assign a color table to a raster band using the m
Derek,
You can assign a color table.
Ex: (0,0,0) for 0, (255,255,255) for 1.
You can assign a color table to a raster band using the method
SetRasterColorTable().
You can find some sample python code in GDAL's test suite[1][2].
[1]: http://trac.osgeo.org/gdal/browser/trunk/autotest/gcore/colortab
ThanksChaitanya,
Actually this seems to be working, which is pretty cool.I think where I
am getting confused is that I am attempting to verify the results by
loading the resulting raster data into a GIS e.g. ArcGIS or QGIS and
doing spot checking.However, as I haven’t done any actual color cod
Try this Derek,
for r in range(rows1):
data1 = ds1.GetRasterBand(1).ReadAsArray(0, r, cols1, 1)
print "data1: " + str(data1)
data2 = ds2.GetRasterBand(1).ReadAsArray(0, r, cols2, 1)
print "data2: " + str(data2)
result_bools = np.logical_and((data1 > 0), (data2 > 0))
result_
Hi Chaitanya,
I am using data1[data1>0]=1 to convert any of the values in the row of
data that is greater than 0 to a one. I am doing this because the
values are varied, but I am only interested in the fact that there is a
value at all. My end goal is to compare the two input rasters for
pla
Derek,
Can you explain the following lines towards the bottom of the script?
data1[data1>0]=1
...
data2[data2>0]=1
On Wed, Feb 22, 2012 at 8:46 AM, jdmorgan wrote:
> Hello GDAL guru’s,
>
> I am working on a python script where I read in two rasters of similar
> extent and resolution. Then I
Hello GDAL guru's,
I am working on a python script where I read in two rasters of similar
extent and resolution.Then I re-assign any values that are greater that
zero to a 1.Next, I compare to the rasters and attempt to create a third
resulting raster which has 1's everywhere that the two inpu