isciences / exactextract

Fast and accurate raster zonal statistics
Apache License 2.0
246 stars 32 forks source link

GDALWriter: optionally pass in driver_name #39

Closed chapmanjacobd closed 1 year ago

chapmanjacobd commented 1 year ago

I don't know C++ so this might be all wrong

dbaston commented 1 year ago
/home/dan/dev/exactextract/src/gdal_writer.cpp: In constructor ‘exactextract::GDALWriter::GDALWriter(const std::string&, const std::string&)’:
/home/dan/dev/exactextract/src/gdal_writer.cpp:30:18: error: declaration of ‘auto driver_name’ shadows a parameter [-Werror=shadow]
   30 |             auto driver_name = get_driver_name(filename);
      |                  ^~~~~~~~~~~
/home/dan/dev/exactextract/src/gdal_writer.cpp:26:78: note: shadowed declaration is here
   26 |     GDALWriter::GDALWriter(const std::string & filename, const std::string & driver_name)
      |                                                          ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/home/dan/dev/exactextract/src/gdal_writer.cpp:31:13: error: ‘driver’ was not declared in this scope
   31 |             driver = GDALGetDriverByName(driver_name.c_str());
      |             ^~~~~~
/home/dan/dev/exactextract/src/gdal_writer.cpp:34:13: error: ‘driver’ was not declared in this scope
   34 |             driver = GDALGetDriverByName(driver_name.c_str());
      |             ^~~~~~
/home/dan/dev/exactextract/src/gdal_writer.cpp:37:13: error: ‘driver’ was not declared in this scope
   37 |         if (driver == nullptr) {
      |             ^~~~~~
/home/dan/dev/exactextract/src/gdal_writer.cpp:47:32: error: ‘driver’ was not declared in this scope
   47 |         m_dataset = GDALCreate(driver, filename.c_str(), 0, 0, 0, GDT_Unknown, nullptr);

(I know, having the CI on GitLab is not convenient. Would be nice to get it moved over here.)

chapmanjacobd commented 1 year ago

I will try merging into the Python bindings branch instead with a few more changes https://github.com/jdalrym2/exactextract/pull/3