User:Kannix/smrender

From OpenStreetMap Wiki
Jump to navigation Jump to search

My first snippets of smrender ruleset:

CEMT (incl. bridges)

overpass sample query

  • overpass API query CEMT=* AND boat=yes AND motorboat=yes/ Nordholland (~9mb):
<osm-script>
 <union>
 <union>
  <query type="way">
    <has-kv k="CEMT"/>
    <bbox-query s="51.90" n="53.50" w="4.00" e="7.25"/>
  </query>
  <query type="way">
    <has-kv k="boat" v="yes"/>
    <bbox-query s="51.90" n="53.50" w="4.00" e="7.25"/>
  </query>
  <query type="way">
    <has-kv k="motorboat" v="yes"/>
    <bbox-query s="51.90" n="53.50" w="4.00" e="7.25"/>
  </query>
 </union>
  <recurse type="way-node"/>
 </union>
 <print  mode="meta"/>
</osm-script>

waterways-cemt-classification-smrender-ruleset (NL-color-scheme)

  • smrender ruleset:
  <!-- CEMT -->

  <way>
     <tag k='boat' v='yes'/>
     <tag k='_action_' v='draw:color=lightgrey;width=0;style=dotted'/>
  </way>

  <way>
     <tag k='motorboat' v='yes'/>
     <tag k='_action_' v='draw:color=black;width=0;style=dashed'/>
  </way>

  <way>
     <tag k='CEMT' v='0'/>
     <tag k='_action_' v='draw:color=black;width=1.1'/>
  </way>
  
  <way>
     <tag k='CEMT' v='I'/>
     <tag k='_action_' v='draw:color=#8400A8;width=1.1'/>
  </way>
  
  <way>
     <tag k='CEMT' v='II'/>
     <tag k='_action_' v='draw:color=#E600A9;width=1.1'/>
  </way>
  
  <way>
     <tag k='CEMT' v='III'/>
     <tag k='_action_' v='draw:color=#005CE6;width=1.1'/>
  </way>
  
  <way>
     <tag k='CEMT' v='IV'/>
     <tag k='_action_' v='draw:color=#AAFF00;width=1.1'/>
  </way>
  
  <way>
     <tag k='CEMT' v='Va'/>
     <tag k='_action_' v='draw:color=#4C7300;width=1.1'/>
  </way>
  
  <way>
     <tag k='CEMT' v='Vb'/>
     <tag k='_action_' v='draw:color=#73FFDF;width=1.1'/>
  </way>
  
  <way>
     <tag k='CEMT' v='VIa'/>
     <tag k='_action_' v='draw:color=#A83800;width=1.1'/>
  </way>
  
  <way>
     <tag k='CEMT' v='VIb'/>
     <tag k='_action_' v='draw:color=#9C9C9C;width=1.1'/>
  </way>
  
  <way>
     <tag k='CEMT' v='VIc'/>
     <tag k='_action_' v='draw:color=#FF5500;width=1.1'/>
  </way>
  
    <way>
     <tag k='CEMT' v='VIc'/>
     <tag k='_action_' v='draw:color=#FF5500;width=1.1'/>
  </way>

    <way>
     <tag k='CEMT' v='VII'/>
     <tag k='_action_' v='draw:color=darkred;width=1.1'/>
  </way>

OpenSeaMap-seamark:type=bridge-smrender-ruleset (overview)

