High Precision Extraction of Surface Water from Complex Terrain in Bosten Lake Basin Based on Water Index and Slope Mask Data

: The surface water extraction algorithm based on satellite remote sensing images is advanta-geous as it is able to obtain surface water information in a relatively short time. However, when it is used to extract information on surface water in large-scale, long-time series and complex terrain areas, there will be a large number of misclassiﬁed pixels, and a large amount of image preprocessing work is required. The accuracy veriﬁcation is time-consuming and laborious, and the results may not be accurate. The complex climatic and topographic conditions in Bosten Lake Basin make it more difﬁcult to monitor and control surface water bodies. Therefore, based on the GEE (Google Earth Engine) cloud platform, and the studies of the effect of nine kinds of water indexes on the surface water extraction in Bosten Lake Basin, this paper adds a slope mask to remove misclassiﬁed pixels and ﬁnds the best extraction method of surface water extraction in the basin by means of accuracy veriﬁcation and visual discrimination through continuous iteration of index threshold and slope mask threshold. The results show that when the threshold value is − 0.25 and the slope mask is 8 degrees, the index WI2019 has the best effect on the surface water information extraction of Bosten Lake Basin, effectively eliminating the interference of shadow and snow. The effect of water extraction in the long-time series is discussed and it was found that the precision of water extraction in the long-time series is also better than other indexes. The effects of various indexes on surface water extraction under complex terrain are compared. It can quickly and accurately realize the long-time series of surface water extraction under large-area complex terrain and provides useful guiding signiﬁcance for water resources management and allocation as well as a water resources ecological assessment of Bosten Lake Basin.


