I'm coding an algorithm which uses as an input a map from QGIS. The software has been implemented in C++ and my idea is to convert, automatically, a shapefile into a raster one.

Is there any function in C++, from the QGIS api, to perform this task automatically? Besides: is there any data structure in the QGIS framework to handle matrices which comes from raster files?

1 Answer 1


I wasn't able to locate an API method in QGIS to do it, but there is a GDAL function: GDALRasterizeGeometries (there are a couple of variants.) This method is used internally by gdal_rasterize.

Your Answer

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

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