5

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

7

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
  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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