Introduction
There is no life without water. Water plays a vital role in the survival of human beings and other creatures as well as the rise of civilization and development of human society. Surface water generally includes rivers, lakes, glaciers, and swamps. It is the main component of freshwater resources on earth, which is irreplaceable in maintaining the ecological balance of river basins as well as meeting human demands, including power, water supply, irrigation, industrial needs and others. Interestingly, changes in surface water area can reflect and characterize the impact of climate change and human activities on surface water. Quickly and accurately extracting surface water information and grasping the spatial distribution of surface water have important practical significance for flood and drought disaster research, water resources monitoring research, water resources management research, etc. [1,2]. The surface water in arid and semi-arid environments is threatened by both natural and anthropogenic pressures. Mapping the distribution of surface water bodies is essential for managing and addressing degradation of both water quantity and quality [3]. Before the application of remote sensing technology in mapping water resources, most of the water was extracted based on manual measurement. This manual method has low precision, a massive heavy workload, a large cost and poor macro and continuous and real-time monitoring effect, all of which are impediments in meeting the requirements spatially and temporally. On the other hand, remote sensing technology has the advantages of macro scale data collection, dynamic monitoring and low cost. The use of remote sensing images to extract water information can accurately grasp the spatial distribution status and changing trend of water bodies in basins, and provide basic data for comprehensive management of basins, flood monitoring and water resources protection and conservation, all of which are of great importance [4][5][6].
At present, there are many algorithms for extracting water information from remote sensing images. In general, these methods can be roughly divided into several categories: single band method [7,8], spectral relationship method [4,9], image classification method [10] and water index method. Among them, the water index method is a popular index widely used by researchers. The most influential water index algorithms mainly include Normalized difference water index (NDWI), which weakens the influence of nonwatery factors such as vegetation and soil. It is generally effective in extracting water from large lakes and reservoirs, but it still contains a lot of interference information in urban water extraction [11]. The modified normalized difference water index (MNDWI) is proposed on the basis of NDWI method, using Landsat TM short wave infrared (TM5) instead of near-infrared (TM4). MNDWI can weaken the impact of soil and buildings, but has a good effect on the removal of building shadows in urban areas [12]. The water index WI2006 uses the natural pairs of each band of landsat7 ETM+ images to reflect the reflection coefficient and interaction conditions and is used to extract wetlands covering eastern Australia [13]. The enhanced water index (EWI) is constructed by using the green light band (TM2), a near-infrared band (TM4) and mid-infrared band (TM5) of TM images, and this method is used to extract the water system information of semi-arid areas. This index allows the researcher to ignore the influence of atmospheric factors [14].
By analyzing the creation process of enhanced water index EWI, it is verified that the surface water can be extracted well whether the remote sensing image has been atmospherically corrected or not [15]. The modified normalized difference water index RNDWI (revised normalized difference water index) is constructed on the basis of analyzing the spectral characteristics of three ground feature types, viz. water, vegetation and soil. It can eliminate the influence of mountain shadows and accurately extract the water and land boundaries of Miyun Reservoir by using this index [16]. The new water index NWI (new water index) is proposed in combination with the strong absorption of water in the nearinfrared and mid-infrared bands. NWI can partially eliminate the impact of solar altitude angle, terrain, shadow and atmospheric conditions, and its accuracy is very high [17]. The new water index NEW is a band ratio algorithm constructed by using the blue-green band (TM1) and mid-infrared band (TM7) of tm/etm+ images. This index can not only extract natural water but also eliminate the impact of terrain differences, thus solving the problem of shadow in water information [18].
In recent years, more new water indexes have been created with good verification results. For example, the automatic water extraction index AWEI is proposed based on TM image data. The main goal of AWEI is to separate water and nonwater pixels to the greatest extent by subtracting and adding between bands and assigning different coefficients to bands. It has been verified that AWEI has higher accuracy than MNDWI in extracting water information [19]. Another new index, Water index WI2015, is a water extraction algorithm based on linear discriminant analysis proposed on the basis of WI2006. The index uses linear discriminate anti-analysis classification (LDAC) to determine the coefficient of the best classification of the training area, which improves the classification accuracy [20]. The multi-band water index MBWI (multi-band water index) can weaken the impact of mountain shadows and dark pixels of buildings, and reduce the seasonal impact caused by changes in solar conditions [21]. Finally, the water index wi2019 (water index2019) is constructed on the basis of the analysis of the light break characteristics of water and snow, which improves the differentiation between water and snow in the classification process.
Among the numerous water remote sensing information extraction technologies, the one based on water remote sensing index is undoubtedly the most widely used. At present, the global and regional surface water distribution mapping is almost inseparable from the water remote sensing index. Some scholars carried out early high-resolution remote sensing mapping of global land surface water bodies [22], in which NDWI (normalized difference water index) and MNDWI (modified NDWI) water index were used as the main technologies. Taking MNDWI as a key algorithm, the global river distribution range and area can be calculated [23]. With the continuous construction and improvement of water index, many water indexes have been developed and often used to compare the effects of surface water extraction in the process of extracting surface water in different regions and are now widely used for surface water extraction in inland water bodies, wetlands, delta areas, coastal areas, dry, arid and semi-arid and other complex terrains [23][24][25][26][27][28][29]. These studies have achieved good water extraction results in the study area. Different water indexes have different advantages in surface water information extraction. The construction of new water indexes is based on the spectral information difference of typical ground object sample points in study area. They often achieve high extraction accuracy and differentiation effect within a study area. When selecting other study areas for verification, the extraction effect tends to decline, with the threshold value of extracted surface water also changing greatly [20,30,31]. When the threshold value is too small, it cannot effectively eliminate the misclassification of pixels, whereas too large a domain value will cause the loss of surface water information. In the specific application process, the automatic optimal threshold selection method often cannot achieve the best water extraction effect [32]. Therefore, it is necessary to optimize the water index and find the optimal threshold when using the water index to explore the change in water area in the study area [33].
Various water indexes have different effects when they are used to distinguish between water bodies and nonwater bodies. Shadows, ice, snow and clouds are the main misclassification types of water bodies. Through preliminary research, water indexes AWEI nsh and WI2019 can more effectively remove the effects of shadows and dark surfaces on surface water differentiation in the study area than other water indexes, but the effect on distinguishing ice, snow and water bodies is poor. Although WI2019 can effectively distinguish ice, snow and water bodies, the effect of distinguishing shadows is not good. Snow and ice in the region are mainly distributed in mountainous areas with high altitudes and large slopes. The shadow is also caused by the slope due to the land's topography. In places with a large slope, it is difficult to retain water bodies. Some scholars have tried to apply topographic factors to the process of surface water extraction and achieved good results [9,34]. Therefore, using slope data as a mask can effectively eliminate snow and shadow areas that are mistakenly classified as water pixels. Using the GEE cloud platform to call remote sensing images in the database can avoid a lot of image and processing work. Recently, many scholars have used the GEE platform to extract large-scale, long-time series surface water bodies and achieved good extraction results [35][36][37][38][39][40]. During the iteration of water index threshold and slope, the effect of the water extraction image and accuracy verification results can be observed synchronously to drive the final results. Theoretically, the GEE platform can be used to explore the optimal method of water extraction in any image area, and this greatly increases the work efficiency. Furthermore, it can realize the comparison of regional long-time water extraction effects under the GEE platform. The purpose of this paper is: (1) To realize the calculation and display of the water index under the GEE platform, and to explore the applicability of various water indexes under complex terrain; (2) By iterating the water index threshold and slope mask threshold, the most suitable water index method and the best threshold for water extraction in Bosten Lake Basin are determined; (3) To realize the water extraction in the long-time series within the watershed and discuss the stability of different indexes in the long-time series.

