I would like to collect a table of equivalent or close enough gdal based functions to replace ArcGIS functions (esp in spatial analyst). Are there functions available using gdal to perform the following ArcGIS functions:

  1. Lookup
  2. Zonal statistics
  3. Focal statistics
  4. Nibble
  5. Iterate through raster VAT
  6. Combine
  7. Mosaic

The key is to have a ready reckoner of such functions, so ArcGIS based code can be relatively painlessly changed to one based on gdal.

  • Also, feel free to add recipes that you might think are relevant.
    – user1186
    Apr 30 '15 at 2:55
  • 2
    Are you open to using GRASS (no pun intended)?
    – Aaron
    May 2 '15 at 18:46
  • 1
    Absolutley, I should have mentioned that!
    – user1186
    May 2 '15 at 20:56
  • I notice that you have not yet taken the Tour which is explicit that there should be just one question per question. Here you are effectively asking seven questions in one.
    – PolyGeo
    Oct 13 '15 at 6:00

Here are some options

  1. Lookup: (not sure)
  2. Zonal stats: The GRASS module r.statistics
  3. Focal stats: GRASS r.neighbors
  4. Nibble: (don't know)
  5. Iterate through VAT: I think that the concept of a VAT is specific to Arc*, but r.describe might get close.
  6. Combine: Just use GRASS r.mapcalc
  7. Mosaic: GRASS - r.patch or gdal_merge

In addition to Micha's list, here is how you can nibble with GRASS

1) mask your image with r.mapcalc

2) with the resulting image, interpolate to the nearest neighbour using r.surf.nnbathy

For combine, I would use r.cross but you can also do it using r.mapcalc with this algorithm

For mosaic, I would use gdalbuildvrt: it is often not necessary to create a new file, and you can translate it after if it becomes necessary.

As mentioned by @webrian, r.reclass can be used for lookup.

VAT's are tables, so you can use table editing tools to update them (see e.g. this post)

  • thanks @radoxju, is there a way to replace the setcursor and updatecursor command in ArcGIS?
    – user1186
    May 4 '15 at 13:29
  • insertCursor and updateCursor are the methods to parse the rows of a table in ArcGIS, so I would say YES(you can update a table in QGIS), but it depends on what you want to do. Many things can be done with the field calculator in QGIS, but if you work with raster this question could help : gis.stackexchange.com/questions/107996/…
    – radouxju
    May 4 '15 at 13:38
  • 1
    By the way, please ask separate questions when you can : you will attract more specific answers.
    – radouxju
    May 4 '15 at 13:50
  • sorry about that, will take care...
    – user1186
    May 4 '15 at 13:52

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