ArcGIS / Python / Práce s rastrovými daty: Porovnání verzí

Z GeoWikiCZ
mBez shrnutí editace
mBez shrnutí editace
Řádek 35: Řádek 35:
* http://blog.remotesensing.io/2013/05/using-arcpy-for-raster-analysis/
* http://blog.remotesensing.io/2013/05/using-arcpy-for-raster-analysis/
* http://arcpy.wordpress.com/
* http://arcpy.wordpress.com/
* http://sdmg.forestry.oregonstate.edu/olsen-ex1

Verze z 19. 12. 2013, 16:06

Výpočet normalizovaného diferenčního vegetačního indexu

Výpočet normalizovaného diferenčního vegetačního indexu (NDVI) - viz cvičení předmětu ZODH.

import arcpy
from arcpy.sa import *

arcpy.CheckOutExtension("Spatial")

arcpy.env.overwriteOutput = True
arcpy.env.workspace = "c:/Users/landa/arcpy" 

### tm3_name = "tm3.tif"
### tm4_name = "tm4.tif"
tm3_name = arcpy.GetParameterAsText(0)
tm4_name = arcpy.GetParameterAsText(1)

# nacteni vstupnich dat
tm3 = Raster(tm3_name)
tm4 = Raster(tm4_name)

# vypocet NDVI
ndvi = 1.0 * (tm4 - tm3) / (tm4 + tm3)

# ulozeni vysledku do souboru TIFF
ndvi.save("ndvi.tif")

Odkazy