Mapweaver/Manual/Map style

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages — Mapweaver/Manual/Map style
Afrikaans Alemannisch aragonés asturianu azərbaycanca Bahasa Indonesia Bahasa Melayu Bân-lâm-gú Basa Jawa Baso Minangkabau bosanski brezhoneg català čeština dansk Deutsch eesti English español Esperanto estremeñu euskara français Frysk Gaeilge Gàidhlig galego Hausa hrvatski Igbo interlingua Interlingue isiXhosa isiZulu íslenska italiano Kiswahili Kreyòl ayisyen kréyòl gwadloupéyen kurdî latviešu Lëtzebuergesch lietuvių magyar Malagasy Malti Nederlands Nedersaksies norsk norsk nynorsk occitan Oromoo oʻzbekcha/ўзбекча Plattdüütsch polski português română shqip slovenčina slovenščina Soomaaliga suomi svenska Tiếng Việt Türkçe Vahcuengh vèneto Wolof Yorùbá Zazaki српски / srpski беларуская български қазақша македонски монгол русский тоҷикӣ українська Ελληνικά Հայերեն ქართული नेपाली मराठी हिन्दी অসমীয়া বাংলা ਪੰਜਾਬੀ ગુજરાતી ଓଡ଼ିଆ தமிழ் తెలుగు ಕನ್ನಡ മലയാളം සිංහල ไทย မြန်မာဘာသာ ລາວ ភាសាខ្មែរ ⵜⴰⵎⴰⵣⵉⵖⵜ አማርኛ 한국어 日本語 中文(简体)‎ 吴语 粵語 中文(繁體)‎ ייִדיש עברית اردو العربية پښتو سنڌي فارسی ދިވެހިބަސް

The style of the map is defined for 4 objects. For a complete list of options please use -help. The definitions go into a text file and the -style parameter defines which style file to use.

General

  • upper and lower case are ok
  • all sizes are given in pixels (300dpi)
  • Nearly all properties have default settings and might so be neglected in the rule file. The defaults are set in the ini file if required.
  • Valid colors are SVG colors - to be found in the web[1]-; also valid entries are html color codes (white is ffffff, black is 000000).

some sizes may be given as a range. Meaning that in the smallest scale the largest number will be taken and vice versa. Everything in between will be interpolated.

size=5:10

This applies for the following node properties:

  • iconSize
  • labelOffset
  • labelSize
  • shieldSize
  • size

And for the listed way properties:

  • size
  • borderSize
  • labelSize
  • labelOffset

Rule range

A rule range can be specified like this:

fromScale=0
toScale=10000

Objects will only appear up to 1:10000 maps.

Label properties

Some properties that apply to various objects:

labelbold=yes
labelitalic=yes

If you want to apply a halo, specify this:

labelhalo=2
labelhalocolor=white

Process labels

Labels can be processed before drawing, i.e to switch a label to upper case letters.

labeltransform=$label = uc ($label) ;

But you could also divide a given number by 1000, like this:

labeltransform=$label = $label / 1000 ;

Any perl command and function can be applied. The label is provided in variable $label and has to be in the same at the end of the transformation.

Nodes

A node can be as simple as this:

RULE NODE
keyvalue=place=city
size=20
color=black
label=name
labelsize=30

But it could include other information as well:

shape=diamond
circle=yes
circlecolor=blue
circleradius=5000
circlethickness=5

This would draw the node as a diamond and add a blue thin circle with a radius of 5 km around the node.

Possible shapes are:

  • circle
  • square
  • triangle
  • diamond

Possible node properties:

  • color
  • size
  • shape
  • svgString
  • circle
  • circleColor
  • circleRadius
  • circleThickness
  • circleSVGString
  • disc
  • discColor
  • discOpacity
  • discRadius
  • discSVGString
  • label
  • labelColor
  • labelSize
  • labelFont
  • labelOffset
  • legend
  • legendLabel
  • icon
  • iconSize
  • shieldName
  • shieldSize
  • shieldLabel
  • fromScale
  • toScale

Ways

A way rule could look like this:

RULE WAY
keyvalue=highway=motorway
color=blue
size=28
label=shield:icons/shield_ger_bab.def
labelsize=60
labeloffset=11
bordercolor=black
bordersize=2

Other valid way properties:

  • keyValue
  • color
  • size
  • dash
  • dashCap
  • borderColor
  • borderSize
  • label
  • labelColor
  • labelSize
  • labelFont
  • labelOffset
  • svgStringBottom
  • svgStringTop
  • bottomBorder
  • fromScale
  • toScale

Areas

Areas will only be drawn if they have a certain size (area). This limit is specified by the parameter (not per rule!!!)

-minAreaSize=400

Areas will only be labeled if they have a certain size (area). This limit is specified by the parameter (not per rule!!!)

-minAreaLabelSize=1000

The property base=yes defines the layer where the area is drawn. Base is drawn before other elements - like houses i.e.

An area rule could be defined like this:

RULE AREA
keyvalue=landuse=residential
color=lightgray
base=yes

RULE AREA
keyvalue=landuse=cemetery
icon=icons/areaCemetery.svg

Other valid area properties:

  • keyValue
  • color
  • icon
  • base
  • svgString
  • fromScale
  • toScale

Routes

A route rule could look like this:

RULE ROUTE
type=hiking
color=blue;green;yellow
opacity=100
label=name
dash=20,20

This would draw hiking routes with alternating colors with full opacity, dashed. Routes will be labeled with name.

Other valid properties:

  • linecap
  • labelSize
  • nodeSize (for route stops)
  • fromScale
  • toScale

Notes