More Raster Processing
[Pages:29]More Raster Processing
(or there is more than one way to skin a cat)
Open Source RS/GIS Python Week 6
OS Python week 6: More raster processing [1]
Projecting rasters
? Need Well Known Text (WKT) for input and output projections
? Can get it from the original Dataset (if it has a projection defined) with
GetProjection()
? Can create output WKT using the SpatialReference objects we learned about earlier
OS Python week 6: More raster processing [2]
? gdal.CreateAndReprojectImage( , , src_wkt=, dst_wkt=, dst_driver=, eResampleAlg=)
? There are a few other options that I won't cover here
? Sets geotransform and projection but does not build pyramids
OS Python week 6: More raster processing [3]
import gdal, osr from gdalconst import *
inFn = 'd:/data/classes/python/data/aster.img' outFn = 'd:/data/classes/python/data/aster_geo.img'
driver = gdal.GetDriverByName('HFA') driver.Register()
# input WKT inDs = gdal.Open(inFn) inWkt = inDs.GetProjection()
# output WKT outSr = osr.SpatialReference() outSr.ImportFromEPSG(4326) outWkt = outSr.ExportToWkt()
# reproject gdal.CreateAndReprojectImage(inDs, outFn, src_wkt=inWkt,
dst_wkt=outWkt, dst_driver=driver, eResampleAlg=GRA_Bilinear)
inDs = None
OS Python week 6: More raster processing [4]
Method comparison
? Simple model using a DEM
? elevation > 2500 = 1 ? elevation 2500: outData[y, x] = 1 else: outData[y, x] = 0
OS Python week 6: More raster processing [6]
Built-in function
? Or can use a built-in Numeric (or numpy) function whenever possible
outData = numpy.greater(inData, 2500)
OS Python week 6: More raster processing [7]
Another comparison
Elevation
Soil available water capacity (awch)
Output
if elevation > 2000: if awch > 0.15: output = 1 else: output = 0
else: if awch > 0.2: output = 1 else: output = 0
OS Python week 6: More raster processing [8]
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- math 2270 lecture 33 positive definite matrices
- operating systems
- hacking with python
- detecting malicious files with yara rules as they
- chapter 2 operating system structures
- more raster processing
- imageai documentation
- a python book beginning python advanced python and
- exposing hidden exploitable behaviors in programming
- introduction to pyvision for computer vision applications
Related searches
- more than me or more than i
- order processing software small business
- order processing software
- free word processing programs
- more important vs more importantly
- order processing system software
- free word processing programs for windows 10
- order processing application software
- more important or more importantly
- more and more people synonym
- more and more synonym
- more and more thesaurus