Study Area
In this paper, the boundaries of seven county and city level administrative divisions are merged as the research boundary of Bosten Lake Basin (Figure 1). Bosten Lake Basin, also known as the Kaidu River-Kongque River Basin, is located in the inland arid area of Xinjiang, China. Its geographical coordinates are 85 • 20 ~87 • 25 E, 41 • 10 ~43 • 30 N. Although Bosten Lake basin is mainly composed of Kaidu River Basin and Kongque River Basin, it also includes Yanqi Basin and its surrounding mountainous areas, and most areas to the north of the lower reaches of the Tarim River. Bosten Lake Basin is adjacent to Tianshan Mountains in the north and Tarim Basin in the south. The terrain is high in the northwest and low in the southeast. The geomorphic division belongs to the Tianshan Mountains region, including three small areas of Tianshan Mountains, Youledus basin and Yanqi Basin. The entire basin has a total area of 7.7 × 10 4 km 2 , accounting for 45.06% of the drainage area. The basin is not totally mountainous as the plain area is 4.26 × 10 4 km 2 , accounting for 55.32% of the drainage area. The landform in the area is complex as Bosten Lake Basin is surrounded by mountains on three sides. The overall terrain is high in the north and south, West and low in the East. The geomorphic units in the basin can be divided into intermountain basin landform, canyon landform and alluvial proluvial basin landform, of which the large and small Yudus basins belong to intermountain basin landform. The reach from the source of Kaidu River to the river canyon in the north of Yanqi basin is canyon landform, and the terrain height is obviously graded. The Kaidu River enters the Yanqi Basin from the east of Dashankou. The terrain is relatively flat and open, showing the geomorphic characteristics of an alluvial proluvial basin. The Yanqi basin is a local faulted basin formed between the main vein of the eastern Tianshan Mountains and its branches. Bosten Lake is in the southeast of the Yanqi Basin. There are a large number of relatively small wetland lakes in the southwest and northwest of Bosten Lake. Bayinbuluk grassland also contains many wetland water bodies, and a large number of snow mountains are distributed in the region, with the terrain fluctuating greatly. There are many seasonal rivers and lakes supplied by snow melt under the snow mountain terrain. As the longest river in the region, the Kaidu River flows through the main cities, mountains, deserts, wetlands, and other landforms in the region. These complex landforms jointly increase the difficulty of surface water monitoring and regulation in Bosten Lake Basin. under the GEE platform, and to explore the applicability of various water indexes under complex terrain; (2) By iterating the water index threshold and slope mask threshold, the most suitable water index method and the best threshold for water extraction in Bosten Lake Basin are determined; (3) To realize the water extraction in the long-time series within the watershed and discuss the stability of different indexes in the long-time series.

