Created
October 9, 2012 11:43
-
-
Save esisa/3858224 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from osgeo import gdal | |
# Read raster | |
source = gdal.Open('raster.tif') | |
nx, ny = source.RasterXSize, source.RasterYSize | |
band_array = source.GetRasterBand(1).ReadAsArray() | |
# Close raster | |
source = None | |
print "Antall piksler: " , nx, ny | |
print "Høyde i første piksel: " , band_array[0][0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment