gdal_handler.h File Reference

Simple wrappers of GDAL API that compatible with all versions. More...

#include <memory>
#include "gdal.h"
#include "gdal_priv.h"
#include <ogrsf_frmts.h>
#include "cpl_string.h"
#include "ogr_spatialref.h"

Go to the source code of this file.

Classes

struct  GDALVectorDSDeleter
 
struct  GDALRasterDSDeleter
 

Typedefs

typedef OGRDataSource GDALVectorDS
 
typedef GDALDataset GDALRasterDS
 
typedef std::unique_ptr< GDALVectorDS, GDALVectorDSDeleterGDALVectorDSHandle
 
typedef std::unique_ptr< GDALRasterDS, GDALRasterDSDeleterGDALRasterDSHandle
 

Functions

GDALVectorDS * OpenVector (const char *path, int read_only=true)
 
void CloseVector (GDALVectorDS *ds)
 
GDALRasterDS * OpenRaster (const char *path, int read_only=true, const char *const *open_options=nullptr)
 
GDALRasterDS * CreateRaster (const char *driverName, const char *filename, int xsize, int ysize, int bands, GDALDataType dtype, char **papszOptions=nullptr)
 
void CloseRaster (GDALRasterDS *ds)
 

Detailed Description

Simple wrappers of GDAL API that compatible with all versions.

Remarks
  • 1. 2025-09-07 - lj - Initial implementation and debugged on multiple compilers.
Note
No exceptions will be thrown.
Author
Liangjun Zhu, zlj(at)lreis.ac.cn
Version
0.2