Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
boriskaus committed Feb 22, 2024
1 parent 0026517 commit f31afc3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ext/GMT_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function ImportGeoTIFF(fname::String; fieldname=:layer1, negative=false, iskm=tr
# Transfer to GeoData
nx,ny = length(G.x)-1, length(G.y)-1
Lon,Lat,Depth = LonLatDepthGrid(G.x[1:nx],G.y[1:ny],0);
if hasfield(typeof(G),:z) & !constantDepth
if hasfield(typeof(G),:z)
Depth[:,:,1] = G.z';
if negative
Depth[:,:,1] = -G.z';
Expand All @@ -151,6 +151,11 @@ function ImportGeoTIFF(fname::String; fieldname=:layer1, negative=false, iskm=tr
end
data_field = NamedTuple{(fieldname,)}((data,));

if constantDepth
Depth = zero(Lon)
end


if contains(G.proj4,"utm")
zone = parse(Int64,split.(split(G.proj4,"zone=")[2]," ")[1]); # retrieve UTM zone
data_GMT = UTMData(Lon, Lat, Depth, zone, NorthernHemisphere, data_field)
Expand Down

0 comments on commit f31afc3

Please sign in to comment.