7

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.

4
  • Also, feel free to add recipes that you might think are relevant.
    – user1186
    Commented Apr 30, 2015 at 2:55
  • 2
    Are you open to using GRASS (no pun intended)?
    – Aaron
    Commented May 2, 2015 at 18:46
  • 1
    Absolutley, I should have mentioned that!
    – user1186
    Commented May 2, 2015 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
    Commented Oct 13, 2015 at 6:00

2 Answers 2

6

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
4
  • 2
    As far as I understand the Lookup, the GRASS module r.reclass should do it.
    – webrian
    Commented May 4, 2015 at 1:51
  • thanks @Micha, will r.describe be able to modify the VAT?
    – user1186
    Commented May 4, 2015 at 13:29
  • 2
    For zonal statistics, you can also use r.univar, v.rast.stats, v.vect.stats (see at page bottom of grass.osgeo.org/grass70/manuals/…)
    – markusN
    Commented May 4, 2015 at 14:20
  • 3
    Please consider to merge your answers also into grasswiki.osgeo.org/wiki/Tips_for_Arc_users
    – markusN
    Commented May 4, 2015 at 14:21
5
+50

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)

4
  • thanks @radoxju, is there a way to replace the setcursor and updatecursor command in ArcGIS?
    – user1186
    Commented May 4, 2015 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
    Commented May 4, 2015 at 13:38
  • 1
    By the way, please ask separate questions when you can : you will attract more specific answers.
    – radouxju
    Commented May 4, 2015 at 13:50
  • sorry about that, will take care...
    – user1186
    Commented May 4, 2015 at 13:52

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