Changeset 6874 in osm for applications/editors/josm/plugins
- Timestamp:
- 2008-02-14T07:06:04+01:00 (17 years ago)
- Location:
- applications/editors/josm/plugins/lakewalker
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/lakewalker/Lakewalker/lakewalker.py
r6789 r6874 85 85 def download_landsat(c1, c2, width, height, fname): 86 86 layer = "global_mosaic_base" 87 #style = "IR1" 87 88 style = options.wmslayer 88 89 … … 356 357 # n lat lon - A node 357 358 # x - End of data 359 countnodes = 0 360 358 361 print "s %s" % len(lakelist) 359 362 for nodelist in lakelist: … … 361 364 for node in nodelist: 362 365 print "n %.7f %.7f" % (node[0], node[1]) 366 367 countnodes = countnodes + 1 368 if options.MAXLEN == countnodes: 369 print "x" 370 print "t %s" % len(nodelist) 371 print "n %.7f %.7f" % (node[0], node[1]) 372 countnodes = 0 373 363 374 print "x" 364 375 … … 432 443 parser.add_option("--threshold", "-t", type="int", default="35", metavar="VALUE", help="Maximum gray value to accept as water (based on Landsat IR-1 data). Can be in the range 0-255. Defaults to 35.") 433 444 parser.add_option("--maxnodes", type="int", default="50000", metavar="N", help="Maximum number of nodes to generate before bailing out. Defaults to 50000.") 434 parser.add_option("--waylength", type="int", de fault=250, metavar="MAXLEN", help="Maximum nuber of nodes allowed in one way. Defaults to 250.")445 parser.add_option("--waylength", type="int", dest="MAXLEN", default=500, metavar="MAXLEN", help="Maximum nuber of nodes allowed in one way. Defaults to 250.") 435 446 parser.add_option("--landsat-res", type="int", default=4000, dest="resolution", metavar="RES", help="Resolution of Landsat tiles, measured in pixels per degree. Defaults to 4000.") 436 447 parser.add_option("--tilesize", type="int", default=2000, help="Size of one landsat tile, measured in pixels. Defaults to 2000.") -
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.