wiki:Help/Plugin/PicLayer

Version 18 (modified by Hb---, 6 years ago) ( diff )

Hint to zoom to target area, shorter, some wikitr links

Plugin -> PicLayer

/pluginicon/PicLayer.jar/images/layericon.png

This plugin shows images as background in JOSM.

It offers two ways of loading the raster image 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 when using it.

Make sure the image is suitable, copyright-wise, if in doubt, don't use.

Usages

  1. Load some data from the server so the map is visible.
  2. Move and zoom the MapView to the estimated target position of the new background image.
  3. Click the Imagery menu and either choose New picture layer from file or New picture layer from clipboard.
    1. If you chose file, a file selector will pop-up. Pick the image you want. All formats supported by Java (GIF with transparency) and furthermore ZIP as container and KML experimental are possible.
    2. If you chose clipboard, importing the image data may take some time.

If something failed, you should get a message box. If not - check the console for messages (Linux only?)

  1. Once the image is visible you may start to position and calibrate it. For that - activate the PicLayer layer with the image in the Layers window.
  2. Start aligning the image.
    1. Move the image by choosing 'Move' from the toolbar and dragging the mouse around with left button pressed.
    2. Rotate the image by choosing 'Rotate' from the toolbar and drag.
    3. Scale the image by choosing 'Scale' from the toolbar and drag.
    4. You can also choose to scale in just one axis by selecting the proper button.
  1. If you need to reset your changes - you can use the context menu from the PicLayer entry in the layer list.
  2. If you want to save the calibration of the image, you can also do this using the popup menu.

This plugin is meant to help with mapping from aerial photos, similar to mapwarper.net.

Converting calibration data in PicLayer

For those interested in converting calibration data in !PicLayer:

  • INITIAL_SCALE is the initial size of 100 image pixels (length of ruler in JOSM).
  • SCALEX/Y is the factor after changing the size of the raster image relative to JOSM data layer.
  • INITIAL_POS_y/X are the coordinates of the image center in mercator projection.
  • POSITION_X/Y are the coordinates after shifting the raster image relative to JOSM data layer.
  • ANGLE is the angle in degrees (clockwise -> positive) when the raster image is rotated.
  • Mercator units are arc units in longitude (PI <-> 180).
  • Latitude is a bit complicated because this projection preserves angles but not areas:
    y = ln(tan(45+b/2))
    

where b is in degrees, ln is the natural logarithm and tan is the tangent.

  • The longitude in degrees l is obtained from x via:
    l = x*180/PI.
    
  • The latitude b can be calculated from y by:
    b = 2*arctan(e!**y) - 45
    
    (when inverse tangent returns degrees).

When transforming longitude degree differences of image corners to distance, you have to take into account that one degree east-west has different size dependent on latitude.
At equator 1 degree -> d0 = 111.321 km (from GRS 80 semi-major axes), at latitude b you get:

d = d0*cos(b)

(only exact for sphere, but deviation from ellipsoid < 0.5%).

See also


Back to Plugin Help
Back to Main Help

Attachments (4)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.