Changeset 6789 in osm for applications/editors/josm/plugins/lakewalker
- Timestamp:
- 2008-02-07T04:54:29+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
r4096 r6789 85 85 def download_landsat(c1, c2, width, height, fname): 86 86 layer = "global_mosaic_base" 87 style = "IR1"87 style = options.wmslayer 88 88 89 89 (min_lat, min_lon) = c1 … … 122 122 bottom_left_xy = (int(math.floor(x / options.tilesize)) * options.tilesize, int(math.floor(y / options.tilesize)) * options.tilesize) 123 123 top_right_xy = (bottom_left_xy[0] + options.tilesize, bottom_left_xy[1] + options.tilesize) 124 fname = "landsat_%d_%d_xy_%d_%d.png" % (options.resolution, options.tilesize, bottom_left_xy[0], bottom_left_xy[1])124 fname = options.wmslayer+"/landsat_%d_%d_xy_%d_%d.png" % (options.resolution, options.tilesize, bottom_left_xy[0], bottom_left_xy[1]) 125 125 im = self.images.get(fname, None) 126 126 if im is None: … … 446 446 parser.add_option("--bottom", type="float", metavar="LATITUDE", default=-90, help="Bottom (south) latitude for bounding box") 447 447 parser.add_option("--josm", action="store_true", dest="josm_mode", default=False, help="Operate in JOSM plugin mode") 448 parser.add_option("--wms", type="string", dest="wmslayer", default="IR1", help="WMS layer to use") 448 449 449 450 global options # Ugly, I know... -
applications/editors/josm/plugins/lakewalker/build.xml
r6127 r6789 64 64 <copy todir="${josm.plugins.dir}/Lakewalker"> 65 65 <fileset dir="Lakewalker"> 66 <filename name = "*.py"/> 66 <filename name = "*.py"/> 67 67 </fileset> 68 68 </copy> 69 <mkdir dir="${josm.plugins.dir}/Lakewalker/IR1"></mkdir> 70 <mkdir dir="${josm.plugins.dir}/Lakewalker/IR2"></mkdir> 71 <mkdir dir="${josm.plugins.dir}/Lakewalker/IR3"></mkdir> 69 72 </target> 70 73 -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java
r5979 r6789 101 101 target += " --tilesize=" + Main.pref.get(LakewalkerPreferences.PREF_LANDSAT_SIZE, "2000"); 102 102 target += " --startdir=" + Main.pref.get(LakewalkerPreferences.PREF_START_DIR, "east"); 103 target += " --wms=" + Main.pref.get(LakewalkerPreferences.PREF_WMS, "IR1"); 103 104 target += " --josm"; 104 105 -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPreferences.java
r6127 r6789 15 15 public static final String[] DIRECTIONS = new String[] {"east", "northeast", "north", "northwest", "west", "southwest", "south", "southeast"}; 16 16 public static final String[] WAYTYPES = new String[] {"water", "coastline", "land", "none"}; 17 public static final String[] WMSLAYERS = new String[] {"IR1", "IR2", "IR3"}; 17 18 18 19 public static final String PREF_PYTHON = "lakewalker.python"; … … 27 28 public static final String PREF_START_DIR = "lakewalker.startdir"; 28 29 public static final String PREF_WAYTYPE = "lakewalker.waytype"; 30 public static final String PREF_WMS = "lakewalker.wms"; 29 31 30 32 protected StringConfigurer pythonConfig = new StringConfigurer(); … … 50 52 protected StringEnumConfigurer lakeTypeConfig = new StringEnumConfigurer(WAYTYPES); 51 53 protected JLabel lakeTypeLabel = new JLabel(tr("Tag ways as")); 54 protected StringEnumConfigurer wmsConfig = new StringEnumConfigurer(WMSLAYERS); 55 protected JLabel wmsLabel = new JLabel(tr("WMS Layer")); 52 56 53 57 public void addGui(PreferenceDialog gui) { … … 63 67 startDirConfig.setToolTipText(tr("Direction to search for land. Default east.")); 64 68 lakeTypeConfig.setToolTipText(tr("Tag ways as water, coastline, land or nothing. Default is water.")); 69 wmsConfig.setToolTipText(tr("Which WMS layer to use for tracing against. Default is IR1.")); 65 70 66 71 String description = tr("An interlude to the Lakewalker Python module to trace water bodies on Landsat imagery.<br><br>Version: {0}", LakewalkerPlugin.VERSION); … … 79 84 startDirConfig.setValue(Main.pref.get(PREF_START_DIR, "east")); 80 85 lakeTypeConfig.setValue(Main.pref.get(PREF_WAYTYPE, "water")); 86 wmsConfig.setValue(Main.pref.get(PREF_WMS, "IR1")); 81 87 } 82 88 … … 107 113 prefPanel.add(lakeTypeLabel, labelConstraints); 108 114 prefPanel.add(lakeTypeConfig.getControls(), dataConstraints); 115 prefPanel.add(wmsLabel, labelConstraints); 116 prefPanel.add(wmsConfig.getControls(), dataConstraints); 109 117 } 110 118 … … 124 132 Main.pref.put(PREF_START_DIR, startDirConfig.getValueString()); 125 133 Main.pref.put(PREF_WAYTYPE, lakeTypeConfig.getValueString()); 134 Main.pref.put(PREF_WMS, wmsConfig.getValueString()); 126 135 } 127 136
Note:
See TracChangeset
for help on using the changeset viewer.