Function Repository Resource:

RidgeLineMap

Source Notebook

Generate a ridge line map from elevation data

Contributed by: Harshal Gajjar

ResourceFunction["RidgeLineMap"][data]

generates a ridge line map for the given data.

Details and Options

data must be a QuantityArray with units of distance.
data can be obtained using GeoElevationData.
ResourceFunction["RidgeLineMap"] supports the following options:
"Color"Grayset the ridge color
RasterSizeAutomaticset the absolute pixel size of the raster generated
"HeightMultiplier"Automaticemphasize altitudes in the map
"LineDensityMultiplier"Automaticincrease the density of lines in the map
"LineThickness"Automaticset the thickness of lines in the map
"MinimumAltitude"Quantity[0,"Meters"]set the minimum altitude to draw lines for

Examples

Basic Examples (3) 

Generate a ridge line map for near Mumbai:

In[1]:=
data = GeoElevationData[
   Entity["City", {"Bombay", "Maharashtra", "India"}], GeoRange -> Quantity[50, "Kilometers"]];
ResourceFunction["RidgeLineMap"][data]
Out[1]=

Generate a ridge line map for near Mount Everest:

In[2]:=
data = GeoElevationData[Entity["Mountain", "MountEverest"], GeoRange -> Quantity[10, "Kilometers"]];
ResourceFunction["RidgeLineMap"][data, "HeightMultiplier" -> 0.5]
Out[2]=

Near Mariana Trench:

In[3]:=
data = GeoElevationData[\!\(\*
NamespaceBox["LinguisticAssistant",
DynamicModuleBox[{Typeset`query$$ = "Mariana trench", Typeset`boxes$$ = TemplateBox[{"\"Mariana Trench\"", 
RowBox[{"Entity", "[", 
RowBox[{"\"UnderseaFeature\"", ",", "\"MarianaTrench\""}], "]"}], "\"Entity[\\\"UnderseaFeature\\\", \\\"MarianaTrench\\\"]\"",
          "\"undersea feature\""}, "Entity"], Typeset`allassumptions$$ = {}, Typeset`assumptions$$ = {}, Typeset`open$$ = {1, 2}, Typeset`querystate$$ = {"Online" -> True, "Allowed" -> True, "mparse.jsp" -> 1.190537, "Messages" -> {}}}, 
DynamicBox[ToBoxes[
AlphaIntegration`LinguisticAssistantBoxes["", 4, Automatic, 
Dynamic[Typeset`query$$], 
Dynamic[Typeset`boxes$$], 
Dynamic[Typeset`allassumptions$$], 
Dynamic[Typeset`assumptions$$], 
Dynamic[Typeset`open$$], 
Dynamic[Typeset`querystate$$]], StandardForm],
ImageSizeCache->{243.25, {8.125, 17.125}},
TrackedSymbols:>{Typeset`query$$, Typeset`boxes$$, Typeset`allassumptions$$, Typeset`assumptions$$, Typeset`open$$, Typeset`querystate$$}],
DynamicModuleValues:>{},
UndoTrackedVariables:>{Typeset`open$$}],
BaseStyle->{"Deploy"},
DeleteWithContents->True,
Editable->False,
SelectWithContents->True]\), GeoRange -> Quantity[10, "Kilometers"], GeoProjection -> Automatic, UnitSystem -> "Metric"];
ResourceFunction["RidgeLineMap"][data, "MinimumAltitude" -> Quantity[-Infinity, "Meters"]]
Out[3]=

Options (6) 

Color (1) 

Change the color of lines using this option:

In[4]:=
data = GeoElevationData[
   Entity["City", {"Bombay", "Maharashtra", "India"}], GeoRange -> Quantity[50, "Kilometers"]];
ResourceFunction["RidgeLineMap"][data, "Color" -> Orange]
Out[4]=

RasterSize (1) 

Change the absolute pixel size of the raster generated using this option:

In[5]:=
data = GeoElevationData[
   Entity["City", {"Bombay", "Maharashtra", "India"}], GeoRange -> Quantity[50, "Kilometers"]];
ResourceFunction["RidgeLineMap"][data, RasterSize -> 100]
Out[5]=

HeightMultiplier (1) 

Emphasis on heights can be changed by using this option:

In[6]:=
data = GeoElevationData[
   Entity["City", {"Bombay", "Maharashtra", "India"}], GeoRange -> Quantity[50, "Kilometers"]];
ResourceFunction["RidgeLineMap"][data, "HeightMultiplier" -> 0.01]
Out[6]=

MinimumAltitude (1) 

Set the minimum altitude below which no lines will be drawn using this option:

In[7]:=
data = GeoElevationData[
   Entity["City", {"Bombay", "Maharashtra", "India"}], GeoRange -> Quantity[50, "Kilometers"]];
ResourceFunction["RidgeLineMap"][data, "MinimumAltitude" -> Quantity[-Infinity, "Meters"]]
Out[7]=

LineDensityMultiplier (1) 

Change the number of lines on map using this option:

In[8]:=
data = GeoElevationData[
   Entity["City", {"Bombay", "Maharashtra", "India"}], GeoRange -> Quantity[50, "Kilometers"]];
ResourceFunction["RidgeLineMap"][data, "LineDensityMultiplier" -> 2]
Out[8]=

LineThickness (1) 

Change the thickness of lines on map using this option:

In[9]:=
data = GeoElevationData[
   Entity["City", {"Bombay", "Maharashtra", "India"}], GeoRange -> Quantity[50, "Kilometers"]];
ResourceFunction["RidgeLineMap"][data, "LineThickness" -> 0.001]
Out[9]=

Neat Examples (4) 

Ridge map of the US:

In[10]:=
data = GeoElevationData[
   Entity["City", {"NewYork", "NewYork", "UnitedStates"}], GeoRange -> "Country", GeoProjection -> Automatic, UnitSystem -> "Metric"];
ResourceFunction["RidgeLineMap"][data, "HeightMultiplier" -> 0.1, "LineThickness" -> 0.003]
Out[10]=

Of the world:

In[11]:=
data = GeoElevationData[
   Entity["City", {"Bombay", "Maharashtra", "India"}], GeoRange -> "World"];
ResourceFunction["RidgeLineMap"][data, "HeightMultiplier" -> 0.05, "LineThickness" -> 0.003]
Out[11]=

The Himalayas, being tall require use of "HeightMultiplier" whenever present in the view:

In[12]:=
data = GeoElevationData[
   Entity["City", {"Bombay", "Maharashtra", "India"}], GeoRange -> "Country"];
ResourceFunction["RidgeLineMap"][data, "HeightMultiplier" -> 0.05]
Out[12]=

Mumbai, after a water level rise of 3m:

In[13]:=
data = GeoElevationData[
   Entity["City", {"Bombay", "Maharashtra", "India"}], GeoRange -> Quantity[20, "Kilometers"]];
ResourceFunction["RidgeLineMap"][data, "MinimumAltitude" -> Quantity[3, "Meters"]]
Out[13]=

Publisher

Harshal Gajjar

Version History

  • 1.0.0 – 31 July 2020

Related Resources

License Information