10.1. Maps and Dioramas¶
Anableps is specially suited to make maps, and appropriately, there is a map module that helps with the creation of a variety of topographical maps. There are two kind of maps: 2D and 3D maps, also called dioramas.
Todo
two examples with maps and diorama
10.1.1. Types of maps¶
Anableps offers several kinds of maps:
- Flat maps: take the planet earth (or other) and flatten, using a projection.
- 3D maps: use the flat map, adding the z coordinate
- Vmaps: snapshots of parts of a planet, so they show the curvature
- Dioramas: version of 3D maps. Show the soil below
All these kinds of map share much of their properties and creation syntax, so this is covered first
10.1.2. Creating a map¶
To create a map the following parameters must be specified:
- a region and a time: this can involve a different planet and a remote age.
- orientation: by default, looking to the north, or north up in flat maps.
- terrain and sea: how are the terrain and seas going be displayed.
- accidents: which geographical features are to be displayed: how many rivers/mountains, cities and region labels. These can be included en-block, including all features above a certain relevance, and/or be picked one-by-one.
- frills: any other information in the map. Arrows, regions, etc. Other signs and elements to the map, like wind-roses, scales, here-be-dragons, etc.
The first two (region/time, terrain) are mandatory, while the last two are optional.
10.1.2.1. Region/time¶
Creating a map starts by selecting which region do we want to map:
map m: .region italy.expand(40,50,60,70Km)
Regions can be given by names (all country names, continents )
The default planet is earth, as we know it nowadays. However, there are other planets (well, celestial bodies) that can be chosen. For some of them (currently just the earth), you can select the time:
map m: .planet moon .region mare tranquilitatis
map n: .time 140Mya # ya stands for years ago.
(please allow the somewhat lax denomination planet for every celestial body)
- Region can be selected, too , placing the camera::
- map m: .center 14º45’23’’N 20ºW .distance 50Km .slant 50deg .
10.1.2.1.1. Ancient Earth¶
Earth planet contains other configurations, to be able to display the earth as it was during its full geological history.
Note
The displayed ancient earth continent profile is approximate, taken from this references [ref1], [ref2]. If you think you can improve or bring-in more accurate profiles, please contact the contributors (contributors@anableps.net)
Todo
maps of the earth in the differents geological eras
10.1.2.2. Terrain¶
After having defined the planet, region and time, there is time to choose how do we want to put colors to the different regions of the map.
You can colorize according with height: for example:
palette palette1: ..at 5.0 red .at 6.0 blue .at 8.0 white .interpolation cubic
map m: .terrainValue height .terrainColor palette1
But terrainValue
can be any map2D that returns a single number for a given map coordinate. In this way, you can use GIS to:
script myScript: command "python script.py %x %y"
map m: .terrainValue myScript .terrainColor palette1
In order to make more calls, there could be:
batchScript myScript: command "python batchScript.py %x %y "
map m: .terrainValue myScript .terrainColor {palette:}
This is the standard terrain colorizer, but there is other, that stipples the areas with shapes:
terrainStippler t: .shape.....
Standard terrain colorizers:
- heightTerrain
- ShadowTerrain: This colorizer emulates shadows to create illussion of relief in mountains and valleys.
- .direction: direction of the light
- .angle: height angle of the light. Controls the harsnesh of the shadows
10.1.2.3. Seas¶
Just the same as with the terrain above the sea-line, seas can be colorized too, in different ways.
depthColorizer: colors seas according to the depth. Depths are taken from @TODO.
coastColorizer: paints the sees uniform, and the regions closer to the coasts, lighter
- half-distance: distance to the coast where the color lies halfway between color1 and color2.
- color1: color for the sea.
- color2: color for the coast.
distanceColorizer: similar to
SeaColorcoast
, uses a palette, according to the distance to the nearest coast- exponent: fall-off exponent
- color1: asdf
- color2: asdf
10.1.2.4. Geographical Accidents¶
Once the blank map is defined, is time to include geographical accidents on it. Those are:
- rivers:
- seas: actually, sea names
- mountains and mountain ranges:
- cities:
- regions:
To include some, use the .include
operation. The usual way is to include them in groups, according to the relative importance:
m.include: rivers.2 mountains.level3
As you see, rivers
is a hierarchical library, so you can include rivers up to some level
Sometimes, you want to exclude some, or include others so, simply add more includes
or excludes
:
m.include: rivers.2
m.include: sierra_morena, zafra
m.exclude: madrid, barcelona
The same goes for rivers
, labels
, regions
, seaLabels
.
10.1.2.5. Frills¶
To make a map, our map, the map that displays what we want, some other signs and sketches are needed. Those are collectively called frills:
map m {
terrain: .color heightColorizer
swash t.palette: 0 brown 200m red 1000m white
sea: .color depthColorizer
# those are frills
region r: .points (1,2), (2,3), (4,4), (5,5)
arrow a1: .from madrid .to barcelona .chomp 4%
}
Frills is everything that you put on it. Labels, additional objects, etc.
10.1.2.6. Styles¶
Finally, for some frills, there can be an style. Cities of different sizes can take different icons
Todo
how to do this???
10.1.2.7. Parameters¶
- region: allows selecting the region
- center: selects the center. Its used in combination
with
elevation
,slant
, anddirection
, to change the point of view.
10.1.3. Flat maps¶
So far, we’ve looked into the common properties of all maps. These
10.1.5. Dioramas¶
Along with maps and maps3D, dioramas are an useful way to display small sections of a map in a 3D way. Bear in mind that dioramas are constructed on top of a flat map, so they assume the terrain flat. A diorama looks like this:
Todo
(image: diorame_example )
Here you can see a chunk of terrain with, may be, sea, with the geological strata shown, and several features on the terrain surface.
See the following example:
diorame d: .area italy.expand(200Km, 30Km, 40Km, 30Km)
d: .depth 50Km .structure (a structure of textures and thicknesses)
ship.place: .bottom @ d.sea.uv(20,30) .axis || merid.
# way to give uv coordinates on any surface
10.1.5.1. Setting the shape¶
In the generic map options, region must be set. In diorames, the shape of the region is important, as it can be different from a rectangle
Todo
how to set the shape, and the fact that flat maps can specify different shapes, too.
10.1.5.2. Setting the geology¶
In diorames, a cutaway of the earth is shown, so it can be painted accordingly, too.
Many other occasions, you want to specify a custom geography.
10.1.5.3. Some remarks¶
Finally, when a diorama is created, is a whole scene (that can be included in your scene or directly be printed, displayed or whatever)
A Diorama object is a powerful high-level abstraction that has everything ready for being presented. For more complex goals, however, it can be useful to use only some components of it. They are listed here.
- dioramaTerrain: This is the terrain
10.1.5.4. Setting the time of the day¶
Dioramas usually depict small portions of terrain. In some cases, it could be useful to point the direction where the light comes from, or to know the position of some stars. This can be done by setting the time:
Diorama d: .center madrid
Note
This works well for recent dates. It does not take into account equinox precession, nor pole wandering, nor other date-related subtetlies.
10.1.6. Maps of invented regions¶
asdf asdf asdf
10.1.7. Regarding geographical data¶
Data containin all the coastal profiles and etc is lenghty. The one for global maps is stored with the usual anableps installation. However, for finer maps, it could be needed to download additional data files.