Study Area
In this paper, the boundaries of seven county and city level administrative divisions are merged as the research boundary of Bosten Lake Basin ( Figure 1). Bosten Lake Basin, also known as the Kaidu River-Kongque River Basin, is located in the inland arid area of Xinjiang, China. Its geographical coordinates are 85°20'~87°25' E, 41°10'~43°30' N. Although Bosten Lake basin is mainly composed of Kaidu River Basin and Kongque River Basin, it also includes Yanqi Basin and its surrounding mountainous areas, and most areas to the north of the lower reaches of the Tarim River. Bosten Lake Basin is adjacent to Tianshan Mountains in the north and Tarim Basin in the south. The terrain is high in the northwest and low in the southeast. The geomorphic division belongs to the Tianshan Mountains region, including three small areas of Tianshan Mountains, Youledus basin and Yanqi Basin. The entire basin has a total area of 7.7 × 10 4 km 2 , accounting for 45.06% of the drainage area. The basin is not totally mountainous as the plain area is 4.26 × 10 4 km 2 , accounting for 55.32% of the drainage area. The landform in the area is complex as Bosten Lake Basin is surrounded by mountains on three sides. The overall terrain is high in the north and south, West and low in the East. The geomorphic units in the basin can be divided into intermountain basin landform, canyon landform and alluvial proluvial basin landform, of which the large and small Yudus basins belong to intermountain basin landform. The reach from the source of Kaidu River to the river canyon in the north of Yanqi basin is canyon landform, and the terrain height is obviously graded. The Kaidu River enters the Yanqi Basin from the east of Dashankou. The terrain is relatively flat and open, showing the geomorphic characteristics of an alluvial proluvial basin. The Yanqi basin is a local faulted basin formed between the main vein of the eastern Tianshan Mountains and its branches. Bosten Lake is in the southeast of the Yanqi Basin. There are a large number of relatively small wetland lakes in the southwest and northwest of Bosten Lake. Bayinbuluk grassland also contains many wetland water bodies, and a large number of snow mountains are distributed in the region, with the terrain fluctuating greatly. There are many seasonal rivers and lakes supplied by snow melt under the snow mountain terrain. As the longest river in the region, the Kaidu River flows through the main cities, mountains, deserts, wetlands, and other landforms in the region. These complex landforms jointly increase the difficulty of surface water monitoring and regulation in Bosten Lake Basin.

Data Resources
The data used in this paper mainly include Landsat8 OLI, Landsat7 ETM, Bosten Lake Basin vector boundary, and Google Earth high-resolution image and (JAXA/ALOS/AW3D30_V1_1) elevation data in GEE platform database.
The image used for the optimal water index threshold and slope and discussion selects the USGS Landsat 8 Collection 1 Tier 1TOA Reflection ("LANDSAT/LC08/C01/T1/TOA") data with cloud cover less than 8% from May to August 2021. In order to explore the surface water extraction effect of various indexes in the long-term academic column, a total of 108 images with less than 8% cloud cover in the USGS Landsat 8 Collection 1 Tier 1 TOA Reflection ("LANDSAT/LC08/C01/T1/TOA") from 2013 to 2021 in the Google Earth engine database are used, and 156 images with less than 8% cloud cover in the USGS

Data Resources
The data used in this paper mainly include Landsat8 OLI, Landsat7 ETM, Boste Lake Basin vector boundary, and Google Earth high-resolution image and (JAXA/ALOS/AW3D30_V1_1) elevation data in GEE platform database.
The image used for the optimal water index threshold and slope and discussion se lects the USGS Landsat 8 Collection 1 Tier 1TOA Reflection ("LAND SAT/LC08/C01/T1/TOA") data with cloud cover less than 8% from May to August 2021 In order to explore the surface water extraction effect of various indexes in the long-term academic column, a total of 108 images with less than 8% cloud cover in the USGS Landsa

Remote Sensing Image
The ee.ImageCollection function calls the USGS Landsat 8 Collection1 Tier1 TOA Re flection dataset in the GEE database and sets the time interval from May to July 2021. Th image BQA band is used for traffic screening and cloud removal. The image 'B6', 'B7', and 'B4' bands are set to the red, green and blue channels, respectively. Map.addlayer functio performs false color synthetic display of images, highlighting the differences between wa ter bodies and other ground objects, and serves as the basis for sample point selection an one of the bases for surface water extraction effect.

