Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

This is a question out of curiosity rather than a problem as I am not the most experienced with raster datasets and I wonder if there is a better solution to my current approach. I am trying create a new raster dataset based off the conditions of two raster datasets. i.e. if population size <100 and mean age <10, reclassify to value 1. Now the issue is not creating a conditional statement but if there are several possible categories - say 49, that would require 49 multiple conditional statements. For example:

OutRas = Con((pop_ras < 100) & (age_ras < 10), 1, Con(pop_ras > 100) & ((pop_ras < 200) & (age_ras  < 10), 2, ..., 0))

At the moment I use the following procedure:

1) reclassify population into 7 categories

2) reclassify age into 7 categories

3) add age and population (to create 49 classes)

This approach would require 3 geoprocessing steps as opposed to one but require considerable less time scripting. I feel that there might be a simpler solution that I am not realization (perhaps a lookup table, SQL). Any thoughts? ideas? Which method is better - speed?

share|improve this question
    
I don't follow: 49 conditional statements is (at least) 49 geoprocessing steps, not one. How do you solve this problem with fewer than three grid operations? –  whuber Dec 2 '11 at 2:18
    
This would be a good question for the r-geo-sig. –  Brad Nesom Dec 2 '11 at 3:12
    
sorry - stat.ethz.ch/mailman/listinfo/r-sig-geo –  Brad Nesom Dec 2 '11 at 3:29
    
@whuber What I meant is the use of 49 conditional statements within one function line. See under multiple conditional statements at help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//… –  BJEBN Dec 2 '11 at 8:50
    
The example you have included helps me understand what you mean, thanks. I just want to point out how inefficient this is: each of the terms, such as "pop_ras < 100", requires an entire grid operation, and each of the conjunctions, such as "&", requires another, and so does each "Con". That potentially has you doing hundreds of grid operations in order to achieve something that can be done in three operations: two reclassifications and a 'combine' (your step 3). Moreover, what's simple for ArcGIS is also simple and clear to code, which is more reliable and maintainable. –  whuber Dec 2 '11 at 14:50
show 1 more comment

1 Answer 1

up vote 4 down vote accepted

Use the actual COMBINE tool on your original rasters (which must be integer values): http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Combine/009z0000007r000000/. @whuber is correct in that you don't want to be performing multiple raster calculations when it is more efficient to apply SQLs to the combined raster attribute table. The beauty of this approach is that you can apply many different selections/queries (as well as categorical classification schemes to the population and age data) to the combine table (without having to wait for the raster calculations each time).

share|improve this answer
    
Thanks Charlene that is one solution that can be applied and I agree that it has its benefits over map algebra... The only issue is when reclassification of those at a later date (i.e. combine certain scenarios) when the assigned unique values is slightly different for each analysis - for example one raster grid does not have any age < 10 etc... –  BJEBN Dec 3 '11 at 15:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.