Skip to content

Commit

Permalink
Removed methods deprecated in GDAL3.6 (MINOR) (#14)
Browse files Browse the repository at this point in the history
- Removed the usage of VSISetCredential and VSIClearCredential that
   have been deprecated in GDAL 3.6
  • Loading branch information
BlakeOrth authored Aug 16, 2023
1 parent be9737e commit 207eed0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ It was also updated to support gdal 3.x, while the older version wouldn't work o
## Installation

1) go get github.com/seerai/godal
2) install libgdal-dev 3.5+
2) install libgdal-dev 3.6+
- See [gdal's installation documentation for more details](https://gdal.org/download.html#). Note that many repos are not updated to 3.5 yet in which case there are [instructions for building from source](https://gdal.org/download.html#build-instructions).
3) go build


## Compatibility

This software has been tested most recently on Ubuntu 20.04 with gdal 3.5
This software has been tested most recently on Ubuntu 20.04 with gdal 3.6

## Examples

Expand Down
10 changes: 4 additions & 6 deletions gdal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1641,8 +1641,7 @@ func VSIFileFromMemBuffer(filename string, data []byte, takeOwnership bool) (VSI
return VSIFile{file}, nil
}

// Set a credential (or more generally an option related to a virtual file system) for a given path prefix.
func VSISetCredential(path string, key string, value string) {
func VSISetPathSpecificOption(path string, key string, value string) {

cPath := C.CString(path)
cKey := C.CString(key)
Expand All @@ -1653,15 +1652,14 @@ func VSISetCredential(path string, key string, value string) {
C.free(unsafe.Pointer(cValue))
}()

C.VSISetCredential(cPath, cKey, cValue)
C.VSISetPathSpecificOption(cPath, cKey, cValue)
}

// Clear credentials set with VSISetCredential()
func VSIClearCredentials(path string) {
func VSIClearPathSpecificOption(path string) {
cPath := C.CString(path)
defer C.free(unsafe.Pointer(cPath))

C.VSIClearCredentials(cPath)
C.VSIClearPathSpecificOptions(cPath)
}

/*
Expand Down

0 comments on commit 207eed0

Please sign in to comment.