Changeset 6874 in osm for applications/editors/josm/plugins/lakewalker/src/org
- Timestamp:
- 2008-02-14T07:06:04+01:00 (17 years ago)
- Location:
- applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java
r6789 r6874 95 95 target += " --top=" + topLeft.lat(); 96 96 target += " --bottom=" + botRight.lat(); 97 target += " --waylength=" + Main.pref.get(LakewalkerPreferences.PREF_MAX_SEG, "500"); 97 98 target += " --maxnodes=" + Main.pref.get(LakewalkerPreferences.PREF_MAX_NODES, "50000"); 98 99 target += " --threshold=" + Main.pref.get(LakewalkerPreferences.PREF_THRESHOLD, "35"); -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPreferences.java
r6789 r6874 74 74 75 75 pythonConfig.setValue(Main.pref.get(PREF_PYTHON, "python.exe")); 76 maxSegsConfig.setValue(Main.pref.get(PREF_MAX_SEG, " 250"));76 maxSegsConfig.setValue(Main.pref.get(PREF_MAX_SEG, "500")); 77 77 maxNodesConfig.setValue(Main.pref.get(PREF_MAX_NODES, "50000")); 78 78 thresholdConfig.setValue(Main.pref.get(PREF_THRESHOLD, "35")); -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerReader.java
r6127 r6874 59 59 try { 60 60 61 Node fn = null; //new Node(new LatLon(0,0)); 61 Node n = null; // The current node being created 62 Node tn = null; // The last node of the previous way 63 Node fn = null; // Node to hold the first node in the trace 62 64 63 65 while ((line = input.readLine()) != null) { … … 70 72 case 'n': 71 73 String[] tokens = line.split(" "); 72 try { 73 LatLon ll = new LatLon(Double.parseDouble(tokens[1])+northOffset, Double.parseDouble(tokens[2])+eastOffset); 74 Node n = new Node(ll); 75 commands.add(new AddCommand(n)); 76 way.nodes.add(n); 77 if(fn==null){ 78 fn = n; 79 } 74 75 if(tn==null){ 76 try { 77 LatLon ll = new LatLon(Double.parseDouble(tokens[1])+northOffset, Double.parseDouble(tokens[2])+eastOffset); 78 n = new Node(ll); 79 if(fn==null){ 80 fn = n; 81 } 82 commands.add(new AddCommand(n)); 83 } 84 catch (Exception ex) { 85 86 } 87 88 } else { 89 // If there is a last node, and this node has the same coordinates 90 // then we substitute for the previous node 91 n = tn; 92 tn = null; 80 93 } 81 catch (Exception ex) { 82 83 }94 95 way.nodes.add(n); 96 84 97 break; 85 98 … … 99 112 100 113 break; 114 115 case 't': 116 way = new Way(); 117 tn = n; 118 break; 101 119 102 120 case 'e': … … 107 125 } 108 126 input.close(); 127 128 // Add the start node to the end of the trace to form a closed shape 109 129 way.nodes.add(fn); 110 130 }
Note:
See TracChangeset
for help on using the changeset viewer.