using GMT
t = 0:0.01:2pi;
plot(t, cos.(t).+rand(length(t))*0.1, inset=(zoom=(pi/2,pi/6), box=(fill=:lightblue,)), show=true)
$ “D:\tmp3\julia-1.10.9\bin\julia.exe” test.jl
ERROR 1: Attempt to create 0x0 dataset is illegal,sizes must be larger than zero.
ERROR 10: Pointer ‘hDS’ is NULL in ‘GDALDatasetCreateLayer’.ERROR 10: Pointer ‘hLayer’ is NULL in ‘OGR_L_GetLayerDefn’.
ERROR 10: Pointer ‘hDefn’ is NULL in ‘OGR_F_Create’.
ERROR 10: Pointer ‘hFeat’ is NULL in ‘OGR_F_SetGeometry’.
ERROR: LoadError: UndefVarError:
result
not defined
Stacktrace:
[1] setgeom!(feature::GMT.Gdal.Feature, geom::GMT.Gdal.IGeometry)
@ GMT.Gdal D:\tmp3\julia-1.10.9.julia\packages\GMT\acUHa\src\gdal.jl:942
[2] gmt2gd(D::Vector{GMTdataset{Float64, 2}}; save::String, geometry::String)
@ GMT D:\tmp3\julia-1.10.9.julia\packages\GMT\acUHa\src\gdal_utils.jl:749
[3] gmt2gd(D::GMTdataset{Float64, 2}; save::String, geometry::String)
@ GMT D:\tmp3\julia-1.10.9.julia\packages\GMT\acUHa\src\gdal_utils.jl:668
[4] gmt2gd(D::Matrix{Float64}; save::String, geometry::String)
@ GMT D:\tmp3\julia-1.10.9.julia\packages\GMT\acUHa\src\gdal_utils.jl:667
[5] gmt2gd
@ D:\tmp3\julia-1.10.9.julia\packages\GMT\acUHa\src\gdal_utils.jl:667 [inlined]
[6] helper_2geoms(D1::Matrix{Float64}, D2::Matrix{Float64})
@ GMT.Gdal D:\tmp3\julia-1.10.9.julia\packages\GMT\acUHa\src\gdal_extensions.jl:606
[7] #helper_geoms_run_fun#127
@ D:\tmp3\julia-1.10.9.julia\packages\GMT\acUHa\src\gdal_extensions.jl:572 [inlined]
[8] helper_geoms_run_fun (repeats 2 times)
@ D:\tmp3\julia-1.10.9.julia\packages\GMT\acUHa\src\gdal_extensions.jl:569 [inlined]
[9] intersection
@ D:\tmp3\julia-1.10.9.julia\packages\GMT\acUHa\src\gdal_extensions.jl:128 [inlined]
[10] connect_rectangles(R1::Vector{Float64}, R2::Vector{Float64})
@ GMT D:\tmp3\julia-1.10.9.julia\packages\GMT\acUHa\src\utils.jl:1281
[11] zoom_reactangle(_cmd::Vector{String}, isplot::Bool)
@ GMT D:\tmp3\julia-1.10.9.julia\packages\GMT\acUHa\src\psxy.jl:1602
[12] _common_plot_xyz(cmd0::String, arg1::GMTdataset{Float64, 2}, caller::String, O::Bool, K::Bool, is3D::Bool, d::Dict{Symbol, Any})
@ GMT D:\tmp3\julia-1.10.9.julia\packages\GMT\acUHa\src\psxy.jl:244
[13] #common_plot_xyz#924
@ D:\tmp3\julia-1.10.9.julia\packages\GMT\acUHa\src\psxy.jl:13 [inlined]
[14] plot(arg1::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, arg2::Vector{Float64}; kw::@Kwargs{inset::@NamedTuple{zoom::Tuple{Float64, Float64}, box::@NamedTuple{fill::Symbol}}, show::Bool})
@ GMT D:\tmp3\julia-1.10.9.julia\packages\GMT\acUHa\src\plot.jl:139
[15] top-level scope
@ D:\gmtex\SBAS\test.jl:4
in expression starting at D:\gmtex\SBAS\test.jl:4
GMT.jl v1.31.1 has a programming error in the connect_rectangles
function at line 1281 of the utils.jl file, where the variable result
is used before being defined. The error occurs in the internal GMT.jl code when it tries to process the inset=(zoom=(pi/2,pi/6), box=(fill=:lightblue,))
parameter. The package attempts to create geometric connections between rectangles for the zoom inset feature, but fails due to the undefined result
variable.