POST
|
Thank You Dan for Guidance....I am beginner in programming. Here is code with using online syntax highlighter. # Calculates NDVI from multispectral imagery
import arcpy, string
from arcpy import env
from arcpy.sa import*
arcpy.CheckOutExtension("spatial")
env.workspace = r'E:\Landsat All Images\Processing\LT5\Composite'
outws = r'E:\Landsat All Images\Processing\LT5\NDSSI'
rasters = arcpy.ListRasters("*.tif")
for raster in rasters:
# You may need to change the band combinations.
# This is for 4-band NAIP imagery or Landsat TM.
Blue = raster + "\Band_1"
NIR = raster + "\Band_4"
Blue_out = "Blue.tif"
NIR_out = "NIR.tif"
arcpy.CopyRaster_management(Blue,Blue_out)
arcpy.CopyRaster_management(NIR, NIR_out)
Num = arcpy.sa.Float(Raster(Blue) - Raster(NIR))
Denom = arcpy.sa.Float(Raster(Blue) + Raster(NIR))
NIR_eq = arcpy.sa.Divide(Num, Denom)
NIR_eq.save(outws)
print "Processing complete"
... View more
12-31-2016
10:27 PM
|
0
|
3
|
713
|
POST
|
I an new to arcpy and python. I have been trying to calculate NDSSI from 100 composite raster images from a folder using python script. Any how i tried my luck using a script but its not working. Taking list of rasters from one workspace and calculate NDSSI and store results in .tif format in another folder. import arcpy, string
from arcpy import envfrom arcpy.sa import*
arcpy.CheckOutExtension("spatial")
env.workspace = r'E:\Landsat All Images\Processing\LT5\Composite'
outws = r'E:\Landsat All Images\Processing\LT5\NDSSI'
rasters = arcpy.ListRasters("*.tif")
for raster in rasters:
Blue = raster + "\Band_1"NIR = raster + "\Band_4"Num = arcpy.sa.Float(Raster(Blue) - Raster(NIR))Denom = arcpy.sa.Float(Raster(Blue) + Raster(NIR))NIR_eq = arcpy.sa.Divide(Num, Denom) NIR_eq.save(outws)
print "Processing complete"
... View more
12-31-2016
11:35 AM
|
0
|
6
|
1984
|
POST
|
i am just start learning arcmap. i have question and dont know how to do. i have a layers of name EPA, roads and counties and raster image overlayed above which covered smaller area of vector layers. want to remove areas vector layers. attaching print screen image.
... View more
03-28-2015
02:24 AM
|
0
|
1
|
3976
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|