Changeset 20240 in osm for applications/editors
- Timestamp:
- 2010-03-01T18:48:22+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java
r19078 r20240 46 46 private URL getURLRaster(WMSLayer wmsLayer, EastNorth lambertMin, EastNorth lambertMax) throws MalformedURLException { 47 47 // GET /scpc/wms?version=1.1&request=GetMap&layers=CDIF:PMC@QH4480001701&format=image/png&bbox=-1186,0,13555,8830&width=576&height=345&exception=application/vnd.ogc.se_inimage&styles= HTTP/1.1 48 final int cRasterX = 800; // keep width constant and adjust width to original image proportions48 final int cRasterX = CadastrePlugin.imageWidth; // keep width constant and adjust width to original image proportions 49 49 String str = new String(wmsInterface.baseURL+"/scpc/wms?version=1.1&request=GetMap"); 50 50 str += "&layers=CDIF:PMC@"; … … 53 53 str += "&bbox="; 54 54 str += wmsLayer.eastNorth2raster(lambertMin, lambertMax); 55 //str += "&width= 800&height=800"; // maximum allowed by wms server55 //str += "&width=1000&height=800"; // maximum allowed by wms server 56 56 str += "&width="+cRasterX+"&height="; // maximum allowed by wms server (576/345, 800/378, 1000/634) 57 57 str += (int)(cRasterX*(wmsLayer.communeBBox.max.getY() - wmsLayer.communeBBox.min.getY())/(wmsLayer.communeBBox.max.getX() - wmsLayer.communeBBox.min.getX())); … … 73 73 str += lambertMax.east() + ","; 74 74 str += lambertMax.north(); 75 str += "&width=800&height=600"; // maximum allowed by wms server 76 //str += "&width=1000&height=800"; // maximum allowed by wms server 75 str += "&width="+CadastrePlugin.imageWidth+"&height="+CadastrePlugin.imageHeight; 77 76 //str += "&exception=application/vnd.ogc.se_inimage"; // used by normal client but not required 78 77 str += "&styles=LS3_90,LS2_90,LS1_90,PARCELLE_90,NUMERO_90,PT3_90,PT2_90,PT1_90,LIEUDIT_90"; -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
r20214 r20240 99 99 * - raster image rotation issues fixed, now using shift+ctrl key instead of ctrl 100 100 * - raster image adjustment using default system menu modifier (ctrl for windows) for Mac support 101 * - image resolution configurable (high, medium, low) like the online interface 101 102 * - from Erik Amzallag: 102 103 * - possibility to modify the auto-sourcing text just before upload … … 129 130 130 131 public static boolean drawBoundaries = false; 132 133 public static int imageWidth, imageHeight; 131 134 132 135 static private boolean menuEnabled = false; … … 177 180 }); 178 181 179 JMenuItem menuResetCookie = new JMenuItem(new MenuActionResetCookie());182 //JMenuItem menuResetCookie = new JMenuItem(new MenuActionResetCookie()); 180 183 //JMenuItem menuLambertZone = new JMenuItem(new MenuActionLambertZone()); 181 184 JMenuItem menuLoadFromCache = new JMenuItem(new MenuActionLoadFromCache()); … … 210 213 transparency = 1.0f; 211 214 } 215 String currentResolution = Main.pref.get("cadastrewms.resolution", "high"); 216 if (currentResolution.equals("high")) { 217 imageWidth = 1000; imageHeight = 800; 218 } else if (currentResolution.equals("medium")){ 219 imageWidth = 800; imageHeight = 600; 220 } else { 221 imageWidth = 600; imageHeight = 400; 222 } 223 212 224 // overwrite F11 shortcut used from the beginning by this plugin and recently used 213 225 // for full-screen switch in JOSM core -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java
r19949 r20240 58 58 private JCheckBox autoFirstLayer = new JCheckBox(tr("Automaticly select first WMS layer when grabing if multiple layers exist.")); 59 59 60 private JRadioButton grabRes1 = new JRadioButton("high"); 61 62 private JRadioButton grabRes2 = new JRadioButton("medium"); 63 64 private JRadioButton grabRes3 = new JRadioButton("low"); 65 60 66 static final int DEFAULT_SQUARE_SIZE = 100; 61 67 private JTextField grabMultiplier4Size = new JTextField(5); … … 124 130 cadastrewms.add(drawBoundaries, GBC.eop().insets(0, 0, 0, 5)); 125 131 132 // option to select the single grabbed image resolution 133 JLabel jLabelRes = new JLabel(tr("Image resolution:")); 134 cadastrewms.add(jLabelRes, GBC.std().insets(0, 5, 10, 0)); 135 ButtonGroup bgResolution = new ButtonGroup(); 136 ActionListener resActionListener = new ActionListener() { 137 public void actionPerformed(ActionEvent actionEvent) { 138 AbstractButton button = (AbstractButton) actionEvent.getSource(); 139 grabMultiplier4Size.setEnabled(button == grabMultiplier4); 140 } 141 }; 142 grabRes1.addActionListener( resActionListener); 143 grabRes1.setToolTipText(tr("High resolution (1000x800)")); 144 grabRes2.addActionListener( resActionListener); 145 grabRes2.setToolTipText(tr("Medium resolution (800x600)")); 146 grabRes3.addActionListener( resActionListener); 147 grabRes3.setToolTipText(tr("Low resolution (600x400)")); 148 bgResolution.add(grabRes1); 149 bgResolution.add(grabRes2); 150 bgResolution.add(grabRes3); 151 String currentResolution = Main.pref.get("cadastrewms.resolution", "high"); 152 if (currentResolution.equals("high")) 153 grabRes1.setSelected(true); 154 if (currentResolution.equals("medium")) 155 grabRes2.setSelected(true); 156 if (currentResolution.equals("low")) 157 grabRes3.setSelected(true); 158 cadastrewms.add(grabRes1, GBC.std().insets(5, 0, 5, 0)); 159 cadastrewms.add(grabRes2, GBC.std().insets(5, 0, 5, 0)); 160 cadastrewms.add(grabRes3, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 5, 0, 5)); 161 126 162 // option to select image zooming interpolation method 127 JLabel jLabelImageZoomInterpolation = new JLabel(tr("Image zoominterpolation:"));163 JLabel jLabelImageZoomInterpolation = new JLabel(tr("Image filter interpolation:")); 128 164 cadastrewms.add(jLabelImageZoomInterpolation, GBC.std().insets(0, 0, 10, 0)); 129 165 imageInterpolationMethod.addItem(tr("Nearest-Neighbor (fastest) [ Default ]")); … … 155 191 grabMultiplier1.setSelectedIcon(ImageProvider.get("preferences", "sel_box_1")); 156 192 grabMultiplier1.addActionListener( multiplierActionListener); 193 grabMultiplier1.setToolTipText(tr("Grab one image full screen")); 157 194 grabMultiplier2.setIcon(ImageProvider.get("preferences", "unsel_box_2")); 158 195 grabMultiplier2.setSelectedIcon(ImageProvider.get("preferences", "sel_box_2")); … … 259 296 Main.pref.put("cadastrewms.brightness", Float.toString((float)sliderTrans.getValue()/10)); 260 297 Main.pref.put("cadastrewms.drawBoundaries", drawBoundaries.isSelected()); 298 if (grabRes1.isSelected()) 299 Main.pref.put("cadastrewms.resolution", "high"); 300 else if (grabRes2.isSelected()) 301 Main.pref.put("cadastrewms.resolution", "medium"); 302 else if (grabRes3.isSelected()) 303 Main.pref.put("cadastrewms.resolution", "low"); 261 304 if (imageInterpolationMethod.getSelectedIndex() == 2) 262 305 Main.pref.put("cadastrewms.imageInterpolation", "bicubic"); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java
r18962 r20240 221 221 str += bbox.max.east() + ","; 222 222 str += bbox.max.north(); 223 str += "&width= 800&height=600"; // maximum allowed by wms server223 str += "&width="+CadastrePlugin.imageWidth+"&height="+CadastrePlugin.imageHeight; 224 224 str += "&exception=application/vnd.ogc.se_inimage"; 225 225 str += "&styles="; -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java
r18544 r20240 177 177 str += bbox.max.east() + ","; 178 178 str += bbox.max.north(); 179 str += "&width= 800&height=600"; // maximum allowed by wms server179 str += "&width="+CadastrePlugin.imageWidth+"&height="+CadastrePlugin.imageHeight; 180 180 str += "&styles="; 181 181 str += "COMMUNE_90"; -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r20211 r20240 238 238 Object savedInterpolation = g.getRenderingHint(RenderingHints.KEY_INTERPOLATION); 239 239 if (savedInterpolation == null) savedInterpolation = RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR; 240 String interpolation = Main.pref.get("cadastrewms.imageInterpolation", " Standard");240 String interpolation = Main.pref.get("cadastrewms.imageInterpolation", "standard"); 241 241 if (interpolation.equals("bilinear")) 242 242 g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
Note:
See TracChangeset
for help on using the changeset viewer.