2

How can I efficiently subdivide one raster into multiple rasters using the arcpy.SearchCursor?

For example if I have a slope and I was to subdivide into 3 rasters:

slope1 with values between 0 and 25degress
slope2 with values between 25 and 50degress
slope3 with values > 50degress

Here I should easily solve the problem with arcpy.AddFieldDelimiters

If for example i have one categorical file and I also want to do the same thing? If the file I have has only one field with the identification of the category and it's a string.

Value Count Type
 1 1023 Protected Area 2000
 2 1000 Protected Area 2001
 3 9555 Protected Area 2002
 4 9500 Protected Area 2003
 5 200 Construction Site
 6 (...) (...)

Should I use arcpy.AddFieldDelimiters?

Furthermore, if I want to aggregate certain categories in only one raster, other groups of categories in other rasters?

When using the Search Cursor we are doing the changes directly to the source file ?should I create a copy for each raster I want to produce?

asked Apr 5, 2012 at 16:28
1
  • 1
    Just for clarification, SearchCursor by itself doesn't modify your original attribute table. InsertCursor and UpdateCursor do. SearchCursor is basically a read-only data access object. Commented Apr 5, 2012 at 16:51

1 Answer 1

3

If you have the Spatial Analyst extension, you can use ExtractByAttributes or Raster Calculator to create your three rasters. Both of these tools can be called up in Python and are simpler (IMHO) solutions to using cursors.

answered Apr 5, 2012 at 17:20

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.