Monday 1 June 2015

python - Migrating from ArcGIS to gdal



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.



Answer



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)


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...