ArcGIS / Python / Práce s rastrovými daty: Porovnání verzí
mBez shrnutí editace |
|||
Řádek 30: | Řádek 30: | ||
ndvi.save("ndvi.tif") | ndvi.save("ndvi.tif") | ||
</source> | </source> | ||
== Fokální operace -moving window (kernel) == | |||
== Odkazy == | == Odkazy == |
Verze z 19. 12. 2013, 16:08
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")