Selection of Sample Points for Accuracy Verification
Based on the GEE platform, the Configure geometry import tool was used to creat six categories of ground objects. In combination with Google Earth satellite images an landsat8 false color composite images, 1283 water sample points ( Figure 3) and 153 nonwater sample points were selected in the study area, including 436 vegetation sampl  The ee.ImageCollection function calls the USGS Landsat 8 Collection1 Tier1 TOA Reflection dataset in the GEE database and sets the time interval from May to July 2021. The image BQA band is used for traffic screening and cloud removal. The image 'B6', 'B7', and 'B4' bands are set to the red, green and blue channels, respectively. Map.addlayer function performs false color synthetic display of images, highlighting the differences between water bodies and other ground objects, and serves as the basis for sample point selection and one of the bases for surface water extraction effect.

Selection of Sample Points for Accuracy Verification
Based on the GEE platform, the Configure geometry import tool was used to create six categories of ground objects. In combination with Google Earth satellite images and land-sat8 false color composite images, 1283 water sample points ( Figure 3) and 1538 nonwater  In order to reflect the correctness of sample point selection, the sampleRegions func tion is used on the GEE platform to extract the reflectance values of all bands under eac sample point of various ground objects, and the average value is obtained to prepare th spectral characteristic curve of typical ground objects in Bosten Lake Basin (Figure 4). I can be seen from the figure that the spectral reflectance characteristics of ground object in the flow domain conform to the spectral characteristics of typical ground objects, whic proves the correctness of sample point selection.

Selection of Water Index and Realization of Index Calculation
By consulting the relevant literature on the construction of the water index, the wate index suitable for Landsat series images is selected ( Table 1). The normalized differenc and expression functions are used to calculate the index band on the GEE platform, an Map.addLayer function shows the result of the exponential operation. The reclassificatio In order to reflect the correctness of sample point selection, the sampleRegions function is used on the GEE platform to extract the reflectance values of all bands under each sample point of various ground objects, and the average value is obtained to prepare the spectral characteristic curve of typical ground objects in Bosten Lake Basin (Figure 4). It can be seen from the figure that the spectral reflectance characteristics of ground objects in the flow domain conform to the spectral characteristics of typical ground objects, which proves the correctness of sample point selection.

Selection of Water Index and Realization of Index Calculation
By consulting the relevant literature on the construction of the water index, the w index suitable for Landsat series images is selected ( Table 1). The normalized diffe and expression functions are used to calculate the index band on the GEE platform Map.addLayer function shows the result of the exponential operation. The reclassific judgment formula is used to calculate the water index. A pixel greater than 0 in the image is assigned as 1 as the surface water pixel, whereas a pixel less than 0 is assign

Selection of Water Index and Realization of Index Calculation
By consulting the relevant literature on the construction of the water index, the water index suitable for Landsat series images is selected ( Table 1). The normalized difference and expression functions are used to calculate the index band on the GEE platform, and Map.addLayer function shows the result of the exponential operation. The reclassification Water 2022, 14, 2809 7 of 17 judgment formula is used to calculate the water index. A pixel greater than 0 in the grid image is assigned as 1 as the surface water pixel, whereas a pixel less than 0 is assigned as 0 as the nonsurface water pixel, so as to distinguish the surface water and nonsurface water with 0 as the threshold. The Map.addLayer function displays the exponential operation results by using Export.image. to drive function exports of the final water extraction grid image to Google cloud disk and downloads it locally. Arcmap10.8 is used to further display and analyze the results. Table 1. Main water index calculation formula.

Index Name Index Formula Reference
ρ GREEN +ρ SW IR1 [42] Note: where Represents the band reflectance value, the band reflectance subscript corresponds to the corresponding band of different remote sensing images.

Use of Slope Mask and Determination of Optimum Threshold of Surface Water
In order to further eliminate the interference of snow and shadow and improve the accuracy of surface water extraction, slope factor judgment conditions are added to the index calculation results, and areas with excessive slope are divided into nonwater bodies. The constructed sample points are used as the verification basis. The Terrain.slope function converts (JAXA/ALOS/AW3D30_V1_1) DEM data into slope data, sets the data type of sample points to FeatureCollection, sets the Property of water extraction sample points to Class1 and the value to 1 and sets various nonwater sample points to FeatureCollection after fusion, with the Property set to class2 and the value set to 0. The Validation.filter function, which outputs the confusion matrix, overall accuracy, user accuracy, producer accuracy and kappa coefficient, are used as the basis for accuracy determination. The change of water extraction accuracy was observed by iterating the index threshold and slope mask. On the basis of threshold iteration, various indices are set at t (threshold) = 0, s (slope) = 0; t = 0, b = 10; t = b (best value), s = 0; water extraction is carried out in the four cases of t = b and s = b, and compared with Google Earth HD image to further identify the effect of water extraction.

