diff --git a/data/tags.yml b/data/tags.yml index a667bd6..f65ff51 100644 --- a/data/tags.yml +++ b/data/tags.yml @@ -107,6 +107,8 @@ tags: icon: [fire_hydrant] - tags: {highway: street_lamp} icon: [street_lamp] + - tags: {man_made: cross} + icon: [cross] - tags: {man_made: pole} icon: [pole] - tags: {power: pole} @@ -153,6 +155,15 @@ tags: - tags: {vending: water} add_icon: [vending_drop] + # Sea + + - tags: {buoy: "*"} + icon: [buoy] + - tags: {"seamark:type": "*"} + icon: [buoy] + - tags: {"waterway:sign": "*"} + icon: [buoy] + # Leisure - tags: {leisure: playground} @@ -290,12 +301,12 @@ tags: # Place of worship - tags: {amenity: place_of_worship, religion: christian} - icon: [christian] + icon: [cross] - tags: amenity: place_of_worship religion: christian denomination: catholic - icon: [christian] + icon: [cross] - tags: amenity: place_of_worship religion: christian @@ -443,7 +454,7 @@ tags: network: London Underground icon: [tfl] - tags: {railway: level_crossing} - icon: [cross] + icon: [x] - tags: {bus: "yes"} add_icon: [bus] - tags: {trolleybus: "yes"} @@ -880,7 +891,7 @@ ways: - tags: {boundary: "*"} stroke: boundary_color - stroke-width: 1 + stroke-width: 0.3 stroke-dasharray: 10,5 layer: 60 diff --git a/doc/grid.png b/doc/grid.png index 27fa7ff..b8d7a7f 100644 Binary files a/doc/grid.png and b/doc/grid.png differ diff --git a/doc/viewpoints.png b/doc/viewpoints.png new file mode 100644 index 0000000..214ed0d Binary files /dev/null and b/doc/viewpoints.png differ diff --git a/icons/icons.svg b/icons/icons.svg index 21b8f43..256c049 100644 --- a/icons/icons.svg +++ b/icons/icons.svg @@ -9,7 +9,7 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" sodipodi:docname="icons.svg" - inkscape:version="1.0beta1 (32d4812, 2019-09-19)" + inkscape:version="0.91 r13725" version="1.1" id="svg2987" height="600px" @@ -136,20 +136,20 @@ inkscape:snap-smooth-nodes="true" inkscape:snap-intersection-paths="true" inkscape:object-nodes="true" - inkscape:window-maximized="0" + inkscape:window-maximized="1" inkscape:window-y="0" inkscape:window-x="0" - inkscape:window-height="1080" - inkscape:window-width="1920" + inkscape:window-height="856" + inkscape:window-width="1440" inkscape:snap-bbox="true" inkscape:object-paths="true" inkscape:guide-bbox="true" showguides="false" - showgrid="false" + showgrid="true" inkscape:document-units="px" inkscape:current-layer="layer1" - inkscape:cy="330.63389" - inkscape:cx="37.476565" + inkscape:cy="360.75952" + inkscape:cx="218.66343" inkscape:zoom="8" inkscape:pageshadow="2" inkscape:pageopacity="0.0" @@ -529,7 +529,7 @@ image/svg+xml - + @@ -2287,7 +2287,7 @@ + d="m 3,322 2,0 1,1 -1,1 -2,0 1,1 2,0 1,-1 6,0 0,-2 -6,0 -1,-1 -2,0 z" + style="fill:none;stroke:#000000;stroke-width:0.1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:nodetypes="cccccccccccccc" /> + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccccccccc" /> + id="bicycle_repair" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccccsssccccccccccccssssssccccssscccccssssssssssssssssssss" /> + id="car_repair" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccccsssccccccccccsccsccccccccssssssssss" /> + + + + + + diff --git a/readme.md b/readme.md index ea4a9d7..87d765e 100644 --- a/readme.md +++ b/readme.md @@ -3,7 +3,8 @@ * set of icons, * and map styles. -[![Build Status](https://travis-ci.org/enzet/Roentgen.svg?branch=master)](https://travis-ci.org/enzet/Roentgen) +[![Build Status](https://travis-ci.org/enzet/Roentgen.svg?branch=master) +](https://travis-ci.org/enzet/Roentgen) The idea behind Röntgen project is to have a possibility to display every OpenStreetMap data tag on the map. Suppose, you spent time adding colors for @@ -18,7 +19,7 @@ Map elements ### 3D buildings ### -Simple shapes for walls, shade, and roof. +Simple shapes for walls and shade in proportion to `building:levels` value. ![3D buildings](doc/buildings.png) @@ -28,6 +29,12 @@ Tree leaf types, leaf cycles, and genes. ![Trees](doc/trees.png) +### Viewpoint direction ### + +Visualize `direction` tag for `tourism=viewpoint`. + +![Trees](doc/viewpoints.png) + Icon set -------- diff --git a/roentgen/constructor.py b/roentgen/constructor.py index fccb67c..01d8fb9 100644 --- a/roentgen/constructor.py +++ b/roentgen/constructor.py @@ -11,6 +11,8 @@ from roentgen.flinger import Geo, GeoFlinger from roentgen.osm_reader import OSMMember, OSMRelation, OSMWay from roentgen.scheme import IconSet, Scheme +DEBUG: bool = False + class Node: """ @@ -79,7 +81,7 @@ def get_user_color(text: str, seed: str): Generate random color based on text. """ if text == "": - return "000000" + return "#000000" rgb = sha256((seed + text).encode("utf-8")).hexdigest()[-6:] r = int(rgb[0:2], 16) g = int(rgb[2:4], 16) @@ -90,7 +92,7 @@ def get_user_color(text: str, seed: str): g = g * (1 - cc) + c * cc b = b * (1 - cc) + c * cc h = hex(int(r))[2:] + hex(int(g))[2:] + hex(int(b))[2:] - return "0" * (6 - len(h)) + h + return "#" + "0" * (6 - len(h)) + h def get_time_color(time): @@ -98,7 +100,7 @@ def get_time_color(time): Generate color based on time. """ if not time: - return "000000" + return "#000000" time = datetime.strptime(time, "%Y-%m-%dT%H:%M:%SZ") delta = (datetime.now() - time).total_seconds() time_color = hex(0xFF - min(0xFF, int(delta / 500000.)))[2:] @@ -107,7 +109,7 @@ def get_time_color(time): time_color = "0" + time_color if len(i_time_color) == 1: i_time_color = "0" + i_time_color - return time_color + "AA" + i_time_color + return "#" + time_color + "AA" + i_time_color def glue(ways: List[OSMWay]): @@ -226,7 +228,7 @@ class Constructor: user_color = get_user_color(way.user, self.seed) self.ways.append( Way("way", nodes, path, - {"fill": "none", "stroke": "#" + user_color, + {"fill": "none", "stroke": user_color, "stroke-width": 1})) return @@ -236,7 +238,7 @@ class Constructor: time_color = get_time_color(way.timestamp) self.ways.append( Way("way", nodes, path, - {"fill": "none", "stroke": "#" + time_color, + {"fill": "none", "stroke": time_color, "stroke-width": 1})) return @@ -288,8 +290,7 @@ class Constructor: icon_set, tags, center_point, path, is_for_node=False)) appended = True - """ - if not appended: + if not appended and DEBUG: style: Dict[str, Any] = { "fill": "none", "stroke": "#FF0000", "stroke-width": 1} self.ways.append(Way(kind, nodes, path, style, layer, 50, levels)) @@ -298,7 +299,6 @@ class Constructor: icon_set: IconSet = self.scheme.get_icon(tags) self.nodes.append(Node( icon_set, tags, center_point, path, is_for_node=False)) - """ def construct_relations(self) -> None: """ diff --git a/roentgen/mapper.py b/roentgen/mapper.py index f07ca6a..4cadcbb 100644 --- a/roentgen/mapper.py +++ b/roentgen/mapper.py @@ -357,7 +357,7 @@ class Painter: DIRECTION_RADIUS: int = 50 DIRECTION_COLOR: str = self.scheme.get_color("direction_color") - for d in DirectionSet(node.tags["direction"])\ + for path in DirectionSet(node.tags["direction"])\ .draw(node.point, DIRECTION_RADIUS): gradient = self.svg.defs.add(self.svg.radialGradient( center=node.point, r=DIRECTION_RADIUS, @@ -366,7 +366,7 @@ class Painter: .add_stop_color(0, DIRECTION_COLOR, opacity=0)\ .add_stop_color(1, DIRECTION_COLOR, opacity=0.7) self.svg.add(self.svg.path( - d=["M", node.point] + d + ["L", node.point, "Z"], + d=["M", node.point] + path + ["L", node.point, "Z"], fill=gradient.get_paint_server())) # All other nodes