But the output image has no CRS and the Y coords seem to be pixel counts, not latitudes.
I have set GDAL_DATA to /usr/share/gdal/ which is where all the GDAL csv files seem to be located.
I’m getting the error:
ERROR 10: Pointer ‘hTransform’ is NULL in ‘OCTTransform’.
repeatedly, but I don’t know why. It seems to relate to a bad EPSG code…
The whole situation is confuse and clearly need improvements. For example this (Mollweide) works and stores the SRS, but it requires setting the map width when that is not needed.
And If I try with a proj4 string it errors. For map making we need to be able to convert from proj/WKT syntax in order to be able to create the frames, but with -A that is not the case so one should be able to pass the proj4 string or EPSG without doing a round trip to the GMT projection machinery.
Thanks Joaquim,
I can open the output image in QGIS fine, but it is not correctly geo-located. Opening the GSHHG world coastline shapefile at the same time gives two maps on the canvas, they seem to be correctly aligned vertically, so the longitudes are somewhat consistent, but the latitudes are way different. The raster image is a small block at the top of the screen, the vector at the bottom.
I was hoping to use GMT to create a set of images/tiles for a global context layer served via WMS on our research vessels, but if the output images are not correctly georeferenced, it is not viable.
Thanks for the suggestion, but it is not just the lack of a CRS, the Y coordinates are wrong as well, so just populating the CRS will not solve the problem.
Fresh install of GMT 6.4.4 on fresh Mint Linux setup on Ryzen based server- built from scratch today, then added UbuntuGIS unstable for the package installs via apt. GDAL is v3.8.4.
I had issues on my dated desktop so figured a completely new install from the OS up would be more robust…
I’m not sure why I keep getting the “ERROR 10: Pointer ‘hTransform’ is NULL…” message (or the first 1000 messages at least). Googling tells me it is a faulty EPSG code, but that does not seem to be the case.
Is this a possible clue to another issue on my setup?
Odd, this is what I get with the Julia wrapper (pure GMT execution, just under other clothes).
Some stray warnings that don’t affect the result. Coastlines are plotted right.
julia> I = grdimage("@earth_relief_10m_p", A=true, Vd=1, B=:none, J=4326)
Warning: the following options were not consumed in grdimage => [:this_cpt]
grdimage @earth_relief_10m_p -J4326 -n+a -A
┌ Warning: Only 'I' for Images.jl and 'BRP' MEM layouts are allowed.
└ @ GMT C:\Users\j\.julia\dev\GMT\src\gmt_main.jl:486
A GMTimage object with 3 bands of type UInt8
Pixel node registration used
x_min: -180.0 x_max :180.0 x_inc :0.16666666666666666 n_columns :2160
y_min: -90.0 y_max :90.0 y_inc :0.16666666666666666 n_rows :1080
z_min: NaN z_max :NaN
Mem layout: TRPa
julia> viz(I, coast=true)
GMT [WARNING]: gmtapi_change_imagelayout: reordering function for case TRPa -> BRP not yet written. Doing nothing.
Firstly, thanks heaps for your help. It really is appreciated!!!
Will try what you suggest - however - I just built a Win10 VM on the Mint box. Installed Miniconda, GMT & GDAL.
Then generated a world.tiff exactly as on Mint Linux (without the GMT prefix). Copied it to the Mint system & opened in QGIS - it overlays perfectly with GSHHG coastline.
So something is screwy with the Mint/UbuntuGIS setup… not really a GMT issue if it works perfectly on Windows.
Windows is not my preferred platform, but it seems to work. At least I can now do something useful!!!
I’m not sure if installing Miniconda on Linux, then gdal in Miniconda & running GMT from the Miniconda shell instead of a bash shell would generate correct geotiffs…