<!-- Icons -->
   <node>
      <tag k='seamark:bridge:clearance_height' v=']12['/>
      <tag k='seamark:bridge:clearance_height' v='[24]'/>
      <tag k='_action_' v='img:file=icons/b_rectangle.png'/>
   </node>

   <node>
      <tag k='seamark:bridge:clearance_height' v=']8.5['/>
      <tag k='seamark:bridge:clearance_height' v='[12]'/>
      <tag k='_action_' v='img:file=icons/b_circle.png'/>
   </node>

   <node>
      <tag k='seamark:bridge:clearance_height' v=']3.4['/>
      <tag k='seamark:bridge:clearance_height' v='[8.5]'/>
      <tag k='_action_' v='img:file=icons/b_star.png'/>
   </node>

   <node>
      <tag k='seamark:bridge:clearance_height' v=']2.75['/>
      <tag k='seamark:bridge:clearance_height' v='[3.4]'/>
      <tag k='_action_' v='img:file=icons/b_square.png'/>
   </node>

   <node>
      <tag k='seamark:bridge:clearance_height' v=']2.4['/>
      <tag k='seamark:bridge:clearance_height' v='[2.75]'/>
      <tag k='_action_' v='img:file=icons/b_triangle.png'/>
   </node>

   <node>
      <tag k='seamark:bridge:clearance_height' v='[2.4]'/>
      <tag k='_action_' v='img:file=icons/b_closed.png'/>
   </node>

OpenSeaMap-seamark:type=bridge-smrender-ruleset (detail)

 <!-- Heights -->
  <!-- Fixed Bridges -->
   <node>
      <tag k='seamark:bridge:clearance_height' v=''/>
      <tag k='_action_' v='strfmt:format=fxd_%s;addtag=fxd_height_string;key=seamark:bridge:clearance_height'/>
   </node>
   <node>
      <tag k='seamark:bridge:clearance_height' v=''/>
      <tag k='_action_' v='cap:font=sans-serif;size=3;key=fxd_height_string'/>
   </node>

  <!-- Opening Bridges -->
   <node>
      <tag k='seamark:bridge:clearance_height_closed' v=''/>
      <tag k='~seamark:bridge:clearance_height_open~' v=''/>
      <tag k='_action_' v='strfmt:format=opn_%s/-;addtag=opn_height_string;key=seamark:bridge:clearance_height_closed'/>
   </node>
   <node>
      <tag k='seamark:bridge:clearance_height_closed' v=''/>
      <tag k='~seamark:bridge:clearance_height_open~' v=''/>
      <tag k='_action_' v='cap:font=sans-serif;size=3;key=opn_height_string'/>
   </node>

  <!-- Lifting Bridges -->
   <node>
      <tag k='seamark:bridge:clearance_height_closed' v=''/>
      <tag k='seamark:bridge:clearance_height_open' v=''/>
      <tag k='_action_' v='strfmt:format=lft_%s/%s;addtag=lft_height_string;key=seamark:bridge:clearance_height_closed;key=seamark:bridge:clearance_height_open'/>
   </node>
   <node>
      <tag k='seamark:bridge:clearance_height_closed' v=''/>
      <tag k='seamark:bridge:clearance_height_open' v=''/>
      <tag k='_action_' v='cap:font=sans-serif;size=3;key=lft_height_string'/>
   </node>

CEVNI notice marks

overpass sample query

  <osm-script>
    <query type="node">
      <has-kv k="seamark:type" v="notice"/>
      <bbox-query s="50.90" n="53.80" w="3.00" e="7.36"/>
    </query>
   <print  mode="meta"/>
  </osm-script>

