Effacer les filtres
Effacer les filtres

How to specify nrows and ncols instead of latscale and lonscale in georesize?

1 vue (au cours des 30 derniers jours)
Farshina Nazrul Shimim
Farshina Nazrul Shimim le 13 Juil 2022
Modifié(e) : dpb le 15 Juil 2022
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 commentaires
Farshina Nazrul Shimim
Farshina Nazrul Shimim le 14 Juil 2022
Thanks for your response. I beleive size(RA, 1) is the same as RA.Rastersize(1). I've been doing that.
Thanks for your response. I added double(Latscale), double(Lonscale) it's not chaning anything unfortunately.
dpb
dpb le 14 Juil 2022
Modifié(e) : dpb le 15 Juil 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...

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Read, Write, and Modify Image dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by