Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GDALNearblack binding #114

Merged
merged 70 commits into from
Sep 28, 2023
Merged
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
59a03b0
Implement functional `godalGridCreate` wrapper (WIP)
pericles-tpt Aug 4, 2023
68ace26
Add `gridCreateOpts` go struct
pericles-tpt Aug 4, 2023
b3440ca
Implement `GridCreate` go function, add `GriddingAlg` enum
pericles-tpt Aug 4, 2023
cbf5c30
Add working `TestGridCreate` (needs asserts)
pericles-tpt Aug 4, 2023
21751d1
Update `godalGridCreate` to support multiple gridding algs and their …
pericles-tpt Aug 12, 2023
4ebb848
Update `GridCreate` for new `godalGridCreate` signature
pericles-tpt Aug 12, 2023
a8120dc
Fix `GridCreate` call in `TestGridCreate`
pericles-tpt Aug 12, 2023
5fb5963
Remove unused `String()` method for `GriddingAlg`, add `gridAlgFromSt…
pericles-tpt Aug 18, 2023
93fdfc5
Replace redundant `gridAlgorithm` param, replace with string lookup o…
pericles-tpt Aug 18, 2023
4d7e2af
Finish `TestGridCreate()` add required test files to "testdata/"
pericles-tpt Aug 18, 2023
97b6247
Update `go.sum`
pericles-tpt Aug 18, 2023
2c6ab1b
Remove TODOs, minor naming changes
pericles-tpt Aug 18, 2023
f46ce9c
Replace hardcoded size properties
pericles-tpt Aug 24, 2023
6745188
Create separate `GDALGridParseAlgorithmAndOptions()` binding
pericles-tpt Aug 24, 2023
dc22310
Update `GridCreate()` to use new `godalGridParseAlgorithmAndOptions()…
pericles-tpt Aug 24, 2023
07826c4
Add `setGridCreateOption`
pericles-tpt Aug 24, 2023
8fb3bc4
Add comment for `GridCreate()`
pericles-tpt Aug 24, 2023
cdb176d
Add `GDAL_VERSION_NUM` check to include the correct function name for…
pericles-tpt Aug 25, 2023
a06e3bc
Fix indentation
pericles-tpt Aug 25, 2023
912be53
Make `GriddingAlg` a private enum
pericles-tpt Aug 31, 2023
7724496
Improve clarity of griddingAlg string -> enum conversion
pericles-tpt Aug 31, 2023
65a90bd
Merge functionality from `godalGridParseAlgorithmAndOptions` into `go…
pericles-tpt Aug 31, 2023
d4775b1
Remove `[]byte` return parameter from `GridCreate`
pericles-tpt Aug 31, 2023
960be8a
Update `TestGridCreate` for `GridCreate` changes
pericles-tpt Aug 31, 2023
faa1c50
Change `uint32` params in `GridCreate()` to `int`
pericles-tpt Aug 31, 2023
16ce078
Remove "grid" test files from `testdata/`
pericles-tpt Sep 7, 2023
e478b45
Rename `setGridCreateOption()` to `setGridCreateOpt()` (for consistency)
pericles-tpt Sep 7, 2023
18bec58
Remove unused `options` pointer
pericles-tpt Sep 7, 2023
8f758d2
Remove redundant `griddingAlg` and `gridAlg()`
pericles-tpt Sep 7, 2023
1f2c6a1
Improve `GridCreate` tests by - testing two algorithms and justifying…
pericles-tpt Sep 7, 2023
dd5e8ad
Remove unneeded import, update `go.mod`
pericles-tpt Sep 7, 2023
e5b000d
Remove duplicate `gridCreateOpts`
pericles-tpt Sep 7, 2023
0752f00
Improve error message for "unknown gridding algorithm"
pericles-tpt Sep 7, 2023
3e9c76c
Remove `numCoords` from `GridCreate()`, add array equality check
pericles-tpt Sep 7, 2023
b14a350
Add compatibility check in `godalGridCreate`, update test behaviour
pericles-tpt Sep 8, 2023
b294589
Implement `GDALGrid` binding and tests for it
pericles-tpt Sep 8, 2023
30b6d19
Minor test fixes
pericles-tpt Sep 8, 2023
9c625ec
Remove unneeded code, add temporary log to test
pericles-tpt Sep 8, 2023
6889829
Add manual `t.Fail()` for results logging
pericles-tpt Sep 8, 2023
df45c87
Fix WKT coords and remove temporary lines in tests
pericles-tpt Sep 8, 2023
d8786a1
Minor change for testing
pericles-tpt Sep 8, 2023
a567ff0
Minor change testing transform modification
pericles-tpt Sep 8, 2023
f4302eb
Remove temporary testing modification
pericles-tpt Sep 8, 2023
7b59ad9
Add missing `return` for error condition
pericles-tpt Sep 8, 2023
6786078
Swap `-tye` args for `TestGridLinear()`
pericles-tpt Sep 14, 2023
42e7a40
Add comment explaining `yMin`/`yMax` swap
pericles-tpt Sep 14, 2023
7f90ec2
Merge branch 'airbusgeo:main' into grid
pericles-tpt Sep 14, 2023
3c013ab
Merge branch 'grid'
pericles-tpt Sep 14, 2023
44bcdc8
Removing suggested sections for testing
pericles-tpt Sep 15, 2023
f4ecb34
Add `Grid()` tests for "Unsupported" and "Unknown" switches
pericles-tpt Sep 15, 2023
35739b4
Add layer to ds for "switch" tests
pericles-tpt Sep 15, 2023
0e5c475
Try removing `TestGridUnsupportedSwitch`
pericles-tpt Sep 15, 2023
ab4f6c9
Update godal.cpp
pericles-tpt Sep 15, 2023
4e0e1a3
Update godal.go
pericles-tpt Sep 15, 2023
00694e6
User error handler in `TestGridUnknownSwitch()`
pericles-tpt Sep 15, 2023
ee953a9
Add `GridOption` to `ErrLogger`
pericles-tpt Sep 15, 2023
90d400f
Add `TestGridInvalidSwitch()` which uses `ErrorHandler`
pericles-tpt Sep 15, 2023
f55a363
Merge branch 'grid-2'
pericles-tpt Sep 15, 2023
e55f4dc
Implemented `Nearblack` binding and tests
pericles-tpt Sep 21, 2023
7f873c3
Merge branch 'near-black'
pericles-tpt Sep 21, 2023
9e6676d
Change to `TestNearblackWhite` to improve test coverage
pericles-tpt Sep 21, 2023
70d195d
Add new `TestNearblackReplaceSrcDs` test
pericles-tpt Sep 21, 2023
d8cc18a
Add error check without `ErrorHandler` back to `Grid` test
pericles-tpt Sep 21, 2023
4e2914f
Update comment
pericles-tpt Sep 22, 2023
07157ce
Update comment
pericles-tpt Sep 22, 2023
d9ab5ba
Remove duplicate `godalGrid` function signature
pericles-tpt Sep 22, 2023
ec2de04
Add missing deferred `Close()`
pericles-tpt Sep 22, 2023
b95aaee
Add missing deferred `Close()`
pericles-tpt Sep 22, 2023
95b7d58
Split `Nearblack` into `Nearblack` and `NearblackInto` functions, add…
pericles-tpt Sep 22, 2023
71f3dd2
Split `Nearblack` and `NearblackInto` documentation
pericles-tpt Sep 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change uint32 params in GridCreate() to int
pericles-tpt committed Aug 31, 2023

Verified

This commit was signed with the committer’s verified signature.
ulucinar Alper Rifat Ulucinar
commit faa1c5076f6e58c19dba771cb6824944bfc4cba7
8 changes: 4 additions & 4 deletions godal.go
Original file line number Diff line number Diff line change
@@ -3813,16 +3813,16 @@ func BuildVRT(dstVRTName string, sourceDatasets []string, switches []string, opt
//
// NOTE: For valid gridding algorithm strings see: https://gdal.org/programs/gdal_grid.html#interpolation-algorithms
func GridCreate(pszAlgorithm string,
numCoords uint32,
numCoords int,
xCoords []float64,
yCoords []float64,
zCoords []float64,
dfXMin float64,
dfXMax float64,
dfYMin float64,
dfYMax float64,
nXSize uint32,
nYSize uint32,
nXSize int,
nYSize int,
buffer interface{},
opts ...GridCreateOption,
) error {
@@ -3847,7 +3847,7 @@ func GridCreate(pszAlgorithm string,
var (
dtype = bufferType(buffer)
dsize = dtype.Size()
numGridBytes = C.int(int(nXSize) * int(nYSize) * dsize)
numGridBytes = C.int(nXSize * nYSize * dsize)
cBuf = cBuffer(buffer, int(numGridBytes)/dsize)
)
cgc = createCGOContext(nil, gco.errorHandler)
12 changes: 6 additions & 6 deletions godal_test.go
Original file line number Diff line number Diff line change
@@ -3983,12 +3983,12 @@ func TestGridCreate(t *testing.T) {
var (
err error

numCoords uint32 = 3
xCoords = []float64{0, 1, 0}
yCoords = []float64{0, 0, 1}
zCoords = []float64{1, 0, 0}
outXSize uint32 = 512
outYSize uint32 = 512
numCoords int = 3
xCoords = []float64{0, 1, 0}
yCoords = []float64{0, 0, 1}
zCoords = []float64{1, 0, 0}
outXSize int = 512
outYSize int = 512
)

// Open the test raster file (generated with command below) and read the values at each coordinate