Discussion on Extraction Methods of Other Water Bodies
In the process of extraction by the GEE window shows and satellite image layer, preliminary extraction results found that although the various indexes of regional water extraction effects are not the same, the water main area can be extracted by a large number of falsely divided bodies of water feature category, mainly for the mountain shadow and snow body city shadow, wetlands and other false points such as pixels compared to the previous two kinds or types. In order to discuss the classification details, LibSVM, SmileCart and MininumDistance classifiers were used for supervised classification using water sample points and non-water sample points on the GEE platform, and 10 typical water areas were selected in the study area for further visual discrimination of water extraction effect.

Validation of Water Extraction Accuracy in Long-Time Series
The third method of accuracy verification was to verify the stability of the water extraction effect in a long-time series by using the difference between water areas in dry and wet seasons. Therefore, to further explore the water extraction effect of various water indexes in the long-time series under the optimal water index and the optimal slope mask threshold, May-August and September-October were taken as the dry season and the wet season, respectively, in Bosten Lake Basin, and Landsat7 ETM and Landsat8 OLI were used to calculate the water area of various water indexes in the dry season and wet season from 2000 to 2021. The pixel value of surface water is set as 1 and that of non-surface water is set as 0. The pixel value of 1 multiplied by them is defined as the permanent surface water. Formula (1) is used to calculate the misdivided area of surface water in a long-time series. The surface water existing in both the dry season and wet season should be close to the one with the smaller area of the two. The reason why the permanent surface water is smaller is that the misdifferentiated pixels are removed during the superposition operation of surface water results in the dry and wet seasons. Therefore, the smaller the difference value is, the fewer misdifferentiated pixels are and the higher the surface water extraction accuracy is, which can be used as the basis for judging the surface water extraction effect.
Note: in the formula, E represents the annual average misclassified area, A ds represents the extracted area of water in dry season, A ws represents the extracted area of water in wet season, and A p represents the permanent water area.

Extraction Effect of Surface Water with Water Index 0 as Threshold Value
It can be seen from Figures 5 and 6 that a large number of non-water pixels are misclassified into water pixels when various indices are used as the threshold of 0 for water extraction. According to the results, WI2019 and EWI have the best water extraction effect, whereas AWEI sh , MNDWI and WI2015 have poor extraction effects. The water index extraction effect is compared in detail with Site1-lake, Site2-wetland, Site3-river, Site4-small surface water, Site5-city surface water, Site6-mountain surface water and the snow mountain surface water region corresponding to Figure 1 in the region. Results showed that the water index in lakes, rivers and the urban area obtained good results of water extraction, but in complex areas, WI2019 distinguishes better between snow and water effect. However, AWEI nsh is better than that of WI2019 for distinguishing shadow and water bodies, as most of the shadow is divided into surface water and the snow pixels, and the slope is the main cause of shadow, where a large amount of snow is also distributed on hills at higher altitudes. Therefore, a slope mask based on index WI2019 can further remove the misclassification pixels caused by mountain snow and mountain shadows. higher altitudes. Therefore, a slope mask based on index WI2019 can further remove the misclassification pixels caused by mountain snow and mountain shadows.

