Changeset 17327 in osm for applications
- Timestamp:
- 2009-08-28T22:06:42+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/piclayer
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/piclayer/README
r17323 r17327 2 2 ======== 3 3 4 This plugin is meant for showing images as a background of the data being edited.It offers two ways of loading the data - from a file and from the clipboard.This is an early version and is not end-user-proof, so please follow the steps exactly in case you want to use it.Actually... it's barely working at the moment but I already find it very useful :).4 A plugin for JOSM editor. Use it wisely - do not copy from copyrighted maps. Use "help" option to get a short tutorial. 5 5 6 NOTE: Make sure the image is suitable, copyright-wise, if in doubt, don't use. 7 Step 1) Load some data from the server so that map is visible. 8 Step 2) Go to PicLayer menu and either choose to add a layer from a file or from the clipboard. 9 Step 2a) If you chose a file, a file selector will pop-up. Choose the image you want. Of course the format you are using might not be supported yet :) 10 Step 2b) If you chose a clipboard, please wait. For some reason it takes time. To be fixed later. 11 NOTE) If something failed, you should get a message box. If not - check the console for messages (Linux only?) 12 Step 3) Once the image is visible you may start positioning it. For that - select the PicLayer in the layers list and activate it (!). 13 Step 4) Start aligning the image. 14 Step 4a) Move the image by choosing 'Move' from the toolbar and draggin the mouse around with left button pressed. 15 Step 4b) Rotate the image by choosing 'Rotate' from the toolbar and draggin the mouse up/down with left button pressed. 16 Step 4c) Scale the image by choosing 'Scale' from the toolbar and draggin the mouse up/down with left button pressed. 17 NOTE) If it does not work - make sure the right layer is selected. 18 Step 5) If you need to reset your changes - you can use the popup menu available under the PicLayer entry in the layer list. 19 20 This plugin is meant to help with mapping from photos (for me it's mostly buildings) for people who simply don't like MetaCarta Rectifier (like me). 21 22 Although I wrote it only to help myself and currently have no intention of extending it beyond what I need, you may still contact me with any suggestions that you think are important: tomasz.stelmach@poczta.onet.pl 23 24 I used wmsplugin and routing plugin code very much during coding. Thank you and I hope you don't mind :) 6 Author: Tomasz Stelmach 7 Email: tomasz.stelmach@poczta.onet.pl 8 WWW: http://www.stelmach-online.net/ 25 9 26 10 HISTORY: … … 29 13 2009.08.28: 30 14 - added support for scaling in one axis only 15 - added support for saving / loading image calibration 31 16 - added new icons 17 18 2009.04.27: 19 - initial version -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/HelpAction.java
r17321 r17327 76 76 + "Step 4d) You can also choose to scale in just one axis by selecting the proper button." 77 77 + "\n" 78 + "NOTE) If it does not work - make sure the right layer is selected ."78 + "NOTE) If it does not work - make sure the right layer is selected AND ACTIVATED." 79 79 + "\n" 80 80 + "Step 5) If you need to reset your changes - you can use the popup menu available under the PicLayer entry in the layer list." 81 + "\n" 82 + "Step 6) If you want to save the calibraton of the picture you have made, you can also do this using the popup menu." 81 83 + "\n\n" 82 84 + "This plugin is meant to help with mapping from photos (for me it's mostly buildings) for people who simply don't like MetaCarta Rectifier (like me)." -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerAbstract.java
r17321 r17327 29 29 import java.awt.image.BufferedImage; 30 30 import java.io.IOException; 31 import java.util.Properties; 32 31 33 import javax.swing.Icon; 32 34 import javax.swing.ImageIcon; … … 68 70 // Layer icon 69 71 private Icon m_layericon = null; 72 73 // Keys for saving in Properties 74 private final String INITIAL_POS_X = "INITIAL_POS_X"; 75 private final String INITIAL_POS_Y = "INITIAL_POS_y"; 76 private final String POSITION_X = "POSITION_X"; 77 private final String POSITION_Y = "POSITION_Y"; 78 private final String ANGLE = "ANGLE"; 79 private final String INITIAL_SCALE = "INITIAL_SCALE"; 80 private final String SCALEX = "SCALEX"; 81 private final String SCALEY = "SCALEY"; 70 82 71 83 /** … … 89 101 m_popupmenu = new Component[]{ 90 102 reset_submenu, 103 new JSeparator(), 104 new JMenuItem( new SavePictureCalibrationAction(this)), 105 new JMenuItem( new LoadPictureCalibrationAction(this)), 91 106 new JSeparator(), 92 107 new JMenuItem( new HelpAction() ) … … 263 278 264 279 } 280 281 /** 282 * Saves the calibration data into properties structure 283 * @param props Properties to save to 284 */ 285 public void saveCalibration( Properties props ) { 286 // Save 287 props.put(INITIAL_POS_X, "" + m_initial_position.getX()); 288 props.put(INITIAL_POS_Y, "" + m_initial_position.getY()); 289 props.put(POSITION_X, "" + m_position.getX()); 290 props.put(POSITION_Y, "" + m_position.getY()); 291 props.put(INITIAL_SCALE, "" + m_initial_scale); 292 props.put(SCALEX, "" + m_scalex); 293 props.put(SCALEY, "" + m_scaley); 294 props.put(ANGLE, "" + m_angle); 295 } 296 297 /** 298 * Loads calibration data from properties structure 299 * @param props Properties to load from 300 * @return 301 */ 302 public void loadCalibration( Properties props ) { 303 // Load 304 double pos_x = Double.valueOf( props.getProperty(POSITION_X)); 305 double pos_y = Double.valueOf( props.getProperty(POSITION_Y)); 306 double in_pos_x = Double.valueOf( props.getProperty(INITIAL_POS_X)); 307 double in_pos_y = Double.valueOf( props.getProperty(INITIAL_POS_Y)); 308 double angle = Double.valueOf( props.getProperty(ANGLE)); 309 double in_scale = Double.valueOf( props.getProperty(INITIAL_SCALE)); 310 double scale_x = Double.valueOf( props.getProperty(SCALEX)); 311 double scale_y = Double.valueOf( props.getProperty(SCALEY)); 312 m_position.setLocation(pos_x, pos_y); 313 m_initial_position.setLocation(pos_x, pos_y); 314 m_angle = angle; 315 m_scalex = scale_x; 316 m_scaley = scale_y; 317 m_initial_scale = in_scale; 318 // Refresh 319 Main.map.mapView.repaint(); 320 } 265 321 } -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerFromClipboard.java
r14779 r17327 61 61 @Override 62 62 protected String getPicLayerName() { 63 return super.name + " <Clipboard>";63 return "Clipboard"; 64 64 } 65 65 -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerFromFile.java
r14779 r17327 40 40 m_file = file; 41 41 // Generate tooltip text 42 m_tooltiptext = super.name + " <" + m_file.getAbsolutePath() + ">";42 m_tooltiptext = m_file.getAbsolutePath(); 43 43 } 44 44 -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ResetPictureAllAction.java
r14779 r17327 39 39 */ 40 40 public ResetPictureAllAction( PicLayerAbstract owner ) { 41 super("All", null, null, null, false);41 super("All", null, "Resets picture calibration", null, false); 42 42 // Remember the owner... 43 43 m_owner = owner; -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ResetPictureAngleAction.java
r14779 r17327 39 39 */ 40 40 public ResetPictureAngleAction( PicLayerAbstract owner ) { 41 super("Angle", null, null, null, false);41 super("Angle", null, "Resets picture rotation", null, false); 42 42 // Remember the owner... 43 43 m_owner = owner; -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ResetPicturePositionAction.java
r14779 r17327 39 39 */ 40 40 public ResetPicturePositionAction( PicLayerAbstract owner ) { 41 super("Position", null, null, null, false);41 super("Position", null, "Resets picture position", null, false); 42 42 // Remember the owner... 43 43 m_owner = owner; -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ResetPictureScaleAction.java
r14779 r17327 39 39 */ 40 40 public ResetPictureScaleAction( PicLayerAbstract owner ) { 41 super("Scale", null, null, null, false);41 super("Scale", null, "Resets picture scale", null, false); 42 42 // Remember the owner... 43 43 m_owner = owner;
Note:
See TracChangeset
for help on using the changeset viewer.