Changeset 11938 in osm for applications/editors/josm/plugins/lakewalker
- Timestamp:
- 2008-11-15T13:55:26+01:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/Lakewalker.java
r6949 r11938 79 79 i = 7; 80 80 } else { 81 throw new ArrayIndexOutOfBoundsException("Direction index ' "+direction+"' not found");81 throw new ArrayIndexOutOfBoundsException(tr("Direction index '{0}' not found",direction)); 82 82 } 83 83 return i; … … 106 106 107 107 if(!bbox.contains(lat, lon)){ 108 throw new LakewalkerException("The starting location was not within the bbox"); 108 throw new LakewalkerException(tr("The starting location was not within the bbox")); 109 109 } 110 110 111 111 int v; 112 112 113 setStatus("Looking for shoreline..."); 113 setStatus(tr("Looking for shoreline...")); 114 114 115 115 while(true){ … … 135 135 double[] startgeo = xy_to_geo(xy[0],xy[1],this.resolution); 136 136 137 System.out.printf("Found shore at lat %.4f lon %.4f\n",lat,lon); 137 //System.out.printf("Found shore at lat %.4f lon %.4f\n",lat,lon); 138 138 139 139 int last_dir = this.getDirectionIndex(this.startdir); … … 143 143 // Print a counter 144 144 if(i % 250 == 0){ 145 setStatus( i+"nodes so far...");146 System.out.println(i+" nodes so far..."); 145 setStatus(tr("{0} nodes so far...",i)); 146 //System.out.println(i+" nodes so far..."); 147 147 } 148 148 … … 195 195 double[] geo = xy_to_geo(xy[0],xy[1],this.resolution); 196 196 nodelist.add(geo); 197 System.out.println("Adding node at "+xy[0]+","+xy[1]+" ("+geo[1]+","+geo[0]+")"); 197 //System.out.println("Adding node at "+xy[0]+","+xy[1]+" ("+geo[1]+","+geo[0]+")"); 198 198 199 199 // Check if we got stuck in a loop -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPreferences.java
r11925 r11938 13 13 public class LakewalkerPreferences implements PreferenceSetting { 14 14 15 // TODO: Make these translatable 15 16 public static final String[] DIRECTIONS = new String[] {"east", "northeast", "north", "northwest", "west", "southwest", "south", "southeast"}; 16 17 public static final String[] WAYTYPES = new String[] {"water", "coastline", "land", "none"}; … … 19 20 public static final String PREF_MAX_SEG = "lakewalker.max_segs_in_way"; 20 21 public static final String PREF_MAX_NODES = "lakewalker.max_nodes"; 21 public static final String PREF_THRESHOLD = "lakewalker.threshold";22 22 public static final String PREF_THRESHOLD_VALUE = "lakewalker.thresholdvalue"; 23 23 public static final String PREF_EPSILON = "lakewalker.epsilon"; … … 35 35 protected JLabel maxNodesLabel = new JLabel(tr("Maximum number of nodes in initial trace")); 36 36 protected IntConfigurer thresholdConfig = new IntConfigurer(); 37 protected JLabel thresholdLabel = new JLabel(tr("Maximum gray value to count as water (0-255) [For old script]")); 38 protected IntConfigurer thresholdConfigNew = new IntConfigurer(); 39 protected JLabel thresholdLabelNew = new JLabel(tr("Maximum gray value to count as water (0-255)")); 37 protected JLabel thresholdLabel = new JLabel(tr("Maximum gray value to count as water (0-255)")); 40 38 protected DoubleConfigurer epsilonConfig = new DoubleConfigurer(); 41 39 protected JLabel epsilonLabel = new JLabel(tr("Line simplification accuracy (degrees)")); … … 58 56 maxSegsConfig.setToolTipText(tr("Maximum number of segments allowed in each generated way. Default 250.")); 59 57 maxNodesConfig.setToolTipText(tr("Maximum number of nodes to generate before bailing out (before simplifying lines). Default 50000.")); 60 thresholdConfig.setToolTipText(tr("Maximum gray value to accept as water (based on Landsat IR-1 data). Can be in the range 0-255. Default 35.")); 61 thresholdConfigNew.setToolTipText(tr("Maximum gray value to accept as water (based on Landsat IR-1 data). Can be in the range 0-255. Default 90.")); 58 thresholdConfig.setToolTipText(tr("Maximum gray value to accept as water (based on Landsat IR-1 data). Can be in the range 0-255. Default 90.")); 62 59 epsilonConfig.setToolTipText(tr("Accuracy of Douglas-Peucker line simplification, measured in degrees.<br>Lower values give more nodes, and more accurate lines. Default 0.0003.")); 63 60 landsatResConfig.setToolTipText(tr("Resolution of Landsat tiles, measured in pixels per degree. Default 4000.")); … … 75 72 maxSegsConfig.setValue(Main.pref.getInteger(PREF_MAX_SEG, 500)); 76 73 maxNodesConfig.setValue(Main.pref.getInteger(PREF_MAX_NODES, 50000)); 77 thresholdConfig.setValue(Main.pref.getInteger(PREF_THRESHOLD, 35)); 78 thresholdConfigNew.setValue(Main.pref.getInteger(PREF_THRESHOLD_VALUE, 90)); 74 thresholdConfig.setValue(Main.pref.getInteger(PREF_THRESHOLD_VALUE, 90)); 79 75 epsilonConfig.setValue(Main.pref.getDouble(PREF_EPSILON, 0.0003)); 80 76 landsatResConfig.setValue(Main.pref.getInteger(PREF_LANDSAT_RES, 4000)); … … 97 93 prefPanel.add(thresholdLabel, labelConstraints); 98 94 prefPanel.add(thresholdConfig.getControls(), dataConstraints); 99 prefPanel.add(thresholdLabelNew, labelConstraints);100 prefPanel.add(thresholdConfigNew.getControls(), dataConstraints);101 95 prefPanel.add(epsilonLabel, labelConstraints); 102 96 prefPanel.add(epsilonConfig.getControls(), dataConstraints); … … 123 117 Main.pref.put(PREF_MAX_SEG, maxSegsConfig.getValueString()); 124 118 Main.pref.put(PREF_MAX_NODES, maxNodesConfig.getValueString()); 125 Main.pref.put(PREF_THRESHOLD, thresholdConfig.getValueString()); 126 Main.pref.put(PREF_THRESHOLD_VALUE, thresholdConfigNew.getValueString()); 119 Main.pref.put(PREF_THRESHOLD_VALUE, thresholdConfig.getValueString()); 127 120 Main.pref.put(PREF_EPSILON, epsilonConfig.getValueString()); 128 121 Main.pref.put(PREF_LANDSAT_RES, landsatResConfig.getValueString());
Note:
See TracChangeset
for help on using the changeset viewer.