Calculate acreage in the Calculate field tool

1043
8
12-14-2012 11:35 AM
DerekNewland
New Contributor III
Okay, so I am working on a model that is mostly just a series of tools.  However I have dissolved 2 data layers within the model and I wish to calculate the acreage of the 2 new layers which each consist of only 1 feature each. I have added the Add Field tool for both of my outputs and now need to calculate the field value within the model using the calculate field tool.  The problem is that I am a complete beginner in python and have no idea how to go about scripting this. It doesn't seem like this should be too much of an issue, but nothing I have found so far in the forum has helped me out. Anybody have any ideas? I still have to figure out how to calculate the percentage of overlap between the 2 layers after I get within my model as well.

Any help would be appreciated.

Derek
Tags (2)
0 Kudos
8 Replies
KevinHibma
Esri Regular Contributor
You're scripting, so you can use the Calculate Field tool to work this out.
See this link, it provides examples to Calc Field.
http://resources.arcgis.com/en/help/main/10.1/index.html#/Calculate_Field_examples/005s0000002m00000...

An example in your case:
Parser:
Python

Expression:
!shape.area@acres!


Side note - you can do a "Calculate Geometry" within the app, see the following:

http://resources.arcgis.com/en/help/main/10.1/index.html#//005s00000027000000
0 Kudos
DerekNewland
New Contributor III
Wait, it's really that simple?
0 Kudos
KevinHibma
Esri Regular Contributor
Unless I didn't understand your question completely, then yeah it should be.

You said:
I wish to calculate the acreage of the 2 new layers which each consist of only 1 feature each.

The instructions I gave will calc a field for a given layer. 1 to many features inside each layer will have their own acreage calculated on a per feature basis. So if I understand what you want to do, you'll have to do 2 calcs, once for each layer.
0 Kudos
DerekNewland
New Contributor III
Yes that is exactly what I was looking to do.  Now I just need to figure out the percentage of the acreage overlapped by the two layers within the model.  I should post a new thread for the that question though correct?

Thank you for your help

Derek
0 Kudos
KevinHibma
Esri Regular Contributor
Take a look at the post Dale has in this thread: http://forums.arcgis.com/threads/35219-Overlapping-polygons-cover-percentage
He does a better job of explaining than I ever could....
0 Kudos
PamJannise
New Contributor
I've used the methods you have described, first using the python expression !shape.area@acres! and using the calculate geometry function in ArcMap 10.  I set the precision  and scale to 0.  I get slightly different acreage amounts.  Not a big deal unless I am calculating small parcels or I'm figuring acreage for $ cost.  Has anyone come across this discrepancy or am I doing something wrong?
0 Kudos
MattSayler
Occasional Contributor II
I've used the methods you have described, first using the python expression !shape.area@acres! and using the calculate geometry function in ArcMap 10.  I set the precision  and scale to 0.  I get slightly different acreage amounts.  Not a big deal unless I am calculating small parcels or I'm figuring acreage for $ cost.  Has anyone come across this discrepancy or am I doing something wrong?


How different? They might be using different algorithms behind the scenes or there are differences in the math engines between the two languages. I think a lot of times to make the code efficient, stuff is written to calculate a value that is "good enough" rather than an exact value (sort of float vs fraction, i.e. 0.3333333333 vs 1/3). The descrepancy is usually pretty miniscule, but can still come into play depending on the task.

Also, if accuracy is really important, it's probably a good idea to research how well the projection you're using preserves area.
0 Kudos
PamJannise
New Contributor
Thanks, that makes sense.  The error isn't large, <10 per 185,000 acres but if I have to answer to a landowner I need to tell them a reason!
0 Kudos