ERROR 4: `OSM_lines.gmt’ not recognized as a supported file format.
grdmath (api_import_grid): Not a supported grid format [OSM_lines.gmt]
[Session gmt (0)]: Error returned from GMT API: GMT_GRID_READ_ERROR (18)
[Session gmt (0)]: Error returned from GMT API: GMT_GRID_READ_ERROR (18)
The file was originally a shapefile converted to GMT format using ogr2ogr and looks like this, (note line numbers in first column not part of file):
ERROR 4: `lines.shp’ not recognized as a supported file format.
grdmath [ERROR]: Unable to open lines.shp.
grdmath [ERROR]: ERROR reading file (metadata) with gdalread.
grdmath (api_import_grid): Could not open file [lines.shp=gd]
[Session gmt (0)]: Error returned from GMT API: GMT_GRID_READ_ERROR (18)
[Session gmt (0)]: Error returned from GMT API: GMT_GRID_READ_ERROR (18)
From the documentation I cannot see why the ASCII file (.gmt) cannot be recognized by grdmath, but are there any suggestions to other formats I rather should use?
Actually should work since you are not using the aspatial data. But I think you need to move the OSM_lines.gmt file to be the argument before LDIST, not before all the -R options.
Hi Joaquim, is the gmtread command part of the documentation (I cannot find it there)?
Anyhow I tried your suggested input which unfortunately produced error message:
julia> D = gmtread(“lines.shp”);
julia> gmt(“grdmath -R-180/180/-89/89 -A10/0/4 -I30m ? LDIST = dist.nc”, D)
Error happens in Julia.
grd_init: input (Array{GMT.GMTdataset,1}) is not a GRID container type
Stacktrace:
[1] grid_init(::Ptr{Nothing}, ::Bool, ::Array{GMT.GMTdataset,1}, ::UInt32) at /home/fg/.julia/packages/GMT/IialV/src/gmt_main.jl:847
[2] GMTJL_Set_Object(::Ptr{Nothing}, ::GMT.GMT_RESOURCE, ::Array{GMT.GMTdataset,1}) at /home/fg/.julia/packages/GMT/IialV/src/gmt_main.jl:770
[3] gmt(::String, ::Array{GMT.GMTdataset,1}) at /home/fg/.julia/packages/GMT/IialV/src/gmt_main.jl:231
[4] top-level scope at none:0
[5] eval(::Module, ::Any) at ./boot.jl:328
[6] eval_string(::String) at /home/fg/R/x86_64-pc-linux-gnu-library/3.6/JuliaCall/julia/setup.jl:195
[7] docall(::Ptr{Nothing}) at /home/fg/R/x86_64-pc-linux-gnu-library/3.6/JuliaCall/julia/setup.jl:168
No, gmtread is a julia goody (and Matlab MEX too), Not in command line GMT. It happens that the version in Julia knows how to read shapefiles directly.
But the error you got is, sorry forgot about that, normal. In 6.0.0 grdmath can only read grids from externals (like the Julia wrapper). That is already fixed but needs the GMT dev version.