3

I'm new in ArcMap and I'm working on a evaluation of land value would like to create a calculation routine of land value from the area and the type of area.

I have a shapefile and in my attribute table have 3 columns: TYPE, AREA and PRICE. The PRICE column would have to be calculated automatically if possible like Shape_Area field in geodatabase.

if TYPE is PLANE -> PRICE = AREA x 100000

if TYPE is PASTURE ROUGH -> PRICE = AREA x 60000

if TYPE is VEGETATION -> PRICE = AREA x 15000

Is it possible to do this in ArcMap?

If it is not possible to do it automatically then it's not a problem since I have to run the routine once and not three times.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338

1 Answers1

2

You need an if-block statement as follows. Open field calculator on your price field, and change the script to python on the left-top corner. In the code block copy and paste the following script:

 def LandValue(area,type):
   if (type == "PLANE"):
     return(area*100000)
   if (type == "ROUGH"):
     return(area*60000)
   if  (type == "VEGETATION"):
      return(area*15000)

Than in the expression window write the following line:

LandValue( !AREA!, !TYPE!)

dof1985
  • 3,146
  • 20
  • 32