Skip to content

Commit

Permalink
Add GCPSpatialRef and GCPProjection options for setGCPsOpts
Browse files Browse the repository at this point in the history
  • Loading branch information
pericles-tpt committed Oct 4, 2023
1 parent 9ca3805 commit 74d8882
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -1256,13 +1256,47 @@ type NearblackOption interface {

type setGCPsOpts struct {
errorHandler ErrorHandler
projString string
sr *SpatialRef
}

// SetGCPsOption is an option that can be passed to Dataset.SetGCPs()
type SetGCPsOption interface {
setSetGCPsOpt(sgOpt *setGCPsOpts)
}

type gcpProjStringOpt struct {
projString string
}

// GCPProjection sets the projection string as an option for SetGCPs
//
// NOTE: A non-nil `sr` takes precedence over `projString`
func GCPProjection(projStr string) interface {
SetGCPsOption
} {
return gcpProjStringOpt{projString: projStr}
}
func (gps gcpProjStringOpt) setSetGCPsOpt(sgOpt *setGCPsOpts) {
sgOpt.projString = gps.projString
}

type gcpSpatialRefOpt struct {
sr *SpatialRef
}

// GCPSpatialRef sets the *SpatialRef as an option for SetGCPs
//
// NOTE: A non-nil `sr` takes precedence over `projString
func GCPSpatialRef(sr *SpatialRef) interface {
SetGCPsOption
} {
return gcpSpatialRefOpt{sr: sr}
}
func (gsr gcpSpatialRefOpt) setSetGCPsOpt(sgOpt *setGCPsOpts) {
sgOpt.sr = gsr.sr
}

// RasterizeGeometryOption is an option that can be passed tp Dataset.RasterizeGeometry()
type RasterizeGeometryOption interface {
setRasterizeGeometryOpt(o *rasterizeGeometryOpts)
Expand Down

0 comments on commit 74d8882

Please sign in to comment.