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.

I'm trying to merge 2 datasets (both shapefiles, but I can convert them to raster layers if necessary) where the values are compared, and whichever is higher becomes the new value for the layer. How would I got about this? They aren't quite adjacent to one another, because there's a fairly large overlap in the middle. I'm using ArcMap 10.1

share|improve this question

1 Answer 1

up vote 7 down vote accepted

To do this you would first Union (keep all fields) the two shapefiles together and add a numeric field called say MaxValue.

Then, assuming you have values from shapefile1 and shapefile2 called val1 and val2 respectively you can use the Calculate Field tool with the settings below to calculate MaxValue:

Parser:

Python

Expression:

Reclass(!val1!,!val2!)

Code Block:

def Reclass(val1,val2):
  if (val1 >= val2):
    return val1
  else:
    return val2
share|improve this answer
2  
Thanks very much. Because I needed to convert them into raster files anyway, I did that, and further down the line I simply used cell statistics with the MAXIMUM function to merge the 2 layers. –  collateral127 Sep 2 '13 at 9:09
    
Your code block appears to implement the built-in max function. –  whuber Sep 4 '13 at 17:35

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.