# A Global Continuous Multi-Scale Terrain Contour Simplification Method Based on the Level Set
## 2 Methodology
### Generating Global Continuous Multi-Scale Simplified Contours
#### 2.3.2 Estimation of the Scales for the Simplified Contours  
As a general rule, in cartographic generalization, the shape similarity of a contour should correspond to its scale value. The contour lines with complex shapes have a large scale, whereas those lines with simple shapes have a small scale. When the topographic map was simplified from large to small scale, the shape of contour lines on the topographic map also changed from complex to simple [30]. According to [PERSON] [31], similarity is a measure that has been widely used to analyze the shape relationship of topographical objects. In this subsection, the shape similarity between the simplified and initial contours was used as an intermediary to estimate the scale of an arbitrary simplified contour. The shape similarity between two curves is often defined based on a specific distance measure [32]. One common metric of curve similarity is the Frechet distance, which takes the flow of two curves into account and the pairs of points whose distance contributes to the Frechet distance sweeping continuously along the respective curves [33]. However, the uneven distribution of the points of a polyline may affect the accuracy of the distance of this polyline [34]. To deal with such an uneven distribution, we proposed an improved Frechet distance method based on equidistant resampling points to precisely reflect the shape similarity between two contour lines [35]. First, \(L_{(Zi)}\) represents the simplified contour corresponding to the horizontal plane with a height value of \(Z_{i}\). The points on the simplified contour \(L_{(Zi)}\) were resampled via equidistant sampling, and the number of resampling points was similar to that in \(L^{\prime}_{0}\). The initial contour line is \(L^{\prime}_{0}:[0,n]\to V\), where \(V\) is a metric space and \(n\) is a positive integer. The sequence \((L^{\prime}_{0}(0),L^{\prime}_{0}(1),\dots,L^{\prime}_{0}(n))\) of the characteristic points of the characteristic sub-polynies of \(L^{\prime}_{0}\) was denoted by \(\delta(L^{\prime}_{0})\). \(L_{(Zi)}\) was defined similar to \(L^{\prime}_{0}\). Let \(\delta(L^{\prime}_{0})=(u_{1},\dots u_{p})\) and \(\delta(L_{Zi})=(v_{1},\dots v_{q})\) be the corresponding sequences. A coupling \(L\) between \(L^{\prime}_{0}\) and \(L_{(Zi)}\) represents a sequence \((u_{a1},\ v_{b1}),(u_{a2},\ v_{b2}),\dots,(u_{am},\ v_{bm})\) of distinct pairs from \(\delta(L^{\prime}_{0})*\delta\Big{(}L_{(Zi)}\Big{)}\), where \(p\) and \(q\) denote the number of characteristic sub-polynies on the two contour lines. Therefore, the coupling should follow the order of points in \(L^{\prime}_{0}\) and \(L_{(Zi)}\). The number of points here refers to the number of characteristic points. The length \(\|L\|\) of coupling \(L\) represents the length of the longest link in \(L\) as shown in Equation (7). \[\|L\|=\max_{i=1,\dots,m}d(u_{ai},v_{bi}) \tag{7}\]  
Given two contour lines \(L^{\prime}_{0}\) and \(L_{(Zi)}\), their improved Frechet distance is defined as Equation (8). This distance index can provide a basis for accurately capturing the similarity of the two contour lines. \[\delta_{dF}\big{(}L^{\prime}_{0},L_{zi}\big{)}=min\Big{\{}\|L\|\|L\text{ is a coupling between }L^{\prime}_{0}\text{ and }L_{(Zi)}\Big{\}} \tag{8}\]  
Then, the similarity between \(L(Z_{i})\) and \(L^{\prime}_{0}\) is defined as Equation (9) based on the improved Frechet distance. \[Sim\big{(}L^{\prime}_{0},\ L_{Zi}\big{)}=1-\delta_{dF}\big{(}L^{\prime}_{0}, \ L_{Zi}\big{)}\big{/}Length\big{(}L^{\prime}_{0}\big{)} \tag{9}\]  
where \(\delta_{dF}(L^{\prime}_{0},\ L_{Zi})\) represents the improved Frechet distance between contours \(L^{\prime}_{0}\) and \(L_{Zi}\), and \(Length(L^{\prime}_{0})\) represents the length of \(L^{\prime}_{0}\). Note that \(Sim(L^{\prime}_{0},L^{\prime}_{0})=1\) and \(Sim(L(Z_{i}),L^{\prime}_{0})=Sim(L^{\prime}_{0},\ L(Z_{i}))\).