Changeset 13831 in josm
- Timestamp:
- 2018-05-25T19:50:34+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/SyncEditorLayerIndex.groovy
r13827 r13831 22 22 import javax.json.JsonObject 23 23 import javax.json.JsonReader 24 import javax.json.JsonValue 24 25 25 26 import org.openstreetmap.josm.Main … … 989 990 return [] 990 991 } 991 if(!e.isNull("geometry")) { 992 def ex = e.get("geometry") 993 if(ex != null && !ex.isNull("coordinates")) { 994 def poly = ex.get("coordinates") 995 List<Shape> l = [] 996 for(def shapes: poly) { 997 def s = new Shape() 998 for(def point: shapes) { 999 def lon = point[0].toString() 1000 def lat = point[1].toString() 1001 s.addPoint(lat, lon) 1002 } 1003 l.add(s) 1004 } 1005 return l 1006 } 992 def ex = e.get("geometry") 993 if (ex != null && !JsonValue.NULL.equals(ex) && !ex.isNull("coordinates")) { 994 def poly = ex.get("coordinates") 995 List<Shape> l = [] 996 for(def shapes: poly) { 997 def s = new Shape() 998 for(def point: shapes) { 999 def lon = point[0].toString() 1000 def lat = point[1].toString() 1001 s.addPoint(lat, lon) 1002 } 1003 l.add(s) 1004 } 1005 return l 1007 1006 } 1008 1007 return []
Note:
See TracChangeset
for help on using the changeset viewer.