How can I write a GeoTiff file with corresponding coordinates?
Mostrar comentarios más antiguos
I have the following:
- a latitude array 'lat' (1x1128 single)
- a longitude array 'lon' (1x968)
- a value matrix 'value' (1128x968 double)
How can I write this into a GeoTiff file so that values have the corresponding coordinates of lat and lon, i.e. a lat,lon,value grid?
Thanks
Respuesta aceptada
Más respuestas (1)
Sai Sri Pathuri
el 6 de Ag. de 2019
You may use geotiffwrite function to write the data into GeoTIFF file. To have a grid of latitude, longitude and value data, first combine the matrices into a single matrix with first element as 0, latitudes in first row, longitudes in first column, remaining rows and columns are occupied by value matrix.
grid_matrix=[0,lat];
grid_matrix(2:969,:)=[lon',value']; %Take transpose of lon and value matrices
Then write into GeoTIFF file using geotiffwrite function
R=georasterref();
R.RasterSize=size(grid_matrix);
geotiffwrite('grid.tif',grid_matrix,R);
Refer the following links for documentation
Categorías
Más información sobre Data Import and Export en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!