Changes of Extraction Accuracy under Water Index Threshold and Slope Iteration
The slope mask is added on the basis of the optimization of water index threshold. Through the continuous iteration of nine water index thresholds and slope thresholds, the accuracy of water extraction results by different methods is evaluated based on the overall accuracy, user accuracy, producer accuracy and kappa coefficient generated by the selected surface feature sample points in the study area, as shown in Table 2.  It can be seen from Table 2 that when the threshold value is 0 and slope is 0 for exponential water extraction, the overall accuracy is between 0.6-0.7 and the kappa coefficient is between 0.25-0.35. The user accuracy and producer accuracy of surface water and nonsurface water are very different, with one being higher and the other being lower. With 0 as the threshold index calculation, results for the distinction between water and the water effect is poorer. However, with zero as the slope, and through iteration to find the best threshold value of various index, it was found that all kinds of indexes under the best threshold and under the extraction accuracy, in comparison with 0 as the threshold of the extraction, will only slightly improve accuracy when the threshold value is 0, and the slope for water extraction is 10. When each index of the extraction of the overall accuracy reached 0.8 or more, the user accuracy and producer accuracy exceeded 0.8, and when the gap is not big, the kappa coefficient reached 0.8 above, which can greatly improve the wetland information extraction effect and can effectively remove the water pixels. On the basis of the water index, iteration threshold and the slope, it was found that WI2019 and AWEI nsh achieved the highest accuracy with the best threshold and slope threshold. When the threshold of WI2019 was −0.15 and the slope mask threshold was 8, the overall accuracy reached 0.94 and the kappa coefficient reached 0.89. When the AWEI nsh threshold is −0.09 and the slope is 5, the overall accuracy reaches 0.937 and the kappa coefficient is 0.87. The three supervised classification methods also achieve high extraction accuracies. Therefore, complex terrain is further selected for visual discrimination of the water extraction effect.

Comparison of Water Extraction Effects under Complex Terrains
It can be seen from Figure 7 that although water pixels can be effectively extracted under complex terrain (site7-10), a large number of snow and mountain shadows are misclassified into water pixels. When water is extracted with the optimal slope threshold of 0, the misclassified pixel area is further increased. WI2019, AWEI nsh and other indexes show the same results. The reason is that although the overall accuracy and kappa coefficients have achieved great results using sample points for accuracy evaluation, there is a large difference between the user accuracy and producer accuracy of water and nonwater bodies, and the threshold value is small. Therefore, the classification results using this threshold value have produced many misclassification pixels. When WI2019 optimal threshold value and slope were used for water extraction, the best water extraction effect was achieved, and snow and mountain shadow misclassification pixels were excluded to the maximum extent, compared with the supervised classification results, and there are still a small number of snow and shadow pixels that are mistakenly classified as water bodies, and the effect is poor. threshold value and slope were used for water extraction, the best water extraction effect was achieved, and snow and mountain shadow misclassification pixels were excluded to the maximum extent, compared with the supervised classification results, and there are still a small number of snow and shadow pixels that are mistakenly classified as water bodies, and the effect is poor.

Effect Analysis of Long Time Series Water Extraction
Landsat series remote sensing images of GEE platform from 2000 to 2021 were used to extract surface water in Bosten Lake Basin using various water indexes under the optimal index threshold and slope mask threshold, and the annual average water error area under different methods was respectively counted, as shown in Table 3. The average annual extraction error of WI2019 under the optimal index threshold and slope mask threshold is 140.5183 km 2 , which is still the optimal extraction effect. The error area of other water indices on long-term series is also small. For example, the average annual error area of AWEI sh , ANWI and NDWI is only 145.478 km 2 , 177.5806 km 2 and 194.1482 km 2 , respectively, indicating that although its water extraction effect is not as good as WI2019, its extraction effect has good stability, which can be considered as a backup scheme for water extraction in other regions.

