Changeset 13771 in josm
- Timestamp:
- 2018-05-15T22:03:37+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/SyncEditorLayerIndex.groovy
r13768 r13771 328 328 def shapes = "" 329 329 def sep = "\n " 330 for(def s: getShapes(e)) { 331 shapes += " <shape>" 332 def i = 0 333 for(def p: s.getPoints()) { 334 def lat = p.getLat() 335 def lon = p.getLon() 336 if(lat > maxlat) maxlat = lat 337 if(lon > maxlon) maxlon = lon 338 if(lat < minlat) minlat = lat 339 if(lon < minlon) minlon = lon 340 if(!(i++%3)) { 341 shapes += sep + " " 342 } 343 shapes += "<point lat='${df.format(lat)}' lon='${df.format(lon)}'/>" 344 } 345 shapes += sep + "</shape>\n" 330 try { 331 for(def s: getShapes(e)) { 332 shapes += " <shape>" 333 def i = 0 334 for(def p: s.getPoints()) { 335 def lat = p.getLat() 336 def lon = p.getLon() 337 if(lat > maxlat) maxlat = lat 338 if(lon > maxlon) maxlon = lon 339 if(lat < minlat) minlat = lat 340 if(lon < minlon) minlon = lon 341 if(!(i++%3)) { 342 shapes += sep + " " 343 } 344 shapes += "<point lat='${df.format(lat)}' lon='${df.format(lon)}'/>" 345 } 346 shapes += sep + "</shape>\n" 347 } 348 } catch(IllegalArgumentException) { 346 349 } 347 350 if(shapes) { … … 696 699 def e = eliUrls.get(url) 697 700 def num = 1 698 def s = getShapes(e) 699 for (def shape : s) { 700 def p = shape.getPoints() 701 if(!p[0].equals(p[p.size()-1]) && !options.nomissingeli) { 702 myprintln "+++ ELI shape $num unclosed: ${getDescription(e)}" 703 } 704 for (def nump = 1; nump < p.size(); ++nump) { 705 if (p[nump-1] == p[nump]) { 706 myprintln "+++ ELI shape $num double point at ${nump-1}: ${getDescription(e)}" 707 } 708 } 709 ++num 701 def s 702 try { 703 s = getShapes(e) 704 for (def shape : s) { 705 def p = shape.getPoints() 706 if(!p[0].equals(p[p.size()-1]) && !options.nomissingeli) { 707 myprintln "+++ ELI shape $num unclosed: ${getDescription(e)}" 708 } 709 for (def nump = 1; nump < p.size(); ++nump) { 710 if (p[nump-1] == p[nump]) { 711 myprintln "+++ ELI shape $num double point at ${nump-1}: ${getDescription(e)}" 712 } 713 } 714 ++num 715 } 716 } catch(IllegalArgumentException err) { 717 def desc = getDescription(e) 718 myprintln("* Invalid data in ELI geometry for $desc: ${err.getMessage()}") 710 719 } 711 720 if (!josmUrls.containsKey(url)) { … … 735 744 def ept = ep[nump] 736 745 def jpt = jp[nump] 737 if(Math.abs(ept.getLat()-jpt.getLat()) > 0.0000 01 || Math.abs(ept.getLon()-jpt.getLon()) > 0.000001) {746 if(Math.abs(ept.getLat()-jpt.getLat()) > 0.00001 || Math.abs(ept.getLon()-jpt.getLon()) > 0.00001) { 738 747 myprintln "* Different coordinate for point ${nump+1} of shape ${nums+1}: ${getDescription(j)}" 739 748 nump = ep.size()
Note:
See TracChangeset
for help on using the changeset viewer.