Skip to content

Commit 515d4ef

Browse files
clean-up
1 parent 58598ca commit 515d4ef

1 file changed

Lines changed: 8 additions & 14 deletions

File tree

src/TIFFDatasets.jl

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -433,22 +433,8 @@ function name(v::Variable{T,N}) where {T,N}
433433
end
434434
end
435435

436-
437436
name(v::Coord) = string(v.name)
438437

439-
@inline function x_geo!(ds::Dataset,x_geo,i,j)
440-
gt = ds.geotransform
441-
shift = 0.5 # center
442-
x_geo .= gt[1] .+ (i .- shift) .* gt[2] .+ (j .- shift) .* gt[3]
443-
end
444-
445-
@inline function y_geo!(ds::Dataset,y_geo,i,j)
446-
gt = ds.geotransform
447-
shift = 0.5 # center
448-
y_geo .= gt[4] .+ (i .- shift) * gt[5] .+ (j .- shift) .* gt[6]
449-
end
450-
451-
452438
@inline function xy_geo(ds::Dataset,i,j)
453439
gt = ds.geotransform
454440
shift = 0.5 # center
@@ -457,6 +443,14 @@ end
457443
return (x_geo,y_geo)
458444
end
459445

446+
@inline function x_geo!(ds::Dataset,x_geo,i,j)
447+
x_geo .= getindex.(xy_geo.(Ref(ds),i,j'),1)
448+
end
449+
450+
@inline function y_geo!(ds::Dataset,y_geo,i,j)
451+
y_geo .= getindex.(xy_geo.(Ref(ds),i,j'),2)'
452+
end
453+
460454
function Base.size(v::Coord)
461455
if ndims(v) == 2
462456
return (v.parent.width,v.parent.height)

0 commit comments

Comments
 (0)