TransWikia.com

Transforming featureCollection back to an actual image

Geographic Information Systems Asked by Sahar Attia on December 2, 2020

I am about to finish my calculations made on the feature that I have extracted from NDVI images.
Each image was originally transformed into a list (by the scale of 10) and extracted to a CSV file.

One image looks something like this:
[0.14152496, 0.13910334, 0.13444474, 0.14031242, 0.13647091, 0.13647091, 0.13579224, 0.12632568, 0.13205566, 0.14164905, 0.13488871, 0.13643098, 0.13643098, 0.1415145, 0.13307984, 0.13031234, 0.14118412, 0.15407528, 0.1594203, 0.1594203, 0.14909577, 0.14033394, 0.13556832, 0.12795, 0.13436693, 0.12692703, 0.13382563, 0.13885899, 0.13885899, 0.13703406, 0.13468853, 0.13565081, 0.13529333, 0.13282196, 0.13282196, 0.13273865, 0.12939318, 0.1307541, 0.1444648, 0.15493727, 0.15641767, 0.15641767, 0.15309007, 0.15072227, 0.1434024, 0.13799424, 0.12916559, 0.13475554, 0.13494448, 0.14056225, 0.14056225, 0.14080083, 0.1318048, 0.12609819, 0.13105047, 0.13576333, 0.13308784, 0.13308784, 0.13757862, 0.1362188, 0.14307971, 0.15496999, 0.15917048, 0.16203703, 0.16203703, 0.15358268, 0.15175933, 0.14080618, 0.13715579, 0.13616557, 0.13646713, 0.14500134, 0.14500134, 0.14270371, 0.13847809, 0.13064714, 0.1380343, 0.14684549, 0.13934979, 0.13934979, 0.14086545, 0.13998929, 0.1338745, 0.14099896, 0.14149974, 0.13297084, 0.13297084, 0.13644388, 0.13782384, 0.14515434, 0.13311689, 0.14178273, 0.14437456, 0.14204867, 0.14204867, 0.13994698, 0.15337598, 0.14237192, 0.1374394, 0.14861605, 0.15121537, 0.15121537, 0.14549153, 0.14650373, 0.13948359, 0.13438736, 0.1362135, 0.13176961, 0.13176961, 0.13134399, 0.13733798, 0.14376467, 0.14392266, 0.13025999, 0.13844457, 0.14961068, 0.14740813, 0.14740813, 0.14802772, 0.15437004, 0.14538664, 0.13700525, 0.14113016, 0.14820062, 0.14820062, 0.14587332, 0.14534962, 0.14541328, 0.14437933, 0.14600699, 0.14143139, 0.14143139, 0.13640973, 0.14162028, 0.13876116, 0.13919213, 0.13987248, 0.13914964, 0.14277707, 0.1388017, 0.1388017, 0.13944551, 0.14395605, 0.13904035, 0.13925104, 0.14458162, 0.14522259, 0.14522259, 0.14675395, 0.14799672, 0.1504989, 0.14947952, 0.15170792, 0.14130877, 0.14130877, 0.14555717, 0.14224464, 0.1383707, 0.1336754, 0.13943355, 0.14094874, 0.14629757, 0.140698, 0.140698, 0.13389294, 0.13932885, 0.13017598, 0.13032123, 0.13673279, 0.14785887, 0.14785887, 0.15454918, 0.1577787, 0.1618938, 0.1567984, 0.1462071, 0.1489482, 0.1489482, 0.15216245, 0.14713933, 0.14019428, 0.140111, 0.13601947, 0.13418746, 0.14426364, 0.13718607, 0.13718607, 0.13317192, 0.13821138, 0.14281926, 0.1411924, 0.15752403, 0.14541996, 0.14541996, 0.15383582, 0.15434256, 0.1642532, 0.1560011, 0.1457843, 0.1531175, 0.1531175, 0.14247635, 0.13924716, 0.14389327, 0.14596315, 0.14402102, 0.14914754, 0.1360255, 0.13451976, 0.1295084, 0.1295084, 0.1344877, 0.12736444, 0.13778119, 0.13857481, 0.13882664, 0.13508013, 0.13508013, 0.13941053, 0.13786457, 0.14355107, 0.13731785, 0.13156913, 0.13716984, 0.13716984, 0.13607305, 0.13764158, 0.14356114, 0.13905556, 0.13573116, 0.13573116, 0.13851395, 0.13540052, 0.13438684, 0.14228134, 0.13537118, 0.13629402, 0.13629402, 0.13685551, 0.13609774, 0.12976904, 0.13654225, 0.13194016, 0.13874745, 0.13874745, 0.136619, 0.14443101]

Now I wish to transform the list back to an image.
Is there a way to do that?

2 Answers

You can do it by using ee.Image() or ee.ImageCollectionfunctions for either a single image or list to imagecollection.