The Relationship between the Optimal Threshold of Water Index and Water Extraction Effect
When slope mask is not used to search for the optimal threshold of surface water, the optimal threshold obtained by using sample points to verify the accuracy of surface water extraction is often too small. In a visual interpretation, it is found that a large number of non-surface water pixels were misclassified into surface water pixels and that surface water extraction was carried out only with the optimal water index threshold. Good results can be achieved in areas with large continuous water areas or relatively flat terrain [3,[43][44][45]. However, the results may be unreliable in large areas or areas with a complex geographical pattern. In the process of water extraction with water index, it is found that although the water index has its own advantages, the threshold value is the most critical factor to determine the effect of water extraction, whereas the structure of water index is secondary. Similar conclusions have been drawn in related studies on the optimal threshold value of water index [46,47] The optimal slope mask of index wi2019 is 8, which is greater than the optimal slope mask threshold of water indexes such as AWEI sh and AWEI nsh . In the actual process of surface water, the distinguishing effect of water indexes such as AWEI sh and AWEI nsh on shadow and surface water without slope mask is better than that of wi2019, indicating that the slope in the optimal threshold slope can reflect the shadow removal effect of water index. This is consistent with the comparison result that the AWEI index is better than other water indexes in the practical application of water index in relevant studies [48,49].

Commonality of Water Extraction Methods
This paper does not validate the water extraction method in other areas because the water extraction method proposed in this paper does not have a fixed index or threshold and can carry out the same workflow in different areas to find the optimal results. When judging the effect of water extraction in the long-time series, the water area in dry seasons in very few years is larger than that in wet seasons. According to the display effect of GEE in the extraction process, the reason is not only the extraction error but also the complex terrain and climate conditions in the region, which have little impact on the water extraction in the long-time series. The slope mask has achieved a good effect in distinguishing water bodies in areas with mountainous shadows and more snow, but it may not be applicable in areas with flat terrain. Although this method has achieved a good effect in extracting water bodies, there are still pixels incorrectly divided into water bodies, and the image resolution has a great impact on the extraction of small water bodies. Therefore, it is necessary to explore the applicability of this method in high-resolution images in future work and increase the comparison of more water extraction methods. The results of this study with a slope of 8 as a threshold are only applicable to specific RS imagery (Landsat series for this study) restricted by specific transit times and specific scanning angles. For example, when the hill slope and aspect are stable, the shadow area at noon must be smaller than that in the morning and evening. Therefore, there may be errors when using this method to extract water area from different remote sensing images. In addition, there is a certain difference in the spectral characteristics between the water pixels under shadow and those under light, and the spectral difference between them is smaller than that between the two. Although the difference between different bands enables the shadow water pixels to be extracted to a certain extent by the exponential method, water pixels, however, cannot be extracted in areas where the reflectance is too low or the water is completely shaded. Although there are few such water pixels, the loss of water pixels will still occur.
Although this method aims to get the higher precision of water extraction, and implements the long time series of water extraction, the prediction about the future of the water area of change need comprehensive consideration of many driving factors. Hence, under the premise of remote sensing image in the future, the lack of basic data is difficult to achieve, but the set of methods can be used in the future the extraction of remote sensing data for water. Previous water extraction results can provide historical data for water resource management and decision making in the region.

Conclusions
In this study, on the premise of preliminary discussion on various water indexes, the water index is used to extract the surface water of Bosten Lake Basin under the GEE platform. The surface water extraction effects of different water indexes are compared in three ways: sample accuracy verification, visual discrimination, and misclassification of area under long-time series. A method for surface water extraction in complex terrain areas is proposed by adding a slope mask. The interference of slope and snow cover is effectively removed, and the high-precision extraction of surface water in the region is realized through threshold iterative optimization. This method can be applied to the extraction of long-time series water in the region.
The index threshold has been optimized in previous studies on water information extraction using the water index. In this paper, when trying to extract water in the Bosten Lake basin with 0 as the threshold, various water indexes have achieved good water extraction results in lakes, wetlands, cities, and rivers, but the extraction effect in the whole region is generally poor. Therefore, taking 0 as the threshold for water extraction can reflect the advantages and disadvantages of the water extraction effect to a certain extent, but the water extraction result is not reliable, and it is still necessary to improve the water extraction effect through threshold optimization. The accuracy of water extraction has been significantly improved after slope masking of various water indexes. In Bosten Lake Basin, the ground feature types that affect the water extraction effect are mainly shadow and snow. The index wi2019 has a better distinguishing effect on water and snow than other water indexes. Adding the slope mask can further remove the interference of shadow and mountain snow on water extraction. The water index WI2019 takes −0.15 as the threshold and the slope of 8 as the mask, achieving the highest water extraction accuracy and the best visual discrimination effect in the study area, and it is better than the water extraction results of supervised classification. The error area of water extraction in the long-time series is smaller than in other indexes. It can achieve high-precision water extraction in the region under the condition of large topographic relief and more snow. It is of certain significance for monitoring and managing the dynamic changes of surface water in the region.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author. The data are not publicly available due to confidentiality.

Conflicts of Interest:
The authors declare no conflict of interest.