I have a raster of land cover (resolution roughly 300x300 m) and a raster grid of zones (cells about 14000x14000 m). What I need is to calculate the precentage of each land cover category within each zone. As far as I got, I found out that Tabulate Area is a pretty handy tool, although rather unpredictable. What troubles me most at the moment is that I need to automate this process, but within the Python script which saves the land cover dataset as a variable, I only get one category of land cover assigned to each zone.

custom_land_use_tif = "D:\\<path>\\custom_land_use.tif"
arcpy.gp.TabulateArea_sa(grid, "Value", custom_land_use_tif, "Value", "Tabulate")

Python script results

However, when I run the TabulateArea line in Python Window within ArcMap and add the class layer which is loaded in the data frame, the results are plausible (nevermind the inaccuracies in the total area, although if anyone has any thoughts on that, it would be helpful as well).

arcpy.gp.TabulateArea_sa("grid", "Value", "custom_land_use.tif", "Value", "Tabulate")

Python window results

Any ideas if there's a way to convince the tool to produce the second shown table within a script? I'm on ArcGIS 10.3 Basic.

  • I've seen Tabulate Area do some weird stuff before but that is pretty bad. Have you reported this to Esri? May 11 '16 at 12:41
  • @jbchurchill Not yet, I assumed that maybe I am missing something or that there is a workaround. But I must agree that working with Tabulate Area was very shaky from the start.
    – Janina
    May 11 '16 at 13:16

Alright, I figured it out. The problem was with projections. The raster was in an unprojected WGS coordinate system. I assume that while loaded in ArcMap, it was projected on-the-fly and therefore the results showed.

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.