Hope this answers your question.

Answered by AdoMath on December 2, 2020

As I mentioned before, if you use ee.ImageCollection on your list, you will automatically convert the list into an imagecollection. Here is an example:

var yourList = [0.14152496, 0.13910334, 0.13444474, 0.14031242, 0.13647091, 0.13647091, 0.13579224, 0.12632568, 0.13205566, 0.14164905, 0.13488871, 0.13643098, 0.13643098, 0.1415145, 0.13307984, 0.13031234, 0.14118412, 0.15407528, 0.1594203, 0.1594203, 0.14909577, 0.14033394, 0.13556832, 0.12795, 0.13436693, 0.12692703, 0.13382563, 0.13885899, 0.13885899, 0.13703406, 0.13468853, 0.13565081, 0.13529333, 0.13282196, 0.13282196, 0.13273865, 0.12939318, 0.1307541, 0.1444648, 0.15493727, 0.15641767, 0.15641767, 0.15309007, 0.15072227, 0.1434024, 0.13799424, 0.12916559, 0.13475554, 0.13494448, 0.14056225, 0.14056225, 0.14080083, 0.1318048, 0.12609819, 0.13105047, 0.13576333, 0.13308784, 0.13308784, 0.13757862, 0.1362188, 0.14307971, 0.15496999, 0.15917048, 0.16203703, 0.16203703, 0.15358268, 0.15175933, 0.14080618, 0.13715579, 0.13616557, 0.13646713, 0.14500134, 0.14500134, 0.14270371, 0.13847809, 0.13064714, 0.1380343, 0.14684549, 0.13934979, 0.13934979, 0.14086545, 0.13998929, 0.1338745, 0.14099896, 0.14149974, 0.13297084, 0.13297084, 0.13644388, 0.13782384, 0.14515434, 0.13311689, 0.14178273, 0.14437456, 0.14204867, 0.14204867, 0.13994698, 0.15337598, 0.14237192, 0.1374394, 0.14861605, 0.15121537, 0.15121537, 0.14549153, 0.14650373, 0.13948359, 0.13438736, 0.1362135, 0.13176961, 0.13176961, 0.13134399, 0.13733798, 0.14376467, 0.14392266, 0.13025999, 0.13844457, 0.14961068, 0.14740813, 0.14740813, 0.14802772, 0.15437004, 0.14538664, 0.13700525, 0.14113016, 0.14820062, 0.14820062, 0.14587332, 0.14534962, 0.14541328, 0.14437933, 0.14600699, 0.14143139, 0.14143139, 0.13640973, 0.14162028, 0.13876116, 0.13919213, 0.13987248, 0.13914964, 0.14277707, 0.1388017, 0.1388017, 0.13944551, 0.14395605, 0.13904035, 0.13925104, 0.14458162, 0.14522259, 0.14522259, 0.14675395, 0.14799672, 0.1504989, 0.14947952, 0.15170792, 0.14130877, 0.14130877, 0.14555717, 0.14224464, 0.1383707, 0.1336754, 0.13943355, 0.14094874, 0.14629757, 0.140698, 0.140698, 0.13389294, 0.13932885, 0.13017598, 0.13032123, 0.13673279, 0.14785887, 0.14785887, 0.15454918, 0.1577787, 0.1618938, 0.1567984, 0.1462071, 0.1489482, 0.1489482, 0.15216245, 0.14713933, 0.14019428, 0.140111, 0.13601947, 0.13418746, 0.14426364, 0.13718607, 0.13718607, 0.13317192, 0.13821138, 0.14281926, 0.1411924, 0.15752403, 0.14541996, 0.14541996, 0.15383582, 0.15434256, 0.1642532, 0.1560011, 0.1457843, 0.1531175, 0.1531175, 0.14247635, 0.13924716, 0.14389327, 0.14596315, 0.14402102, 0.14914754, 0.1360255, 0.13451976, 0.1295084, 0.1295084, 0.1344877, 0.12736444, 0.13778119, 0.13857481, 0.13882664, 0.13508013, 0.13508013, 0.13941053, 0.13786457, 0.14355107, 0.13731785, 0.13156913, 0.13716984, 0.13716984, 0.13607305, 0.13764158, 0.14356114, 0.13905556, 0.13573116, 0.13573116, 0.13851395, 0.13540052, 0.13438684, 0.14228134, 0.13537118, 0.13629402, 0.13629402, 0.13685551, 0.13609774, 0.12976904, 0.13654225, 0.13194016, 0.13874745, 0.13874745, 0.136619, 0.14443101];
print(yourList);
var yourimage = ee.ImageCollection(yourList);
print(yourimage);

Keep in mind that if you use ee.Image() instead, you will get a single image containing the elements from the list as independent bands.

Answered by AdoMath on December 2, 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