Menu

#2 background image

open
nobody
None
5
2012-12-08
2009-06-22
No

This patch allows usage of scanned map as background image (on top of background map tiles, behind track).

It's not well finished patch, but it should work. For prune 7.

The patch currently assumes A4=21cm scan, 1:10 000.
TODO: complete gui to set scan size, save image settings to file (position,scale)

Discussion

  • Tuomo Kohvakka

    Tuomo Kohvakka - 2009-06-22

    background image patch

     
  • activityworkshop

    Thanks for the patch!
    I need to have a close look at this but my first thought is the obvious one - how can you assume that the scan is A4 (which many countries don't have), or 1:10,000 or what grid it uses or what projection, or how it is aligned in the scanner, etc etc? This is a complicated task! That's the big advantage of the openstreetmap family of maps, it's all clearly defined.

    Also, it would need a way to select whether to show the image layer or not (or maybe you have multiple scanned maps to cover the track area?), then do you show the OSM maps as well, and if so are they on top or underneath the scanned maps, and pretty soon you have a complicated layer dialog like a full GIS system. I'd like to avoid that kind of clutter if possible.

    Maybe this patch can be maintained in a separate branch from the main one for now - for sure it needs at the very least to be able to cope with maps of different paper sizes and different scales, with different positions and so on. Maybe then it will be clearer how to integrate it cleanly into the main branch. But for me all those affine transformations and grid conversions sound like a nightmare.

    Also of course don't forget it needs to be able to do non-metric maps (eg 1 inch = 1 mile), needs to be multilingual (eg no English texts in the source), and any file operations need to be cross-platform.

     
  • Tuomo Kohvakka

    Tuomo Kohvakka - 2009-06-23

    I don't think we can assume any scan size, or offer any fixed set of choices. Maps rarely are any standard size, scan can be cropped, etc. However it doesn't matter. We can assume that map on paper is in some reasonable scale. User just needs to be able to tell what the scale is. User can also specify scan DPI (likely to be 300 dpi). With those two values, combined with image pixel size (known), we can easily calculate map size. The DPI value is usually specified in metadata too, if image is scanned.

    If everything else fails, user should always be able to scale the map until it fits.

    Grid, projection, orientation - I'm afraid that we just need to assume that map is correctly oriented, and used projection close enough to be usable. However I'm quite confident that this is usually the case.

    I'll update the patch shortly. It however doesn't fix the problems mentioned yet. I agree on the problems though. I also agree that patch should not be taken into main branch before things are sorted out.

     
  • Tuomo Kohvakka

    Tuomo Kohvakka - 2009-06-23

    slightly updated patch

     
  • Tuomo Kohvakka

    Tuomo Kohvakka - 2009-06-28

    update: save and load position, rotation

     
  • Tuomo Kohvakka

    Tuomo Kohvakka - 2009-06-29

    I uploaded v3 of the patch.

    It now has ability to save map position, rotation, scale and resolution into exif data. It uses exiftool for reading and writing.

    Resolution unit used is DPI. I'm not sure if it's really important to have choice to have the other option, pixels/cm, available. What do you think?

    Please try the patch, see if it works for you, have a look at the code, and tell what you think about current way of implementation :)

    Having ability to have multiple images could be a useful feature, as well as those stacking choices etc.

     
  • Tuomo Kohvakka

    Tuomo Kohvakka - 2009-07-08

    added opacity slider

     
  • Tuomo Kohvakka

    Tuomo Kohvakka - 2009-09-22

    update for prune v8. no new code or features, still a prototype