waterways-CEVNI-smrender-ruleset

  • pretty useless since most icons will overlap ;-) but maybe a starting point ...
  <!-- CEVNI -->
  <node><tag k='seamark:notice:category' v='no_entry'/><tag k='_action_' v='img:file=icons/Notice_A1.png'/></node>
  <node><tag k='seamark:notice:category' v='closed_area'/><tag k='_action_' v='img:file=icons/Notice_A1a.png'/></node>
  <node><tag k='seamark:notice:category' v='no_overtaking'/><tag k='_action_' v='img:file=icons/Notice_A2.png'/></node>
  <node><tag k='seamark:notice:category' v='no_convoy_overtaking'/><tag k='_action_' v='img:file=icons/Notice_A3.png'/></node>
  <node><tag k='seamark:notice:category' v='no_passing'/><tag k='_action_' v='img:file=icons/Notice_A4.png'/></node>
  <node><tag k='seamark:notice:category' v='no_convoy_passing'/><tag k='_action_' v='img:file=icons/Notice_A4_1.png'/></node>
  <node><tag k='seamark:notice:category' v='no_berthing'/><tag k='_action_' v='img:file=icons/Notice_A5.png'/></node>
  <node><tag k='seamark:notice:category' v='no_berthing_lateral_limit'/><tag k='_action_' v='img:file=icons/Notice_A5_1.png'/></node>
  <node><tag k='seamark:notice:category' v='no_anchoring'/><tag k='_action_' v='img:file=icons/Notice_A6.png'/></node>
  <node><tag k='seamark:notice:category' v='no_mooring'/><tag k='_action_' v='img:file=icons/Notice_A7.png'/></node>
  <node><tag k='seamark:notice:category' v='no_turning'/><tag k='_action_' v='img:file=icons/Notice_A8.png'/></node>
  <node><tag k='seamark:notice:category' v='no_wash'/><tag k='_action_' v='img:file=icons/Notice_A9.png'/></node>
  <node><tag k='seamark:notice:category' v='no_passage_left'/><tag k='_action_' v='img:file=icons/Notice_A10a.png'/></node>
  <node><tag k='seamark:notice:category' v='no_passage_right'/><tag k='_action_' v='img:file=icons/Notice_A10b.png'/></node>
  <node><tag k='seamark:notice:category' v='no_motor_craft'/><tag k='_action_' v='img:file=icons/Notice_A12.png'/></node>
  <node><tag k='seamark:notice:category' v='no_sport_craft'/><tag k='_action_' v='img:file=icons/Notice_A13.png'/></node>
  <node><tag k='seamark:notice:category' v='no_waterskiing'/><tag k='_action_' v='img:file=icons/Notice_A14.png'/></node>
  <node><tag k='seamark:notice:category' v='no_sailing_craft'/><tag k='_action_' v='img:file=icons/Notice_A15.png'/></node>
  <node><tag k='seamark:notice:category' v='no_unpowered_craft'/><tag k='_action_' v='img:file=icons/Notice_A16.png'/></node>
  <node><tag k='seamark:notice:category' v='no_sailboards'/><tag k='_action_' v='img:file=icons/Notice_A17.png'/></node>
  <node><tag k='seamark:notice:category' v='no_high_speeds'/><tag k='_action_' v='img:file=icons/Notice_A18.png'/></node>
  <node><tag k='seamark:notice:category' v='no_launching_beaching'/><tag k='_action_' v='img:file=icons/Notice_A19.png'/></node>
  <node><tag k='seamark:notice:category' v='no_waterbikes'/><tag k='_action_' v='img:file=icons/Notice_A20.png'/></node>
  <node><tag k='seamark:notice:category' v='move_to_left'/><tag k='_action_' v='img:file=icons/Notice_B1a.png'/></node>
  <node><tag k='seamark:notice:category' v='move_to_right'/><tag k='_action_' v='img:file=icons/Notice_B1b.png'/></node>
  <node><tag k='seamark:notice:category' v='move_to_port'/><tag k='_action_' v='img:file=icons/Notice_B2a.png'/></node>
  <node><tag k='seamark:notice:category' v='move_to_starboard'/><tag k='_action_' v='img:file=icons/Notice_B2b.png'/></node>
  <node><tag k='seamark:notice:category' v='keep_to_port'/><tag k='_action_' v='img:file=icons/Notice_B3a.png'/></node>
  <node><tag k='seamark:notice:category' v='keep_to_starboard'/><tag k='_action_' v='img:file=icons/Notice_B3b.png'/></node>
  <node><tag k='seamark:notice:category' v='cross_to_port'/><tag k='_action_' v='img:file=icons/Notice_B4a.png'/></node>
  <node><tag k='seamark:notice:category' v='cross_to_starboard'/><tag k='_action_' v='img:file=icons/Notice_B4b.png'/></node>
  <node><tag k='seamark:notice:category' v='stop'/><tag k='_action_' v='img:file=icons/Notice_B5.png'/></node>
  <node><tag k='seamark:notice:category' v='speed_limit'/><tag k='_action_' v='img:file=icons/Notice_B6.png'/></node>
  <node><tag k='seamark:notice:category' v='sound_horn'/><tag k='_action_' v='img:file=icons/Notice_B7.png'/></node>
  <node><tag k='seamark:notice:category' v='keep_lookout'/><tag k='_action_' v='img:file=icons/Notice_B8.png'/></node>
  <node><tag k='seamark:notice:category' v='give_way_junction'/><tag k='_action_' v='img:file=icons/Notice_B9a.png'/></node>
  <node><tag k='seamark:notice:category' v='give_way_crossing'/><tag k='_action_' v='img:file=icons/Notice_B9b.png'/></node>
  <node><tag k='seamark:notice:category' v='make_radio_contact'/><tag k='_action_' v='img:file=icons/Notice_B11.png'/></node>
  <node><tag k='seamark:notice:category' v='limited_depth'/><tag k='_action_' v='img:file=icons/Notice_C1.png'/></node>
  <node><tag k='seamark:notice:category' v='limited_headroom'/><tag k='_action_' v='img:file=icons/Notice_C2.png'/></node>
  <node><tag k='seamark:notice:category' v='limited_width'/><tag k='_action_' v='img:file=icons/Notice_C3.png'/></node>
  <node><tag k='seamark:notice:category' v='navigation_restrictions'/><tag k='_action_' v='img:file=icons/Notice_C4.png'/></node>
  <node><tag k='seamark:notice:category' v='channel_distance_left'/><tag k='_action_' v='img:file=icons/Notice_C5a.png'/></node>
  <node><tag k='seamark:notice:category' v='channel_distance_right'/><tag k='_action_' v='img:file=icons/Notice_C5b.png'/></node>
  <node><tag k='seamark:notice:category' v='channel_two_way'/><tag k='_action_' v='img:file=icons/Notice_D1a.png'/></node>
  <node><tag k='seamark:notice:category' v='channel_one_way'/><tag k='_action_' v='img:file=icons/Notice_D1b.png'/></node>
  <node><tag k='seamark:notice:category' v='opening_to_right'/><tag k='_action_' v='img:file=icons/Notice_D2a.png'/></node>
  <node><tag k='seamark:notice:category' v='opening_to_left'/><tag k='_action_' v='img:file=icons/Notice_D2b.png'/></node>
  <node><tag k='seamark:notice:category' v='proceed_to_left'/><tag k='_action_' v='img:file=icons/Notice_D3a.png'/></node>
  <node><tag k='seamark:notice:category' v='proceed_to_right'/><tag k='_action_' v='img:file=icons/Notice_D3b.png'/></node>
  <node><tag k='seamark:notice:category' v='entry_permitted'/><tag k='_action_' v='img:file=icons/Notice_E1.png'/></node>
  <node><tag k='seamark:notice:category' v='overhead_cable'/><tag k='_action_' v='img:file=icons/Notice_E2.png'/></node>
  <node><tag k='seamark:notice:category' v='weir'/><tag k='_action_' v='img:file=icons/Notice_E3.png'/></node>
  <node><tag k='seamark:notice:category' v='ferry_non_independent'/><tag k='_action_' v='img:file=icons/Notice_E4a.png'/></node>
  <node><tag k='seamark:notice:category' v='ferry_independent'/><tag k='_action_' v='img:file=icons/Notice_E4b.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_permitted'/><tag k='_action_' v='img:file=icons/Notice_E5.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_lateral_limit'/><tag k='_action_' v='img:file=icons/Notice_E5_1.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_lateral_limits'/><tag k='_action_' v='img:file=icons/Notice_E5_2.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_rafting_limit'/><tag k='_action_' v='img:file=icons/Notice_E5_3.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_unmarked_pushing'/><tag k='_action_' v='img:file=icons/Notice_E5_4.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_marked_pushing_1'/><tag k='_action_' v='img:file=icons/Notice_E5_5.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_marked_pushing_2'/><tag k='_action_' v='img:file=icons/Notice_E5_6.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_marked_pushing_3'/><tag k='_action_' v='img:file=icons/Notice_E5_7.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_unmarked_non_pushing'/><tag k='_action_' v='img:file=icons/Notice_E5_8.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_marked_non_pushing_1'/><tag k='_action_' v='img:file=icons/Notice_E5_9.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_marked_non_pushing_2'/><tag k='_action_' v='img:file=icons/Notice_E5_10.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_marked_non_pushing_3'/><tag k='_action_' v='img:file=icons/Notice_E5_11.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_unmarked'/><tag k='_action_' v='img:file=icons/Notice_E5_12.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_marked_1'/><tag k='_action_' v='img:file=icons/Notice_E5_13.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_marked_2'/><tag k='_action_' v='img:file=icons/Notice_E5_14.png'/></node>
  <node><tag k='seamark:notice:category' v='berthing_marked_3'/><tag k='_action_' v='img:file=icons/Notice_E5_15.png'/></node>
  <node><tag k='seamark:notice:category' v='anchoring_permitted'/><tag k='_action_' v='img:file=icons/Notice_E6.png'/></node>
  <node><tag k='seamark:notice:category' v='mooring_permitted'/><tag k='_action_' v='img:file=icons/Notice_E7.png'/></node>
  <node><tag k='seamark:notice:category' v='vehicle_loading_berth'/><tag k='_action_' v='img:file=icons/Notice_E7_1.png'/></node>
  <node><tag k='seamark:notice:category' v='turning_area'/><tag k='_action_' v='img:file=icons/Notice_E8.png'/></node>
  <node><tag k='seamark:notice:category' v='secondary_waterway_crossing'/><tag k='_action_' v='img:file=icons/Notice_E9a.png'/></node>
  <node><tag k='seamark:notice:category' v='secondary_waterway_right'/><tag k='_action_' v='img:file=icons/Notice_E9b.png'/></node>
  <node><tag k='seamark:notice:category' v='secondary_waterway_left'/><tag k='_action_' v='img:file=icons/Notice_E9c.png'/></node>
  <node><tag k='seamark:notice:category' v='main_waterway_right_secondary_ahead'/><tag k='_action_' v='img:file=icons/Notice_E9d.png'/></node>
  <node><tag k='seamark:notice:category' v='main_waterway_left_secondary_ahead'/><tag k='_action_' v='img:file=icons/Notice_E9e.png'/></node>
  <node><tag k='seamark:notice:category' v='main_waterway_right_secondary_left'/><tag k='_action_' v='img:file=icons/Notice_E9f.png'/></node>
  <node><tag k='seamark:notice:category' v='main_waterway_left_secondary_right'/><tag k='_action_' v='img:file=icons/Notice_E9g.png'/></node>
  <node><tag k='seamark:notice:category' v='main_waterway_right_secondary_ahead_left'/><tag k='_action_' v='img:file=icons/Notice_E9h.png'/></node>
  <node><tag k='seamark:notice:category' v='main_waterway_left_secondary_ahead_right'/><tag k='_action_' v='img:file=icons/Notice_E9i.png'/></node>
  <node><tag k='seamark:notice:category' v='main_waterway_crossing'/><tag k='_action_' v='img:file=icons/Notice_E10a.png'/></node>
  <node><tag k='seamark:notice:category' v='main_waterway_junction'/><tag k='_action_' v='img:file=icons/Notice_E10b.png'/></node>
  <node><tag k='seamark:notice:category' v='main_waterway_ahead_right'/><tag k='_action_' v='img:file=icons/Notice_E10c.png'/></node>
  <node><tag k='seamark:notice:category' v='main_waterway_ahead_left'/><tag k='_action_' v='img:file=icons/Notice_E10d.png'/></node>
  <node><tag k='seamark:notice:category' v='main_waterway_ahead_right_secondary_left'/><tag k='_action_' v='img:file=icons/Notice_E10e.png'/></node>
  <node><tag k='seamark:notice:category' v='main_waterway_ahead_left_secondary_right'/><tag k='_action_' v='img:file=icons/Notice_E10f.png'/></node>
  <node><tag k='seamark:notice:category' v='prohibition_ends'/><tag k='_action_' v='img:file=icons/Notice_E11.png'/></node>
  <node><tag k='seamark:notice:category' v='drinking_water'/><tag k='_action_' v='img:file=icons/Notice_E13.png'/></node>
  <node><tag k='seamark:notice:category' v='telephone'/><tag k='_action_' v='img:file=icons/Notice_E14.png'/></node>
  <node><tag k='seamark:notice:category' v='motor_craft_permitted'/><tag k='_action_' v='img:file=icons/Notice_E15.png'/></node>
  <node><tag k='seamark:notice:category' v='sport_craft_permitted'/><tag k='_action_' v='img:file=icons/Notice_E16.png'/></node>
  <node><tag k='seamark:notice:category' v='waterskiing_permitted'/><tag k='_action_' v='img:file=icons/Notice_E17.png'/></node>
  <node><tag k='seamark:notice:category' v='sailing_craft_permitted'/><tag k='_action_' v='img:file=icons/Notice_E18.png'/></node>
  <node><tag k='seamark:notice:category' v='unpowered_craft_permitted'/><tag k='_action_' v='img:file=icons/Notice_E19.png'/></node>
  <node><tag k='seamark:notice:category' v='sailboards_permitted'/><tag k='_action_' v='img:file=icons/Notice_E20.png'/></node>
  <node><tag k='seamark:notice:category' v='high_speeds_permitted'/><tag k='_action_' v='img:file=icons/Notice_E21.png'/></node>
  <node><tag k='seamark:notice:category' v='launching_beaching_permitted'/><tag k='_action_' v='img:file=icons/Notice_E22.png'/></node>
  <node><tag k='seamark:notice:category' v='radio_information'/><tag k='_action_' v='img:file=icons/Notice_E23.png'/></node>
  <node><tag k='seamark:notice:category' v='waterbikes_permitted'/><tag k='_action_' v='img:file=icons/Notice_E24.png'/></node>

basemap

overpass sample query

  • overpass API query natural=coastline/ Holland (~160kb):
  • ~12MB
  <osm-script>
   <union>
     <query type="way">
      <has-kv k="natural" v="coastline"/>
      <bbox-query s="50.90" n="53.80" w="3.00" e="7.36"/>
     </query>
    <recurse type="way-node"/>
   </union>
   <print  mode="meta"/>
  </osm-script>

simple-basemap-smrender-ruleset

  <!-- coastline -->
   <way>
      <tag k='natural' v='coastline'/>
      <tag k='_action_' v='refine_poly'/>
   </way>

   <way>
      <tag k='natural' v='coastline'/>
      <tag k='_action_' v='cat_poly'/>
   </way>

   <way>
      <tag k='natural' v='coastline'/>
      <tag k='_action_' v='draw:color=#EEF2BB;bcolor=blue;directional=1'/>
   </way>

  <!-- water -->
   <relation>
      <tag k='natural' v='water'/>
      <tag k='type' v='multipolygon'/>
      <tag k='_action_' v='cat_poly:no_corner=1'/>
   </relation>

   <way>
      <tag k='natural' v='water'/>
      <tag k='_action_' v='draw:color=skyblue'/>
   </way>