Skip to content

Instantly share code, notes, and snippets.

@psadk
Last active August 13, 2016 07:56
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save psadk/70e451cc18851030bcc9 to your computer and use it in GitHub Desktop.
Maperitive Paper Ruleset for printed maps
// Paper ruleset
//
// Ruleset for printed maps, for example to make notes while surveying.
// Designed with rather rural areas in mind (may however be usable
// in cities as well) in high zoom (14+, on lower levels map
// not very much readable).
//
// Licence: Creative Commons Attribution-ShareAlike 3.0
// http://creativecommons.org/licenses/by-sa/3.0/
features
barrier fence: barrier=fence OR barrier=hedge OR barrier=wall OR barrier=block OR barrier=yes
barrier gate: barrier=gate OR barrier=chain OR barrier=entrance OR barrier=cycle_barrier OR barrier=horse_stile OR barrier=kissing_gate OR barrier=swing_gate OR barrier=turnstile
barrier lift_gate: barrier=lift_gate
embankment: embankment=yes OR man_made=embankment
ford: ford=yes
wildlife_feeding: amenity=game_feeding OR amenity=feeding_place
shelter: amenity=shelter
cross: historic=wayside_cross OR man_made=cross OR historic=wayside_shrine
fixme: fixme
hydrant: emergency=fire_hydrant
suction_point: emergency=suction_point
lines
road major: highway=motorway OR highway=trunk OR highway=motorway_link OR highway=trunk_link
road medium: highway=primary OR highway=secondary OR highway=tertiary OR highway=primary_link OR highway=secondary_link OR highway=tertiary_link
road minor: highway=service OR highway=unclassified OR highway=residential OR highway=living_street OR highway=road
track: highway=track
track g1: highway=track AND tracktype=grade1
track g2: highway=track AND tracktype=grade2
track g3: highway=track AND tracktype=grade3
track g4: highway=track AND tracktype=grade4
track g5: highway=track AND tracktype=grade5
pedestrian path: highway=path
pedestrian footway: highway=footway OR highway=pedestrian
pedestrian steps: highway=steps
pedestrian cycleway: highway=cycleway
pedestrian bridleway: highway=bridleway
waterway river: waterway=river OR waterway=canal
waterway stream: waterway=stream
waterway drain: waterway=ditch OR waterway=drain
railway train: railway=rail
railway tram: railway=tram
bridge major: (highway=motorway OR highway=trunk OR highway=motorway_link OR highway=trunk_linl) AND bridge=yes
bridge medium: (highway=primary OR highway=secondary OR highway=tertiary OR highway=primary_link OR highway=secondary_link OR highway=tertiary_link) AND bridge=yes
bridge minor: (highway=service OR highway=unclassified OR highway=residential OR highway=living_street OR highway=road) AND bridge=yes
bridge track: highway=track AND bridge=yes
bridge pedestrian: (highway=path OR highway=footway OR highway=pedestrian OR highway=steps OR highway=cycleway OR highway=bridleway) AND bridge=yes
bridge train: railway=rail AND bridge=yes
bridge tram: railway=tram AND bridge=yes
tunnel major: (highway=motorway OR highway=trunk OR highway=motorway_link OR highway=trunk_linl) AND tunnel=yes
tunnel medium: (highway=primary OR highway=secondary OR highway=tertiary OR highway=primary_link OR highway=secondary_link OR highway=tertiary_link) AND tunnel=yes
tunnel minor: (highway=service OR highway=unclassified OR highway=residential OR highway=living_street OR highway=road) AND tunnel=yes
tunnel track: highway=track AND tunnel=yes
tunnel pedestrian: (highway=path OR highway=footway OR highway=pedestrian OR highway=steps OR highway=cycleway OR highway=bridleway) AND tunnel=yes
tunnel train: railway=rail AND tunnel=yes
tunnel tram: railway=tram AND tunnel=yes
power line: power=line
power m_line: power=minor_line
areas
water: natural=water OR waterway=riverbank OR landuse=reservoir OR landuse=basin
wetland: natural=wetland
forest: natural=wood OR landuse=forest OR landcover=trees
building: building
parking: amenity=parking
residential: landuse=residential
grass: landuse=grass OR natural=grassland OR landcover=grass
scrub: natural=scrub
power station: power=substation OR power=plant OR power=generator
marina: leisure=marina
points
place: place
peak: natural=peak OR man_made=peak
tree: natural=tree
housenumber: addr:housenumber
power tower: power=tower
power m_tower: power=pole
mountain_pass: mountain_pass=yes
cave: natural=cave_entrance
marina: leisure=marina
hunting_stand: amenity=hunting_stand
street_lamp: highway=street_lamp
properties
map-background-color: white
font-family: DejavuSans
text-halo-opacity: 0.75
text-halo-width: 8
font-stretch: 1.1
font-size: 11
rules
// target: all lines
// define
// line-color: red
// line-width: 0.25
// draw: line
target: place
define
min-zoom: 12
text: name
font-size: 12:10; 14:12; 16:14
font-stretch: 1.2
text-halo-opacity: 0.6
text-halo-width: 12
text-offset-vertical: 0
text-offset-horizontal: 0
draw: text
target: mountain_pass
define
min-zoom: 14
text-halo-width: 4
text: ")("
font-stretch: 1.5
text-orientation: fixed
draw: text
define
min-zoom: 15
text: name "\n" ele
font-stretch: 1.1
text-offset-vertical: 10
text-align-vertical: near
draw: text
target: ford
define
min-zoom: 14
text: "≉"
font-size: 14:200%
text-halo-width: 4
text-halo-opacity: 0.8
draw: text
// target: embankment
// define
// min-zoom: 14
// line-style: solid
// line-color: gray
// line-width: 0.5
// shape-size: 14:4; 16:6
// shape-orientation: flow
// shape-mode: linear
// shape: custom
// shape-spacing: 1
// shape-def: p:gray;pw:0.7;m:0,-3;l:0,0;z
// draw: line
// draw: shape
target: cave
define
min-zoom: 14
text: "⋒"
font-size: 14:120%; 15:160%
text-halo-width: 4
text-halo-opacity: 0.8
draw: text
define
min-zoom: 15
text: name
font-size: 11
text-offset-vertical: 10
text-align-vertical: near
draw: text
target: marina
define
min-zoom: 14
text: "⚓"
font-size: 14:120%; 15:160%
text-halo-width: 4
text-halo-opacity: 0.8
text-orientation: fixed
draw: text
target: peak
define
min-zoom: 13
shape: triangle
shape-mode: center
shape-size : 10
fill-color: black
line-style: none
draw: shape
define
min-zoom: 15
text: name "\n" ele
text-offset-vertical: 5
text-align-vertical: near
draw: text
target: wildlife_feeding
define
min-zoom: 15
text: "⟰"
font-size: 14
text-halo-width: 4
text-halo-opacity: 0.8
// text-offset-vertical: -5
draw: text
target: hunting_stand
define
min-zoom: 15
text: "Ħ"
font-size: 14
text-halo-width: 4
text-halo-opacity: 0.8
// text-offset-vertical: -5
draw: text
target: street_lamp
define
min-zoom: 15
text: "آ"
font-size: 14
text-halo-width: 4
text-halo-opacity: 0.8
// text-offset-vertical: -5
draw: text
target: hydrant
define
min-zoom: 15
text: "н"
font-size: 14
text-halo-width: 4
text-halo-opacity: 0.8
// text-offset-vertical: -5
draw: text
target: suction_point
define
min-zoom: 15
text: "⇡"
font-size: 14
text-halo-width: 4
text-halo-opacity: 0.8
// text-offset-vertical: -5
draw: text
target: cross
define
min-zoom: 15
text: "✝"
font-size: 14
text-halo-width: 4
text-halo-opacity: 0.8
// text-offset-vertical: -5
draw: text
target: shelter
define
min-zoom: 15
text: "☔"
font-size: 14
text-halo-width: 4
text-halo-opacity: 0.8
text-offset-vertical: -5
draw: text
target: power *
define
min-zoom: 14
line-color: gray
line-opacity: 1
line-width: 0.5
fill-color: gray
shape-size: 5
if: power station
define
fill-opacity: 0.5
line-style: none
draw: fill
define
text: "⚡"
font-size: 14:100%; 15:300%
text-halo-width: 0
draw: text
if: power line
define
line-style: dashdot
line-width: 1
draw: line
if: power m_line
define
line-style: dashdot
draw: line
if: power tower
define
shape: square
fill-opacity: 0
draw: shape
define
shape: custom
shape-def: p:gray;pw:0.5;m:-5,-5;l:5,5;m:-5,5;l:5,-5;z
draw: shape
if: power m_tower
define
shape: square
draw: shape
target: barrier*
define
min-zoom: 15
if: barrier fence
define
line-style: solid
line-color: gray
line-opacity: 1
line-width: 0.5
shape: custom
shape-size: 5
shape-mode: linear
shape-spacing: 10
shape-orientation: flow
shape-def: p:gray;pw:1;m:-3,3;l:3,-3;m:-3,-3;l:3,3;z
draw: shape
draw: line
elseif: barrier gate
define
text: "≠"
font-size: 160%
text-halo-opacity: 0.8
text-orientation: fixed
draw: text
elseif: barrier lift_gate
define
text: "⌐"
font-size: 160%
text-halo-opacity: 0.8
text-orientation: fixed
draw: text
target: tree
define
min-zoom: 14
shape: circle
shape-mode: center
shape-size : 5
fill-color: gray
fill-opacity: 0.5
line-style: none
draw: shape
define
min-zoom: 15
text: name
text-offset-vertical: 14
draw: text
target: tunnel *
define
line-style: dash
line-color: black
border-width: 0
line-opacity: 0.2
if: tunnel major
define
min-zoom: 6
line-width: 14:3; 15:4
draw: line
if: tunnel medium
define
min-zoom: 10
line-width: 14:2; 15:3
draw: line
if: tunnel minor
define
min-zoom: 12
line-width: 14:1; 15:2
draw: line
if: tunnel track
define
min-zoom: 13
line-offset-sides: both
line-offset: 2.5
line-width: 0.1
line-opacity: 0.8
draw: line
if: tunnel train
define
min-zoom: 11
line-offset: 14:2; 15:3
draw: line
if: tunnel tram
define
min-zoom: 12
line-color: gray
border-color: gray
line-offset: 1
draw: line
if: tunnel pedestrian
define
min-zoom: 13
line-width: 0.1
line-offset-sides: both
line-offset: 14:2; 15:3
line-opacity: 0.8
draw: line
target: bridge *
define
min-zoom: 13
line-style: solid
line-color: black
line-offset-sides: both
border-width: 0
line-width: 75%
if: bridge major
define
line-offset: 14:3; 15:4
line-width: 20%
draw: line
if: bridge medium
define
min-zoom: 14
line-offset: 14:2; 15:3
line-width: 40%
draw: line
if: bridge minor
define
min-zoom: 14
line-offset: 14:1; 15:2
draw: line
if: bridge track
define
min-zoom: 14
line-offset: 2.5
line-width: 0.1
draw: line
if: bridge train
define
min-zoom: 14
line-offset: 14:2; 15:3
draw: line
if: bridge tram
define
min-zoom: 14
line-color: gray
border-color: gray
line-offset: 1
draw: line
if: bridge pedestrian
define
min-zoom: 14
line-width: 0.1
line-offset: 14:2; 15:3
draw: line
target: railway *
define
line-color: white
line-style: dashlong
border-style: solid
border-color: black
border-width: 0.8
if: railway train
define
min-zoom: 11
line-width: 14:2; 15:3
elseif: railway tram
define
border-color: gray
min-zoom: 12
line-width: 1
draw: line
target: road *
define
line-join: round
line-start-cap: round
line-end-cap: round
line-color: white
border-style: solid
border-color: black
fill-color: white
if: road major
define
min-zoom: 6
line-width: 14:3; 15:4
border-width: 14:1.5; 15:2
draw: line
draw: fill
if: road medium
define
min-zoom: 10
line-width: 14:2; 15:3
border-width: 14:1; 15:1.5
draw: line
draw: fill
define
min-zoom: 14
text-offset-vertical: 12:8;15:-10
font-size: 12:8;15:10
draw: text
if: road minor
define
min-zoom: 12
line-width: 14:1; 15:2
border-width: 14:1; 15:1.5
draw: line
draw: fill
define
min-zoom: 15
text-offset-vertical: -10
font-size: 14:8;15:10
draw: text
target: track*
define
min-zoom: 13
line-color: black
if: track g1
define
min-zoom: 11
line-width: 12:1; 13:2
line-style: solid
draw: line
elseif: track g2
define
line-width: 1.6
line-style: solid
draw: line
elseif: track g3
define
line-width: 1.4
line-style: dash10to2
draw: line
elseif: track g4
define
line-width: 1.2
line-style: dash10to2
draw: line
elseif: track g5
define
line-style: dash8to2
line-width: 1.2
draw: line
else
define
line-style: solid
line-width: 1
draw: line
define
text-offset-vertical: -8
font-size: 8
min-zoom: 15
draw: text
target: pedestrian *
define
min-zoom: 13
line-color: black
line-width: 1
if: pedestrian path
define
line-style: dashlong
draw: line
elseif: pedestrian footway
define
line-style: dash
draw: line
elseif: pedestrian steps
define
line-width: 3
line-style: dot
draw: line
elseif: pedestrian cycleway
define
line-style: dash10to2
draw: line
target: $regex("housenumber|building")
define
min-zoom: 15
text: [[addr:housenumber]] "\n" [[addr:housename]] "\n" name
text-halo-width: 4
font-size: 8
draw: text
target: fixme
define
min-zoom: 15
// text: "⨍! " fixme
text: "❢ " fixme " ❢"
text-halo-width: 4
text-orientation: flow
font-size: 9
draw: text
target: building
define
min-zoom: 14
line-color: black
line-width: 0.5
fill-color: #888888
fill-opacity: 1
draw: fill
draw: line
target: wetland
define
fill-color: lightgray
fill-hatch-color: white
fill-hatch: cross
fill-hatch-opacity: 1
fill-opacity: 1
line-width: 0.1
line-style: dash
line-color: gray
draw: line
draw: fill
define
text-offset-vertical: 12:-6;14:-8;16:-12
font-size: 12:6;14:8;16:12
min-zoom: 14
draw: text
target: water
define
fill-color: lightgray
fill-hatch-color: white
fill-hatch: horizontal
fill-hatch-opacity: 1
fill-opacity: 1
line-width: 0.2
line-color: gray
painting-cycle: 410
draw: fill
draw: line
define
min-zoom: 13
text-offset-vertical: 12:-8;13:-10;16:-14
font-size: 12:8;13:10;16:14
draw: text
target: waterway *
define
line-color: gray
min-zoom: 8
painting-cycle: 405
if: waterway river
define
line-width: 11:2; 12:3
line-color: gray
draw: line
define
min-zoom: 12
text-offset-vertical: 12:-8;13:-10;16:-14
font-size: 12:8;13:10;16:14
draw: text
elseif: waterway stream
define
min-zoom: 13
line-width: 2
line-opacity: 0.6
draw: line
define
min-zoom: 15
text-offset-vertical: -10
font-size: 10
draw: text
elseif: waterway drain
define
min-zoom: 13
line-width: 1.5
line-opacity: 0.4
draw: line
target: parking
define
min-zoom: 13
fill-color: white
fill-opacity: 1
line-width: 0.4
line-color: gray
draw: fill
define
min-zoom: 15
text: "P"
text-orientation: fixed
font-weight: bold
font-size: 15:100%; 16:150%
draw: text
target: residential
define
min-zoom: 10
// Don't show landuse-residential on high zoom, when addr:housenumber is rendered
max-zoom: 15
fill-color: #A1A1A1
fill-opacity: 0.2
line-width: 0.5
line-color: lightgray
// line-style: solid
line-style: none
draw: fill
target: forest
define
fill-color: #DDDDDD
fill-hatch-color: white
fill-hatch: diagonalcross
fill-hatch-opacity: 0.1
fill-opacity: 0.1
line-width: 0.3
line-color: #BBBBBB
line-style: dot
// line-style: none
draw: fill
target: grass
define
fill-hatch-color: white
fill-hatch: nwse
fill-hatch-opacity: 0.1
fill-color: #DDDDDD
fill-opacity: 0.1
line-width: 0.2
line-color: #BBBBBB
line-style: dot
draw: fill
target: scrub
define
fill-hatch-color: white
fill-hatch: swne
fill-hatch-opacity: 0.1
fill-color: #DDDDDD
fill-opacity: 0.1
line-width: 0.2
line-color: #BBBBBB
line-style: dot
draw: fill
@cheshire-mouse
Copy link

Here is the ruleset, I've been looking for. Thanks alot.
One small detail: there are no country borders. Could you please add them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment