Terrain
Contours¶
Contour lines traced from open elevation tiles, generalised like a printed map, returned as a GeoDataFrame.
Needs pip install kharita[terrain]. where is a GeoDataFrame, a GeoSeries or a (west, south, east, north) box.
| Argument | Does |
|---|---|
interval |
metres between lines; chosen for about 20 lines when not set |
index_every |
every Nth line is an index contour (default 5) |
detail |
"low", "medium" (default) or "high": how many small bumps and wiggles are kept |
smooth |
the blur in metres, instead of detail; 0 gives raw lines |
zoom |
tile zoom; the most detailed that needs at most 16 tiles when not set |
below_sea |
also trace levels below zero |
The result has elevation, index (True for index contours) and weight (2 for index lines, 1 for the rest), and records interval, zoom, smooth and detail in .attrs.
A topographic map¶
preset-topo draws brown lines with index contours twice as thick; a second layer labels the index lines.
Over imagery¶
How detail works¶
Contours are generalised before they are drawn. The elevation is blurred over at least 300 m, or about a three-hundredth of the area's width, whichever is bigger (low blurs twice as much, high half as much). Then lines shorter than eight blur widths are dropped, and the rest are simplified and their corners rounded. Elevation comes from the Mapzen Terrain Tiles on AWS Open Data.

