Changeset 11854 in josm for trunk/scripts
- Timestamp:
- 2017-04-08T01:32:47+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/SyncEditorLayerIndex.groovy
r11694 r11854 1 1 // License: GPL. For details, see LICENSE file. 2 2 /** 3 * Compare and analyse the differences of the editor imageryindex and the JOSM imagery list.3 * Compare and analyse the differences of the editor layer index and the JOSM imagery list. 4 4 * The goal is to keep both lists in sync. 5 5 * 6 * The editor imageryindex project (https://github.com/osmlab/editor-imagery-index)6 * The editor layer index project (https://github.com/osmlab/editor-layer-index) 7 7 * provides also a version in the JOSM format, but the GEOJSON is the original source 8 8 * format, so we read that. … … 13 13 * Main JOSM binary needs to be in classpath, e.g. 14 14 * 15 * $ groovy -cp ../dist/josm-custom.jar SyncEditor ImageryIndex.groovy15 * $ groovy -cp ../dist/josm-custom.jar SyncEditorLayerIndex.groovy 16 16 * 17 17 * Add option "-h" to show the available command line flags. … … 21 21 import javax.json.JsonObject 22 22 import javax.json.JsonReader 23 import javax.json.JsonValue24 23 25 24 import org.openstreetmap.josm.data.imagery.ImageryInfo … … 27 26 import org.openstreetmap.josm.io.imagery.ImageryReader 28 27 29 class SyncEditor ImageryIndex {28 class SyncEditorLayerIndex { 30 29 31 30 List<ImageryInfo> josmEntries; … … 50 49 static main(def args) { 51 50 parse_command_line_arguments(args) 52 def script = new SyncEditor ImageryIndex()51 def script = new SyncEditorLayerIndex() 53 52 script.loadSkip() 54 53 script.start() … … 72 71 def cli = new CliBuilder(width: 160) 73 72 cli.o(longOpt:'output', args:1, argName: "output", "Output file, - prints to stdout (default: -)") 74 cli.e(longOpt:'eli_input', args:1, argName:"eli_input", "Input file for the editor imageryindex (geojson). Default is $eliInputFile (current directory).")73 cli.e(longOpt:'eli_input', args:1, argName:"eli_input", "Input file for the editor layer index (geojson). Default is $eliInputFile (current directory).") 75 74 cli.j(longOpt:'josm_input', args:1, argName:"josm_input", "Input file for the JOSM imagery list (xml). Default is $josmInputFile (current directory).") 76 75 cli.i(longOpt:'ignore_input', args:1, argName:"ignore_input", "Input file for the ignore list. Default is $ignoreInputFile (current directory).") … … 79 78 cli.x(longOpt:'xhtmlbody', argName:"xhtmlbody", "create XHTML body for display in a web page") 80 79 cli.X(longOpt:'xhtml', argName:"xhtml", "create XHTML for display in a web page") 81 cli.m(longOpt:'nomissingeli', argName:"nomissingeli", "don't show missing editor imageryindex entries")80 cli.m(longOpt:'nomissingeli', argName:"nomissingeli", "don't show missing editor layer index entries") 82 81 cli.h(longOpt:'help', "show this help") 83 82 options = cli.parse(args) … … 498 497 static Date verifyDate(String year, String month, String day) { 499 498 def date 500 if(year == null) 499 if(year == null) { 501 500 date = "3000-01-01" 502 else501 } else { 503 502 date = year + "-" + (month == null ? "01" : month) + "-" + (day == null ? "01" : day) 503 } 504 504 def df = new java.text.SimpleDateFormat("yyyy-MM-dd") 505 505 df.setLenient(false)
Note:
See TracChangeset
for help on using the changeset viewer.