From 9d4fc6f6bee0bdb27c5ac816b2e6e5f2e2770b25 Mon Sep 17 00:00:00 2001 From: Ilya Zverev Date: Wed, 13 Apr 2016 17:04:44 +0300 Subject: [PATCH] Documentation for mapcss-mapping.csv --- src/libkomwm.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/libkomwm.py b/src/libkomwm.py index c4c344e..408ba1f 100644 --- a/src/libkomwm.py +++ b/src/libkomwm.py @@ -80,6 +80,27 @@ def komap_mapswithme(options): # Build classificator tree from mapcss-mapping.csv file types_file = open(os.path.join(ddir, 'types.txt'), "w") + # Mapcss-mapping format + # + # A CSV table mapping tags to types. Some types can be deemed obsolete, either completely or replaced with a different type. + # + # Example row: highway|bus_stop;[highway=bus_stop];;name;int_name;22; (mind the last semicolon!) + # It contains: + # - type name: "highway|bus_stop" ('|' is converted to '-' internally) + # - mapcss selector for tags: "[highway=bus_stop]" (you can group selectors and use e.g. [oneway?]) + # - "x" for an obsolete type or an empty cell otherwise + # - primary title tag (usually "name") + # - secondary title tag (usually "int_name") + # - type id, sequential starting from 1 + # - replacement type for an obsolete tag, if exists + # + # A shorter format for above example: highway|bus_stop;22; + # It leaves only columns 1, 6 and 7. For obsolete types with no replacement put "x" into the last column. + # Obviously it works only for simple types that are produced from tags replacing '=' with '|'. + # + # An example of type with replacement: + # highway|unsurfaced|disused;[highway=unsurfaced][disused?];x;name;int_name;838;highway|unclassified + cnt = 1 for row in csv.reader(open(os.path.join(ddir, 'mapcss-mapping.csv')), delimiter=';'): if len(row) <= 1: