TransWikia.com

Write referenced GeoTiff with 4 corners on matlab

Geographic Information Systems Asked by user85934 on September 27, 2020

I have some matlab raster matrix to export to geotif.
I also have the location of each corner in Decimal degrees (WGS84).
I know how to export and write the data into a geotiff but i’m having a problem to use the 4 corners for geolocation.
The raster is a strip map and it’s not oriented to the north (it’s slanted).

I can georefrence it afterwards on arcmap but i’m trying to avoid it and add it to the matlab script.

One Answer

You can use it code but your image should be parallel with meridian.

filename is your image. You should have longitude and latitude of upper left & lower right.

DX = (lonmax-lonmin)/(length(filename(1,:)));
DY = (latmin-latmax)/(length ...(filename(:,1)));
% % lonmin, latmax both of them are center of pixel(1,1)
Reference = makerefmat(lonmin+(0.5*DX), latmax-(0.5*DY), DX, DY);
%% reference name with filename Both should have a name 
fn=[reference name, '.tfw' ];
worldfilewrite(Reference ,fn);

Answered by user125460 on September 27, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP