Help exporting a geotiff with a transparent background
I am working on a project where I want to export two geotiffs, the first is basically a georeferenced screenshot of data in a geoaxes with the satellite base map. I have this one working fine. The second one that I want to export is just the data, I have three datasets im trying to export, lat/long points, depth data (im currently plotting this with geoscatter) and contour lines. No matter what I try all im exporting is a black square and no data. Below is my code at just exporting the data with a transparent background.
I thought no background would be easier but I guess not, im having a tough time with it. Also, just an FYI, this is a small part of a very large project im working on so all of the variable names are brought in through other functions.
res = 0.00005;
lat_v = min(lat):res:max(lat);
long_v = min(long):res:max(long);
[long_grid,lat_grid] = meshgrid(long_v,lat_v);
depth_grid = griddata(long,lat,depth,long_grid,lat_grid,’natural’);
% C = contourc(lonv,latv,depth_grid,5);
R = georefcells([min(lat_v) max(lat_v)], [min(long_v) max(long_v)], size(depth_grid));
R.ColumnsStartFrom = ‘north’;
geotiffwrite(output_file, depth_grid, R);I am working on a project where I want to export two geotiffs, the first is basically a georeferenced screenshot of data in a geoaxes with the satellite base map. I have this one working fine. The second one that I want to export is just the data, I have three datasets im trying to export, lat/long points, depth data (im currently plotting this with geoscatter) and contour lines. No matter what I try all im exporting is a black square and no data. Below is my code at just exporting the data with a transparent background.
I thought no background would be easier but I guess not, im having a tough time with it. Also, just an FYI, this is a small part of a very large project im working on so all of the variable names are brought in through other functions.
res = 0.00005;
lat_v = min(lat):res:max(lat);
long_v = min(long):res:max(long);
[long_grid,lat_grid] = meshgrid(long_v,lat_v);
depth_grid = griddata(long,lat,depth,long_grid,lat_grid,’natural’);
% C = contourc(lonv,latv,depth_grid,5);
R = georefcells([min(lat_v) max(lat_v)], [min(long_v) max(long_v)], size(depth_grid));
R.ColumnsStartFrom = ‘north’;
geotiffwrite(output_file, depth_grid, R); I am working on a project where I want to export two geotiffs, the first is basically a georeferenced screenshot of data in a geoaxes with the satellite base map. I have this one working fine. The second one that I want to export is just the data, I have three datasets im trying to export, lat/long points, depth data (im currently plotting this with geoscatter) and contour lines. No matter what I try all im exporting is a black square and no data. Below is my code at just exporting the data with a transparent background.
I thought no background would be easier but I guess not, im having a tough time with it. Also, just an FYI, this is a small part of a very large project im working on so all of the variable names are brought in through other functions.
res = 0.00005;
lat_v = min(lat):res:max(lat);
long_v = min(long):res:max(long);
[long_grid,lat_grid] = meshgrid(long_v,lat_v);
depth_grid = griddata(long,lat,depth,long_grid,lat_grid,’natural’);
% C = contourc(lonv,latv,depth_grid,5);
R = georefcells([min(lat_v) max(lat_v)], [min(long_v) max(long_v)], size(depth_grid));
R.ColumnsStartFrom = ‘north’;
geotiffwrite(output_file, depth_grid, R); geotiff MATLAB Answers — New Questions









