From 208df9e6afa2005b1d2cacb80a6fd889d5b0bc8d Mon Sep 17 00:00:00 2001 From: que01 Date: Tue, 25 Aug 2026 17:56:55 +0800 Subject: [PATCH] fix: package lane arrow assets --- assets/lane-icons/manifest.json | 24 ++++ assets/lane-icons/upstream/DESIGN.md | 98 +++++++++++++++ assets/lane-icons/upstream/LICENSE.md | 118 ++++++++++++++++++ .../upstream/left-slight_left-through.svg | 1 + assets/lane-icons/upstream/left-through.svg | 1 + assets/lane-icons/upstream/left.svg | 1 + .../reverse_left-left-slight_left-through.svg | 1 + .../upstream/reverse_left-through.svg | 1 + assets/lane-icons/upstream/reverse_left.svg | 1 + .../upstream/sharp_left-through.svg | 1 + assets/lane-icons/upstream/sharp_left.svg | 1 + .../upstream/slight_left-through.svg | 1 + assets/lane-icons/upstream/slight_left.svg | 1 + assets/lane-icons/upstream/through.svg | 1 + src/compile/turn-lane-arrows.js | 2 +- 15 files changed, 252 insertions(+), 1 deletion(-) create mode 100644 assets/lane-icons/manifest.json create mode 100644 assets/lane-icons/upstream/DESIGN.md create mode 100644 assets/lane-icons/upstream/LICENSE.md create mode 100644 assets/lane-icons/upstream/left-slight_left-through.svg create mode 100644 assets/lane-icons/upstream/left-through.svg create mode 100644 assets/lane-icons/upstream/left.svg create mode 100644 assets/lane-icons/upstream/reverse_left-left-slight_left-through.svg create mode 100644 assets/lane-icons/upstream/reverse_left-through.svg create mode 100644 assets/lane-icons/upstream/reverse_left.svg create mode 100644 assets/lane-icons/upstream/sharp_left-through.svg create mode 100644 assets/lane-icons/upstream/sharp_left.svg create mode 100644 assets/lane-icons/upstream/slight_left-through.svg create mode 100644 assets/lane-icons/upstream/slight_left.svg create mode 100644 assets/lane-icons/upstream/through.svg diff --git a/assets/lane-icons/manifest.json b/assets/lane-icons/manifest.json new file mode 100644 index 0000000..c971643 --- /dev/null +++ b/assets/lane-icons/manifest.json @@ -0,0 +1,24 @@ +{ + "upstream": { + "repository": "https://github.com/openstreetmap/lane-icons", + "revision": "db3cab321da93a757c2cf3cdb4f1f1db6b1a091c", + "license": "CC0-1.0", + "license_file": "upstream/LICENSE.md" + }, + "assets": [ + {"id":"through","source":"upstream/through.svg","anchor_x":12.5,"supported":true,"tested":true,"template":"through"}, + {"id":"left","source":"upstream/left.svg","anchor_x":17,"supported":true,"tested":true,"template":"left"}, + {"id":"right","source":"upstream/left.svg","derived_from":"left","mirror_x":true,"anchor_x":17,"supported":true,"tested":true,"template":"right"}, + {"id":"through;left","source":"upstream/left-through.svg","anchor_x":17,"supported":true,"tested":true,"template":"through_left"}, + {"id":"through;right","source":"upstream/left-through.svg","derived_from":"through;left","mirror_x":true,"anchor_x":17,"supported":true,"tested":true,"template":"through_right"}, + {"id":"through;left;right","source":"upstream/left-slight_left-through.svg","derived_from":"through;left + through;right","anchor_x":17,"supported":true,"tested":true,"template":"through_left_right"}, + {"id":"slight_left","source":"upstream/slight_left.svg","supported":false,"tested":false}, + {"id":"slight_left;through","source":"upstream/slight_left-through.svg","supported":false,"tested":false}, + {"id":"left;slight_left;through","source":"upstream/left-slight_left-through.svg","supported":false,"tested":false}, + {"id":"sharp_left","source":"upstream/sharp_left.svg","supported":false,"tested":false}, + {"id":"sharp_left;through","source":"upstream/sharp_left-through.svg","supported":false,"tested":false}, + {"id":"reverse_left","source":"upstream/reverse_left.svg","supported":false,"tested":false}, + {"id":"reverse_left;through","source":"upstream/reverse_left-through.svg","supported":false,"tested":false}, + {"id":"reverse_left;left;slight_left;through","source":"upstream/reverse_left-left-slight_left-through.svg","supported":false,"tested":false} + ] +} diff --git a/assets/lane-icons/upstream/DESIGN.md b/assets/lane-icons/upstream/DESIGN.md new file mode 100644 index 0000000..7aecd3d --- /dev/null +++ b/assets/lane-icons/upstream/DESIGN.md @@ -0,0 +1,98 @@ +## Design Guidelines + +The icons in this project follow closely the design guidelines established in the +[MUTCD Standard Highway Signs guide](http://mutcd.fhwa.dot.gov/ser-shs_millennium.htm), +2009 edition published by the US Federal Highway Administration. + +The MUTCD is [in the public domain](http://mutcd.fhwa.dot.gov/knowledge/faqs/faq_general.htm#printq5) +and as such it is not copyrighted. + +Each icon should be + +* 25px x 25px +* SVG +* Single color fill +* Path outline only, no stroke +* Pixel grid aligned (where possible) + +### Arrows + +Arrows use the "Standard Arrow" described in MUTCD Standard Highway Signs +[Appendix](http://mutcd.fhwa.dot.gov/ser-shs_millennium.htm). + +An upward facing Standard Arrow is included in this icon pack, and forms the basis of all turn +lane arrows. + +Standard Arrow + + +Arrowhead rotation angles are chosen based on the turn lane indication: + + + + + + + + + + + + + + + + +
ThroughSlight LeftLeftSharp LeftReverse Left
no rotation
+ Through +
45 degrees
+ Slight Left +
70 or 90 degrees
+ Left +
135 degrees
+ Sharp Left +
180 degrees
+ Reverse Left +
+ +As the number of arrows increases, the arrows scale down: + + + + + + + + + + + + + + +
1 Arrow2 Arrows3 Arrows4 Arrows
+
  • 3px stroke
  • standard arrowhead
+ Through +
+
  • 2.5px stroke
  • 83% scaled arrowhead
+ Left, Through +
+
  • 2.25px stroke
  • 75% scaled arrowhead
+ Left, Slight Left, Through +
+
  • 2px stroke
  • 66% scaled arrowhead
+ Reverse Left, Left, Slight Left, Through +
+ + +Other important rules for arrows: +* Bottom aligned with each other, 2px from icon bottom edge +* Left-right centered +* Smooth curves, no kinks +* Arrow shaft path connects to the arrowhead anchor point + + +### Other Icons + +Other non-arrow icons (bus, hov, pedestrian, tram, etc) also imitiate the icons found +in the MUTCD Standard Highway Signs [Appendix](http://mutcd.fhwa.dot.gov/ser-shs_millennium.htm). diff --git a/assets/lane-icons/upstream/LICENSE.md b/assets/lane-icons/upstream/LICENSE.md new file mode 100644 index 0000000..f3dc09b --- /dev/null +++ b/assets/lane-icons/upstream/LICENSE.md @@ -0,0 +1,118 @@ +[![CC0-1.0](http://mirrors.creativecommons.org/presskit/buttons/88x31/svg/cc-zero.svg)](http://creativecommons.org/publicdomain/zero/1.0/) + +### CC0 1.0 Universal + +#### Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator and +subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for the +purpose of contributing to a commons of creative, cultural and scientific +works ("Commons") that the public can reliably and without fear of later +claims of infringement build upon, modify, incorporate in other works, reuse +and redistribute as freely as possible in any form whatsoever and for any +purposes, including without limitation commercial purposes. These owners may +contribute to the Commons to promote the ideal of a free culture and the +further production of creative, cultural and scientific works, or to gain +reputation or greater distribution for their Work in part through the use and +efforts of others. + +For these and/or other purposes and motivations, and without any expectation +of additional consideration or compensation, the person associating CC0 with a +Work (the "Affirmer"), to the extent that he or she is an owner of Copyright +and Related Rights in the Work, voluntarily elects to apply CC0 to the Work +and publicly distribute the Work under its terms, with knowledge of his or her +Copyright and Related Rights in the Work and the meaning and intended legal +effect of CC0 on those rights. + +**1. Copyright and Related Rights.** A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not limited +to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, communicate, + and translate a Work; + + ii. moral rights retained by the original author(s) and/or performer(s); + + iii. publicity and privacy rights pertaining to a person's image or likeness + depicted in a Work; + + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + + v. rights protecting the extraction, dissemination, use and reuse of data in + a Work; + + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation thereof, + including any amended or successor version of such directive); and + + vii. other similar, equivalent or corresponding rights throughout the world + based on applicable law or treaty, and any national implementations thereof. + +**2. Waiver.** To the greatest extent permitted by, but not in contravention of, +applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and +unconditionally waives, abandons, and surrenders all of Affirmer's Copyright +and Related Rights and associated claims and causes of action, whether now +known or unknown (including existing as well as future claims and causes of +action), in the Work (i) in all territories worldwide, (ii) for the maximum +duration provided by applicable law or treaty (including future time +extensions), (iii) in any current or future medium and for any number of +copies, and (iv) for any purpose whatsoever, including without limitation +commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes +the Waiver for the benefit of each member of the public at large and to the +detriment of Affirmer's heirs and successors, fully intending that such Waiver +shall not be subject to revocation, rescission, cancellation, termination, or +any other legal or equitable action to disrupt the quiet enjoyment of the Work +by the public as contemplated by Affirmer's express Statement of Purpose. + +**3. Public License Fallback.** Should any part of the Waiver for any reason be +judged legally invalid or ineffective under applicable law, then the Waiver +shall be preserved to the maximum extent permitted taking into account +Affirmer's express Statement of Purpose. In addition, to the extent the Waiver +is so judged Affirmer hereby grants to each affected person a royalty-free, +non transferable, non sublicensable, non exclusive, irrevocable and +unconditional license to exercise Affirmer's Copyright and Related Rights in +the Work (i) in all territories worldwide, (ii) for the maximum duration +provided by applicable law or treaty (including future time extensions), (iii) +in any current or future medium and for any number of copies, and (iv) for any +purpose whatsoever, including without limitation commercial, advertising or +promotional purposes (the "License"). The License shall be deemed effective as +of the date CC0 was applied by Affirmer to the Work. Should any part of the +License for any reason be judged legally invalid or ineffective under +applicable law, such partial invalidity or ineffectiveness shall not +invalidate the remainder of the License, and in such case Affirmer hereby +affirms that he or she will not (i) exercise any of his or her remaining +Copyright and Related Rights in the Work or (ii) assert any associated claims +and causes of action with respect to the Work, in either case contrary to +Affirmer's express Statement of Purpose. + +**4. Limitations and Disclaimers.** + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + + b. Affirmer offers the Work as-is and makes no representations or warranties + of any kind concerning the Work, express, implied, statutory or otherwise, + including without limitation warranties of title, merchantability, fitness + for a particular purpose, non infringement, or the absence of latent or + other defects, accuracy, or the present or absence of errors, whether or not + discoverable, all to the greatest extent permissible under applicable law. + + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without limitation + any person's Copyright and Related Rights in the Work. Further, Affirmer + disclaims responsibility for obtaining any necessary consents, permissions + or other rights required for any use of the Work. + + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to this + CC0 or use of the Work. + +For more information, please see + diff --git a/assets/lane-icons/upstream/left-slight_left-through.svg b/assets/lane-icons/upstream/left-slight_left-through.svg new file mode 100644 index 0000000..251770b --- /dev/null +++ b/assets/lane-icons/upstream/left-slight_left-through.svg @@ -0,0 +1 @@ +icons \ No newline at end of file diff --git a/assets/lane-icons/upstream/left-through.svg b/assets/lane-icons/upstream/left-through.svg new file mode 100644 index 0000000..69b75e9 --- /dev/null +++ b/assets/lane-icons/upstream/left-through.svg @@ -0,0 +1 @@ +icons \ No newline at end of file diff --git a/assets/lane-icons/upstream/left.svg b/assets/lane-icons/upstream/left.svg new file mode 100644 index 0000000..30005af --- /dev/null +++ b/assets/lane-icons/upstream/left.svg @@ -0,0 +1 @@ +icons \ No newline at end of file diff --git a/assets/lane-icons/upstream/reverse_left-left-slight_left-through.svg b/assets/lane-icons/upstream/reverse_left-left-slight_left-through.svg new file mode 100644 index 0000000..ce8ab98 --- /dev/null +++ b/assets/lane-icons/upstream/reverse_left-left-slight_left-through.svg @@ -0,0 +1 @@ +icons \ No newline at end of file diff --git a/assets/lane-icons/upstream/reverse_left-through.svg b/assets/lane-icons/upstream/reverse_left-through.svg new file mode 100644 index 0000000..d0c4465 --- /dev/null +++ b/assets/lane-icons/upstream/reverse_left-through.svg @@ -0,0 +1 @@ +icons \ No newline at end of file diff --git a/assets/lane-icons/upstream/reverse_left.svg b/assets/lane-icons/upstream/reverse_left.svg new file mode 100644 index 0000000..7231e01 --- /dev/null +++ b/assets/lane-icons/upstream/reverse_left.svg @@ -0,0 +1 @@ +icons \ No newline at end of file diff --git a/assets/lane-icons/upstream/sharp_left-through.svg b/assets/lane-icons/upstream/sharp_left-through.svg new file mode 100644 index 0000000..e8d5e43 --- /dev/null +++ b/assets/lane-icons/upstream/sharp_left-through.svg @@ -0,0 +1 @@ +icons \ No newline at end of file diff --git a/assets/lane-icons/upstream/sharp_left.svg b/assets/lane-icons/upstream/sharp_left.svg new file mode 100644 index 0000000..e564b70 --- /dev/null +++ b/assets/lane-icons/upstream/sharp_left.svg @@ -0,0 +1 @@ +icons \ No newline at end of file diff --git a/assets/lane-icons/upstream/slight_left-through.svg b/assets/lane-icons/upstream/slight_left-through.svg new file mode 100644 index 0000000..e8e8430 --- /dev/null +++ b/assets/lane-icons/upstream/slight_left-through.svg @@ -0,0 +1 @@ +icons \ No newline at end of file diff --git a/assets/lane-icons/upstream/slight_left.svg b/assets/lane-icons/upstream/slight_left.svg new file mode 100644 index 0000000..19906e1 --- /dev/null +++ b/assets/lane-icons/upstream/slight_left.svg @@ -0,0 +1 @@ +icons \ No newline at end of file diff --git a/assets/lane-icons/upstream/through.svg b/assets/lane-icons/upstream/through.svg new file mode 100644 index 0000000..bbdd4f6 --- /dev/null +++ b/assets/lane-icons/upstream/through.svg @@ -0,0 +1 @@ +icons \ No newline at end of file diff --git a/src/compile/turn-lane-arrows.js b/src/compile/turn-lane-arrows.js index 4230679..d6f1a3a 100644 --- a/src/compile/turn-lane-arrows.js +++ b/src/compile/turn-lane-arrows.js @@ -4,7 +4,7 @@ const fs = require("fs"); const path = require("path"); const { laneCenterline } = require("../geometry/lane-geometry"); -const ASSET_MANIFEST = path.resolve(__dirname, "..", "..", "..", "..", "assets", "lane-icons", "manifest.json"); +const ASSET_MANIFEST = path.resolve(__dirname, "..", "..", "assets", "lane-icons", "manifest.json"); const LANE_WIDTH_METERS = 3.2; const PLACEMENT_DISTANCE_METERS = 9; const SPATIAL_MATCH_MAX_DISTANCE_METERS = 18;