Created
October 20, 2025 08:19
-
-
Save ultramenid/a8a5a47664d9f338d9cca7e47faa18fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.get("/gee/lulc", async (req, res) => { | |
| try { | |
| const { kab, kec, des, year = 1992 } = req.query; | |
| const yearInt = parseInt(year, 10); | |
| let geometry = ee.FeatureCollection("projects/ee-dataaurigagee/assets/LTKL/desa"); | |
| if (kab) geometry = geometry.filter(ee.Filter.eq("kab", kab)); | |
| if (kec) geometry = geometry.filter(ee.Filter.eq("kec", kec)); | |
| if (des) geometry = geometry.filter(ee.Filter.eq("des", des)); | |
| const MBI4_1 = `projects/ee-dataaurigagee/assets/LTKL/LTKLcollection2/LTKL_mbi41_${yearInt}`; | |
| const LULCyear = ee.Image(MBI4_1).clip(geometry); | |
| const mapInfo = await LULCyear.getMap(); | |
| res.send(mapInfo.urlFormat); | |
| } catch (err) { | |
| console.error("Error creating map:", err); | |
| res.status(500).send("Error generating map"); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment