Python Sample scripts

The following are sample scripts intended to give an idea how to use the GDAL’s Python interface. Please feel free to use them in your applications.

From gdal 3.2, Python utility scripts Programs are located inside the osgeo_utils module. From gdal 3.3, Python sample scripts are located inside the osgeo_utils.samples sub-module.

Python Raster Sample scripts

Python Vector Sample scripts

Python Coordinate Reference System Sample scripts

Python direct ports of c++ programs

  • gdalinfo: A direct port of apps/gdalinfo.c

  • ogrinfo: A direct port of apps/ogrinfo.cpp

  • ogr2ogr: A direct port of apps/ogr2ogr.cpp

  • gdallocationinfo: A direct port of apps/gdallocationinfo.cpp

Python sample scripts that are now programs

Sample scripts might be upgraded to proper gdal utilities (programs) in next versions with added functionality and documentation. The following samples from previous versions are now programs.