How to specify nrows and ncols instead of latscale and lonscale in georesize?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to rescale geotiffs using georesize. I have a required size [1527,3164] and I am extracting the latscale and lonscale based on these numbers. However, the following line in the georesize function is returning slightly different values (i.e., 1526, 3163 etc)
[RB, xSample, ySample] = scaleSizeAndDensity(RA, double(latscale), double(lonscale));
For example, the parameters A = 1493x3093 single, latscale = 1.0228, lonscale = 1.0230 should result in the required size, but the execution of the scaleSizeAndDensity is causing xSample = 3163, ySample = 1527. While the change is minor, it is causing dimension mismatch. I believe zero padding B will create a mismatch with it's corresponding RB. What can I do in this regard? Is there a way to specify this required size when I call georesize instead of latscale and lonscale while can create error because of the smaller decimal numbers?
Thanks.
4 Kommentare
dpb
am 14 Jul. 2022
Bearbeitet: dpb
am 15 Jul. 2022
SHOW US THE EXACT CODE IN ITS ENTIRETY OF THE PERTINENT PART INSTEAD OF DESCRIBING IT.
Where you added double may or may not have any effect; you do not need an explicit double() statement at all; you'll probably be better off without. My comment above was only meant to ensure you hadn't created the variables as single() but were using (default) double precision in the calculations.
What we haven't seen is whether you actually computed the scaling factors or are still messing around trying to use constants as in your original...
Antworten (0)
Siehe auch
Kategorien
Mehr zu Import, Export, and Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!