jproville

Max() in ArcGIS 10

Discussion created by jproville on Jul 30, 2013
Hi,

I've seen some of the other threads about this, and I'm aware that the Max() statement has been stripped from the Raster Calculator as of ArcGIS 10. This was extremely handy for running quick Maximization routines and the reason why functionality like this would be stripped rather than left in eludes me....

Leaving that aside, I have some RC code I was using in Arc 9.3 with Max() statements embedded within Con()s. I'd love to hear any creative ideas of how I might be able to get this to work in Arc 10, because I can't see how using Cell Statistics or Raster Properties GUI tools can be a solution here.

The code basically looks through a pile of ~23 rasters, and assigns an index value ranging from 1 to 23 depending on which of these rasters contained the maximum value. My plan is to try and replace specific terms to make the syntax work with Python but any other ideas would be hugely helpful. Thanks! Sample code below:


Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) < -9997,-9999, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [CottonLB] ,1, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [FodderLB] ,2, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [FruitsLB] ,3, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [GroundnutLB] ,4, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [JatrophaLB] ,5, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [MaizeLB] ,6, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [MilletLB] ,7, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [MiscanthusLB] ,8, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [NarcostimulantsLB] ,9, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [OilpalmLB] ,1LB, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [PulsesLB] ,11, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [RapeseedLB] ,12, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [RiceLB] ,13, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [RootsLB] ,14, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [SorghumLB] ,15, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [SoybeanLB] ,16, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [SugarbeetLB] ,17, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [SugarcaneLB] ,18, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [SunflowerLB] ,19, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [SwitchgrassLB] ,2LB, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [TubersLB] ,21, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [VegetablesLB] ,22, Con(max([CottonLB],[FodderLB],[FruitsLB],[GroundnutLB],[JatrophaLB],[MaizeLB],[MilletLB],[MiscanthusLB],[NarcostimulantsLB],[OilpalmLB],[PulsesLB],[RapeseedLB],[RiceLB],[RootsLB],[SorghumLB],[SoybeanLB],[SugarbeetLB],[SugarcaneLB],[SunflowerLB],[SwitchgrassLB],[TubersLB],[VegetablesLB],[WheatLB]) == [WheatLB] ,23))))))))))))))))))))))))

Outcomes