Python script to derive new cells values from the current ones,I couldn???t figure out how to develop a code that change the values of cells based on If ???Then statements.Suppose that I got a raster where its cells have seven possible values:1. water, 2. road, 3. commercial, 4. forest area, 5. residential areas, 6. pasture and 7. row cropsand I wanted to derive a new values for the current cells based on the rules below (Sharaf Alkheder and Jie Shan) considering 3x3 window:1. IF tested pixel under consideration is water, THEN no growth is allowed at this pixel.2. IF tested pixel under consideration is road, THEN no growth is allowed at this pixel.3. IF tested pixel under consideration is residential OR commercial, THEN keep this pixelthe same without any change.4. IF tested pixel under consideration is either (forest OR pasture OR row crops) ANDthere are 4 commercial pixels in the neighborhood, THEN change tested pixel tocommercial.5. IF tested pixel under consideration is either (forest OR pasture OR row crops) ANDthere are 4 HEN change tested pixel to residential.Then how such code can be developed? any hints?Unfortunately, the built-in tools in the ArcGIS don't do this sort of work (such as focal statistics).[ATTACH=CONFIG]23087[/ATTACH]Thank youBestJamal
----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine