Changes between Version 13 and Version 14 of Help/Plugin/Scripting
- Timestamp:
- 2016-04-27T23:05:15+02:00 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Help/Plugin/Scripting
v13 v14 1 1 [[TranslatedPages]] 2 = Plugin ->Scripting =2 = Scripting = 3 3 4 4 [[PageOutline(2-4,,inline)]] 5 5 6 6 7 == In a nutshell==8 The [https://gubaer.github.io/josm-scripting-plugin scripting plugin] allows you to run scripts within JOSM.7 == Purpose == 8 Use it to automate small tasks for which no any existing plugin can do i.e. 9 9 10 Use it to automate small tasks for which no dedicated plugin is available, i.e.11 10 * additional quality tests for which no validator test cases are available 12 11 * automatically entering data in very specific situations (i.e. sequences of house numbers) 13 12 * importing from a custom file format not supported by JOSM 14 13 * exporting to a custom file format not supported by JOSM 14 15 == How to execute scripts == 16 17 The [https://gubaer.github.io/josm-scripting-plugin scripting plugin] allows you to run scripts within JOSM. 18 19 == How to write your own scripts == 20 21 22 23 == Implementations details == 15 24 16 25 The plugin includes a embedded scripting engine for Javascript based on Mozilla Rhino and a … … 20 29 Please refer to the [https://gubaer.github.io/josm-scripting-plugin/doc/documentation.html plugin documentation] for more information and find the source on [https://github.com/gubaer/josm-scripting-plugin GitHub]. 21 30 31 == Scripts == 32 === Scripts in JavaScript === 22 33 23 == Example scripts in Python == 24 Here are some more examples: 25 * [wiki:Help/Plugin/Scripting/Python]\\ 26 Various small scripts that are meant to illustrate how to do one thing. 34 * https://gist.github.com/Rub21/feb83f57a727ac0d8a34 - Expand abbreviations (US) 35 * https://gist.github.com/Rub21/47838797856566a8b6ba - Capitalize names and eliminate "name=S/N" 36 * https://gist.github.com/Rub21/cc055320c925c855926e - expand abbreviations (Peru); [https://www.youtube.com/watch?v=Cpi_5dB1NLQ video demonstration] 27 37 28 * [wiki:Help/Plugin/Scripting/Python/SurfaceTypesOfRoutes] (Interesting for cycle routes, both loops and linear ones)\\ 29 Short piece of code, but illustrates some interesting concepts and reports on OSM data. Doesn't make changes to the data 38 === Scripts in Python === 30 39 31 * [wiki:Help/Plugin/Scripting/Python/RCN_Route_Validator]\\ 32 This is not a trivial script anymore. It does a lot in a complicated field (networks of cycle node routes with numbered nodes), makes changes to relations, writes to a file that can be pasted to the wiki. Analyzes routes, but also networks of routes or collections of networks of routes, depending on the selection in JOSM when the script was run. 33 34 * [attachment:ticket:7991:AutoAddIntersections.py AutoAddIntersections] (needs [wiki:Plugin/UtilsPlugin2 UtilsPlugin2])\\ 35 Adds command queue listener that will perform utilsplugin2's AddNodesAtIntersections command after encountering Extrude command. (See #7991)\\ 40 * [wiki:Help/Plugin/Scripting/Python] - various small scripts that are meant to illustrate how to do one thing. 41 * [wiki:Help/Plugin/Scripting/Python/SurfaceTypesOfRoutes] - (Interesting for cycle routes, both loops and linear ones). Short piece of code, but illustrates some interesting concepts and reports on OSM data. Doesn't make changes to the data 42 * [wiki:Help/Plugin/Scripting/Python/RCN_Route_Validator] - This is not a trivial script anymore. It does a lot in a complicated field (networks of cycle node routes with numbered nodes), makes changes to relations, writes to a file that can be pasted to the wiki. Analyzes routes, but also networks of routes or collections of networks of routes, depending on the selection in JOSM when the script was run. 43 * [attachment:ticket:7991:AutoAddIntersections.py AutoAddIntersections] (needs [wiki:Plugin/UtilsPlugin2 UtilsPlugin2]) - Adds command queue listener that will perform utilsplugin2's AddNodesAtIntersections command after encountering Extrude command. (See #7991)\\ 36 44 Run once per JOSM session. 37 45 46 == See also == 47 * [wiki:/Plugins Plugin Help] 48 38 49 ---- 39 Back to [wiki:/Plugins#JOSMdocu Plugin Help][[BR]]40 50 Back to [wiki:/Help Main Help]