Created
October 8, 2019 19:42
-
-
Save hobu/06c62c005ca12e77de3ec30bf5dbd09c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GDALDriverManager* hMgr = GetGDALDriverManager(); | |
| std::unique_ptr<GDALDriver> hDriver = std::unique_ptr<GDALDriver>(hMgr->GetDriverByName(aoDrivers[0].c_str())); | |
| if (!hDriver) | |
| { | |
| CPLError(CE_Failure, CPLE_AppDefined, | |
| "Cannot get driver for %s", aoDrivers[0].c_str()); | |
| return CE_Failure; | |
| } | |
| /* create output raster */ | |
| // GDALDatasetH hDstDS = nullptr; | |
| hDstDS = std::unique_ptr<GDALDataset>(hDriver->Create(pszTargetRasterName, nXSize, nYStop - nYStart, 1, GDT_Byte, nullptr)); | |
| if (!hDstDS) | |
| { | |
| CPLError(CE_Failure, CPLE_AppDefined, | |
| "Cannot create dataset for %s", pszTargetRasterName); | |
| return CE_Failure; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment