{"id":15770583,"url":"https://github.com/benelan/medalus","last_synced_at":"2026-05-09T14:36:22.300Z","repository":{"id":55522988,"uuid":"233094684","full_name":"benelan/medalus","owner":"benelan","description":"Hack The Map 4 project","archived":false,"fork":false,"pushed_at":"2020-12-24T00:09:31.000Z","size":65371,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T19:49:01.603Z","etag":null,"topics":["arcgis","esri","gis","hackathon","mobx","nodejs","react","webapp"],"latest_commit_sha":null,"homepage":"https://www.esri.com/arcgis-blog/products/product/announcements/hack-the-map-4-hackathon-results/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benelan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-10T17:12:40.000Z","updated_at":"2024-07-09T09:49:24.000Z","dependencies_parsed_at":"2022-08-15T02:20:44.251Z","dependency_job_id":null,"html_url":"https://github.com/benelan/medalus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benelan%2Fmedalus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benelan%2Fmedalus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benelan%2Fmedalus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benelan%2Fmedalus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benelan","download_url":"https://codeload.github.com/benelan/medalus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246465220,"owners_count":20781919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arcgis","esri","gis","hackathon","mobx","nodejs","react","webapp"],"created_at":"2024-10-04T14:43:10.746Z","updated_at":"2026-05-09T14:36:21.923Z","avatar_url":"https://github.com/benelan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Medalus\nHack The Map 4 project by Ben Elan, Biraja Nayak, Kavish Ghime, Jose Banuelos, and Tarun Jaiswal.\nWe proactively prepare communities to identify environmentally sensitive areas and prime them for success using The Science of Where.\n\n## Desertification\nDesertification refers to land degradation caused by climate change and human activity in arid, semi-arid, and dry sub-humid areas. The aim of this application is to map desertification-sensitive areas.  A total of 11 indices that affect desertification processes were identified and analyzed using a geographic information system. The Mediterranean desertification and land use approach (MEDALUS), which has been widely used in the Mediterranean regions due to its simplicity, flexibility and rapid implementation strategy, was applied. \n\nThe Mediterranean desertification and land use (MEDALUS) approach identifies environmentally sensitive areas (ESAs) through the Environmentally Sensitive Area Index (ESAI). The ESAI is implemented by considering several variables, i.e. physical (soil quality), environmental (vegetation quality), climatic (climate quality), and social (management quality) indicators. This index can be used to obtain an in-depth understanding of the parameters causing desertification threats at a certain locations. This approach is simple, robust, widely applicable, acceptable to new indicators and parameters and can be adjusted to several scale levels. \n\n## Getting Started\nTo run the web app you must have [Node](https://nodejs.org/en/) installed. With Node installed, navigate to the client folder of the app and type:\n\n```\nnpm install\nnpm run build\n```\n\nThen, navigate to the server folder and type:\n\n```\nnpm install\nnpm run prod\n```\n\nThe built client application will be served along with the server. If you are not on the Esri internal network, you will need to add the [ArcPy](https://pro.arcgis.com/en/pro-app/arcpy/main/arcgis-pro-arcpy-reference.htm) python path in your Environment Variables. Then make sure the urls in the [map](https://github.com/benelan/medalus/blob/master/client/src/components/EsriMap.js) and [form](https://github.com/benelan/medalus/blob/master/client/src/components/UserInputForm.js) are pointed to the server on your machine instead of mine.\n\n## Data\nThese are the instructions for if you want to use your own data.\n\n### Data Input\nWe followed the below model to collect required data to determine environmentally sensitive areas. \nWe have considered California as our study area and collected raster sample data accordingly. \n\n![Medalus Method](https://github.com/benelan/medalus/blob/master/client/public/MEDALUS.jpeg)\n\nData for soil Depth, Albedo, Texture, drainage and Slope are collected from the webmap https://ess.maps.arcgis.com/home/webmap/viewer.html?webmap=27135181707846b5b405ee615d5a66d1 \n\nData for climate and precipitation for year 2010 to 2018 collected as Ascii format from http://www.prism.oregonstate.edu/recent/  \n\nData for vegetation and land cover downloaded for California state from https://nrcs.app.box.com/v/gateway/folder/22222601427 \n\nFor Livestock and Grazing the data was downloaded from https://www.sciencebase.gov/catalog/item/5b69f7c3e4b006a11f776ce1 \n\nPopulation data was downloaded from https://www.worldpop.org/geodata/summary?id=6545 \n\n### Data Processing\n\nIn ArcGIS Pro, clip California data using “Clip Raster” geoprocessing tool using California State boundary polygon.  \n\nExample of python command for raster clip is as follows: \n\n`arcpy.management.Clip(\"usa_ppp_2020.tif\", \"-124.409721007 32.5341569920001 -114.131211994 42.0095189850001\", r\"E:\\hackathon_jan2020\\ForHackathnon.gdb\\ca_population_2020\", \"States\", \"-9.999900e+04\", \"ClippingGeometry\", \"NO_MAINTAIN_EXTENT\") `\n\nAgain, using ArcGIS Pro, reclassify individual data to the predetermine classes as per the California area using geoprocessing tool “Reclassify”. Please change the classification parameter and file geodatabase name as per your data and then follow the below steps: \n\nClassification reference tables is [here](https://github.com/benelan/medalus/blob/master/client/public/Desertfication_Index_tables.xlsx).  Most of the classification ranges are derived from classification method called “Quantile” from ArcGIS pro symbology. All layers from Climate, Livestock and slope, Texture, Depth from Soil are classified using Quantile methods. \n\n**Data Classification**\nSoil data reclassification using the below python command: \n\nSoil Albedo \n\n`arcpy.ddd.Reclassify(\"casoilalbedo\", \"VALUE\", \"0 20 1;20 25 2;25 64 3\", r\"E:\\hackathon_jan2020\\Final\\Soil.gdb\\Albedo\", \"NODATA\")` \n\nSoil Depth \n\n`arcpy.ddd.Reclassify(\"casoildepth\", \"VALUE\", \"0 26 4;26 46 3;46 81 2;81 300 1\", r\"E:\\hackathon_jan2020\\Final\\Soil.gdb\\Depth\", \"NODATA\")` \n\nSoil Slope \n\n`arcpy.ddd.Reclassify(\"CASlope\", \"VALUE\", \"0 6 1;6 18 2;18 35 3;35 90 4\", r\"E:\\hackathon_jan2020\\Final\\Soil.gdb\\Slope\", \"NODATA\")` \n \nSoil Drainage \n\n`arcpy.ddd.Reclassify(\"USASoilsDrainageClass_Clip\", \"Value\", \"0 1 2;2 3 1;4 6 3\", r\"E:\\hackathon_jan2020\\Final\\Soil.gdb\\Drainage\", \"NODATA\")`\n\nSoil Texture \n\n`arcpy.ddd.Reclassify(\"soiltextureCA\", \"T_USDA_TEX_CLASS\", \"loam 1;'sandy clay loam' 1;'clay (light)' 3;'sandy loam' 1\", r\"E:\\hackathon_jan2020\\Final\\Soil.gdb\\Texture\", \"NODATA\")` \n\n\n\nVegetation data reclassification using the below python command: \n\nPlant Cover \n\n`arcpy.ddd.Reclassify(\"nlcd_ca_utm11.tif\", \"Value\", \"11 3;12 3;21 1;22 2;23 3;24 3;31 3;41 1;42 1;43 1;52 2;71 1;81 2;82 2;90 2;95 1\", r\"E:\\hackathon_jan2020\\Final\\Vegetation.gdb\\plantCover\", \"NODATA\")` \n\nDrought Resistance \n\n`arcpy.ddd.Reclassify(\"nlcd_ca_utm11.tif\", \"Value\", \"11 3;12 3;21 2;22 2;23 3;24 3;31 3;41 2;42 1;43 2;52 2;71 2;81 2;82 1;90 3;95 3\", r\"E:\\hackathon_jan2020\\Final\\Vegetation.gdb\\droughtResistance\", \"NODATA\")` \n\nErosion Protection \n\n`arcpy.ddd.Reclassify(\"nlcd_ca_utm11.tif\", \"Value\", \"11 1;12 1;21 2;22 2;23 2;24 2;31 3;41 1;42 1;43 1;52 2;71 2;81 2;82 1;90 1;95 1\", r\"E:\\hackathon_jan2020\\Final\\Vegetation.gdb\\erosionProtection\", \"NODATA\")` \n\n \n \nClimate data reclassification using the below python command: \n\nPrecipitation \n\n`arcpy.ddd.Reclassify(\"p_cali_2014\", \"Value\", \"0 7.690000 3;7.690000 21.800000 2;21.800000 164.140000 1\", r\"E:\\hackathon_jan2020\\Final\\climate.gdb\\Precipitation2018\", \"NODATA\")` \n\n\n\nLivestock data reclassification using the below python command: \n\nGrazing \n\n`arcpy.ddd.Reclassify(\"gra_dist_Clip_1\", \"VALUE\", \"0.002820 0.602510 1;0.602510 1.202200 2;1.202200 1.801890 3\", r\"E:\\hackathon_jan2020\\Final\\Livestock.gdb\\grazingPressure\", \"NODATA\")` \n\nPopulation \n\n`arcpy.ddd.Reclassify(\"ca_population_2020\", \"VALUE\", \"0 1;0 14.828471 2;14.828471 1890.630005 3\", r\"E:\\hackathon_jan2020\\Final\\Livestock.gdb\\populationDensity\", \"NODATA\")` \n\n**Weighted Overlay**\n\nAfter reclassification, create indexes for all 4 classes as SQI, VQI, CQI and MQI using the “Weighted Overlay” geoprocessing tool. SQI will have all reclassified soil data as input and similarly for the other indexes and respective layers. The sample python command is: \n\n`out_raster = arcpy.sa.WeightedOverlay(r\"('E:\\hackathon_jan2020\\Final\\Soil.gdb\\Albedo' 20 'Value' (1 1; 2 2; 3 3; NODATA NODATA); 'E:\\hackathon_jan2020\\Final\\Soil.gdb\\Depth' 20 'Value' (1 1; 2 2; 3 3; 4 4; NODATA NODATA); 'E:\\hackathon_jan2020\\Final\\Soil.gdb\\Drainage' 20 'Value' (1 1; 2 2; 3 3; NODATA NODATA); 'E:\\hackathon_jan2020\\Final\\Soil.gdb\\Slope' 20 'Value' (1 1; 2 2; 3 3; 4 4; NODATA NODATA); 'E:\\hackathon_jan2020\\Final\\Soil.gdb\\Texture' 20 'Value' (1 1; 3 3; NODATA NODATA));1 5 1\"); out_raster.save(r\"E:\\hackathon_jan2020\\Final\\Soil.gdb\\SQI\")` \n\nOutput raster for all 4 indexes with legends for your reference:\n![SQI](https://github.com/benelan/medalus/blob/master/client/public/SQI.PNG)\n![CQI](https://github.com/benelan/medalus/blob/master/client/public/CQI.PNG)\n![MQI](https://github.com/benelan/medalus/blob/master/client/public/MQI.PNG)\n![VQI](https://github.com/benelan/medalus/blob/master/client/public/VQI.PNG)\n\nThen create Environmentally Sensitive Area Index (ESAI) from those 4 indexes created in steps 3 as input using “Weighted Overlay” geoprocessing tool. We created ESAI for 9 years of precipitation data. This data is published to an image service to be rendered by the JavaScript API. The sample python command is: \n\n`out_raster = arcpy.sa.WeightedOverlay(r\"('E:\\hackathon_jan2020\\Final\\climate.gdb\\CQI2018' 25 'Value' (1 1; 2 2; 3 3; NODATA NODATA); 'E:\\hackathon_jan2020\\Final\\Livestock.gdb\\MQI' 25 'Value' (1 1; 2 2; 3 3; NODATA NODATA); 'E:\\hackathon_jan2020\\Final\\Soil.gdb\\SQI' 25 'Value' (1 1; 2 2; 3 3; NODATA NODATA); 'E:\\hackathon_jan2020\\Final\\Vegetation.gdb\\VQI' 25 'Value' (2 2; 3 3; NODATA NODATA));1 3 1\"); out_raster.save(r\"E:\\hackathon_jan2020\\Final\\Desertification.gdb\\Desertificate2018\")`\n\nOutput raster ESAI with legends for your reference:\n\n![ESAI](https://github.com/benelan/medalus/blob/master/client/public/Desertificate2018.PNG)\n\n**Use In the Application**\n\nOnce the ESAI data is ready, copy the gdb to the [server/models](https://github.com/benelan/medalus/tree/master/server/models) directory. Change the arcpy script in [server/models/python/clip.py](https://github.com/benelan/medalus/blob/master/server/models/python/clip.py) to paths specific to your machine. Then, follow the instructions in Getting Started to get the app up and running. Once the app is running, you can choose a county, ie \"Yuba\" or \"San Diego\" and the node server will call the arcpy to do following steps: \n\n- It will clip final classified raster data as per county selected. \n- Then it will create polygon feature class \n- GeoJSONs are created from that polygon feature class for all the years available in the gdb\n- Finally, the GeoJSONs are merged and used as an input for the Time Slider widget to observe data changes during year 2010 to 2018 as per our sample input data for this application. \n\n \n ## Reference\n We followed published articles on MEDALUS as per below:\n \nhttps://www.ncbi.nlm.nih.gov/pmc/articles/PMC6069148/\nhttps://www.researchgate.net/publication/285161552_An_approach_to_desertification_mapping_using_MEDALUS_methodology_in_Iran\nhttps://www.tandfonline.com/doi/full/10.1080/21580103.2019.1667880\n\n## Built With\n* [ArcGIS Desktop](https://www.esri.com/en-us/arcgis/products/arcgis-pro/resources) - Data Processing\n* [ArcGIS JavaScript API](https://developers.arcgis.com/javascript/) - Data Visualization\n* [esi-loader](https://github.com/Esri/esri-loader) - Esri Module Loader\n* [Node](https://nodejs.org/en/) - Backend\n* [Express](https://expressjs.com/) - Backend Framework\n* [React](https://reactjs.org/) - Frontend Framework\n* [Reactstrap](https://reactstrap.github.io/) - Bootstrap for React\n* [MobX](https://mobx.js.org/) - State Managment\n* [Mobx React](https://github.com/mobxjs/mobx-react) - MobX for React\n* [Formik](https://github.com/jaredpalmer/formik) - Forms for React\n* [react-scroll](https://github.com/fisshy/react-scroll) - Scroll Animation\n* [react-lazy-hero](https://github.com/danistefanovic/react-lazy-hero) - Fancy Picture\n* [axios](https://github.com/axios/axios) - REST Requests\n* [@mapbox/geojson-merge](https://github.com/mapbox/geojson-merge) - Merge GeoJSONs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenelan%2Fmedalus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenelan%2Fmedalus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenelan%2Fmedalus/lists"}