<jupyter_start><jupyter_text>Sup03-Ridgeline Plots of DEMRidgeline Plots (formerly Joyplots) is a kind of modern data visualization, whose name was coined by <NAME> in 2017 and refers to the seminal debut album “Unknown Pleasures” released in 1979 on Factory Records by Joy Division, from Salford, England. Ridgeline Plots is generated from a series of ridgelines or joyplots, each of which consists of a series of histograms, density plots or time series for a number of data segments, all aligned to the same horizontal scale and presented with a slight overlap.Ridgeline Plots, just like profiles or transects, could be used to show change in slope by illustrating the changes in height along a line drawn on a map (e.g., a DEM map). Elevation profiles are a side-view of the changes in elevation along the line as if the terrain has been sliced open and can be seen in aspect.Following the idea, it is quite easy to create a ***Ridgeline Plots of DEM*** in Python. As we already know, generally DEM data could be load into a 2D array. Thus we can draw a ridgeline for each row and pack all ridgelines together to create a Ridgeline Plots of DEM. Such a method is quite straightforward and easy to implement. However, when the DEM data comes with many many rows, it will become very hard to identify each ridgeline and the resultant map will look just like a normal map. Therefore, it is necessary to add blank space between ridgelines or downsample data.In this notebook, we will not do it manually step by step. We will use the package of [ridge map](https://github.com/ColCarroll/ridge_map) to show a simple example. The package also provides a few excellent examples. If you are really interested in this kind of visualization, have a look. Moreover, ridge map uses [***SRTM.py***](https://github.com/tkrajina/srtm.py) internally to allows you to setup bounding boxes and coordinates to download DEM data from NASA's Shuttle Radar Topography Mission ([SRTM](https://www2.jpl.nasa.gov/srtm/)).  Show time<jupyter_code>from ridge_map import RidgeMap
import matplotlib.pyplot as plt

import warnings
warnings.filterwarnings("ignore")<jupyter_output><empty_output><jupyter_text>Load and preprocess DEMSetup spatial bounds around New Zealand<jupyter_code>rm     = RidgeMap((165.058594,-47.635784,179.648438,-34.307144))
values = rm.get_elevation_data(num_lines=150)
values = rm.preprocess(values=values, 
                       lake_flatness=2,
                       water_ntile=10,
                       vertical_ratio=240)<jupyter_output><empty_output><jupyter_text>Create map<jupyter_code>rm.plot_map(values=values,
            label='New Zealand',
            label_y=0.1,
            label_x=0.55,
            label_size=40,
            linewidth=1,
            line_color = plt.get_cmap('terrain'),
            kind='elevation'
           )<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06388888888888888, 'fraction_numerical': 0.021875, 'mean_word_length': 3.9247863247863246, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '433365', 'license': 'MIT', 'n_tokens_mistral': 854, 'n_tokens_neox': 775, 'n_words': 358, 'path': 'Sup03-Ridgelines Map of DEM.ipynb', 'repo_name': 'royalosyin/Work-with-DEM-data-using-Python-from-Simple-to-Complicated', 'size': '2885'}