I have a batch of rasters (circa 8000 GeoTIFF near-infrared ortophotomaps, 12-15 MB size each). I am looking for way to perform bulk classification (supervised or not) and vectorization (to shapefile) of created classes for this batch. I know that it is possible in Erdas Imagine and ENVI, but I am not 100% sure if in open-source software (QGIS, GRASS, SAGA, ILWIS) also. Does anyone have any experience in this matter?


Yes GRASS can do this. Your question is a bit vague. The solution would involve a small bash shell script to loop over each raster, import, classify, vectorize, and write out results.

Pseudo code:

launch grass for generic location
for file in filelist; do
    r.in.gdal -c location file  # create new location
    g.mapset location           # switch to new location
    r.in.gdal file              # import file
    classify  # see https://grasswiki.osgeo.org/wiki/Image_classification
    r.to.vect                   # raster to vector
    r.out.gdal or v.out.ogr     # export data
  • 1
    Small hint: r.external may be of interest here rather than r.in.gdal. Likewise r.external.out rather than r.out.gdal. – markusN Sep 4 '16 at 21:32

In QGis you could use the Graphical Modeler from the Processing Toolbox and run it as a batch process.

1) Create a model for classifying and vectorizing one image. For unsupervised classification you could use Saga GIS Cluster Analysis tool. And then vectorize using some other tool (GDAL/OGR; SAGA).

2) With the model saved, right click on the model name from the processing toolbox and select "Execute as batch process".

3) In your input field, choose to select you files from the filesystem. navigate to the directory where your GeoTiffs are located, select all and run.

PS - I haven't tested with this much input files (8000) and I've never used the SAGA GIS cluster algorithm. I only know that it exists.

PS2 - Here is a QGis Graphical Modeler tutorial, just in case

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.