Ignore:
Timestamp:
2016-06-23T17:42:43+02:00 (9 years ago)
Author:
floscher
Message:

[mapillary] Add methods to access both the original and the current ca/latlon of an image

Until now only the current values were publicly available.

This patch has been supplied by peterneubauer<peter@…>.

Location:
applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/ImportTest.java

    r32034 r32383  
    2828    File image = new File("images/icon16.png");
    2929    MapillaryImportedImage img = ImageUtil.readImagesFrom(image, new LatLon(0, 0)).get(0);
    30     assertEquals(0, img.getCa(), 0.01);
    31     assertTrue(new LatLon(0, 0).equalsEpsilon(img.getLatLon()));
     30    assertEquals(0, img.getMovingCa(), 0.01);
     31    assertTrue(new LatLon(0, 0).equalsEpsilon(img.getMovingLatLon()));
    3232  }
    3333
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecordTest.java

    r32065 r32383  
    120120    this.record.addCommand(cmd1);
    121121
    122     assertEquals(0.1, this.img1.getLatLon().lat(), 0.01);
    123 
    124     this.record.undo();
    125 
    126     assertEquals(0.0, this.img1.getLatLon().lat(), 0.01);
    127 
    128     this.record.redo();
    129 
    130     assertEquals(0.1, this.img1.getLatLon().lat(), 0.01);
    131 
    132     this.record.addCommand(cmd2);
    133     this.record.undo();
    134 
    135     assertEquals(-0.1, this.img1.getLatLon().lat(), 0.01);
    136 
    137     this.record.redo();
    138 
    139     assertEquals(0.1, this.img1.getLatLon().lat(), 0.01);
     122    assertEquals(0.1, this.img1.getMovingLatLon().lat(), 0.01);
     123
     124    this.record.undo();
     125
     126    assertEquals(0.0, this.img1.getMovingLatLon().lat(), 0.01);
     127
     128    this.record.redo();
     129
     130    assertEquals(0.1, this.img1.getMovingLatLon().lat(), 0.01);
     131
     132    this.record.addCommand(cmd2);
     133    this.record.undo();
     134
     135    assertEquals(-0.1, this.img1.getMovingLatLon().lat(), 0.01);
     136
     137    this.record.redo();
     138
     139    assertEquals(0.1, this.img1.getMovingLatLon().lat(), 0.01);
    140140  }
    141141
     
    155155    this.record.undo();
    156156
    157     assertEquals(-0.1, this.img1.getCa(), 0.01);
    158 
    159     this.record.redo();
    160 
    161     assertEquals(0.1, this.img1.getCa(), 0.01);
    162 
    163     this.record.addCommand(cmd2);
    164     this.record.undo();
    165 
    166     assertEquals(-0.2, this.img1.getCa(), 0.01);
    167 
    168     this.record.redo();
    169 
    170     assertEquals(0.1, this.img1.getCa(), 0.01);
     157    assertEquals(-0.1, this.img1.getMovingCa(), 0.01);
     158
     159    this.record.redo();
     160
     161    assertEquals(0.1, this.img1.getMovingCa(), 0.01);
     162
     163    this.record.addCommand(cmd2);
     164    this.record.undo();
     165
     166    assertEquals(-0.2, this.img1.getMovingCa(), 0.01);
     167
     168    this.record.redo();
     169
     170    assertEquals(0.1, this.img1.getMovingCa(), 0.01);
    171171  }
    172172
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/ImageUtilsTest.java

    r32053 r32383  
    2323    List<MapillaryImportedImage> images = ImageUtil.readImagesFrom(untaggedFile, defaultLL);
    2424    assertEquals(1, images.size());
    25     assertEquals(0, images.get(0).getCa(), 1e-9);
    26     assertEquals(defaultLL, images.get(0).getLatLon());
     25    assertEquals(0, images.get(0).getMovingCa(), 1e-9);
     26    assertEquals(defaultLL, images.get(0).getMovingLatLon());
    2727    assertEquals(untaggedFile, images.get(0).getFile());
    2828    long endTime = System.currentTimeMillis() / 1000 * 1000 + 1000; // Rounding to next full second
     
    3737    List<MapillaryImportedImage> images = ImageUtil.readImagesFrom(untaggedFile, defaultLL);
    3838    assertEquals(1, images.size());
    39     assertEquals(0, images.get(0).getCa(), 1e-9);
    40     assertEquals(55.6052777777, images.get(0).getLatLon().lat(), 1e-9);
    41     assertEquals(13.0001388888, images.get(0).getLatLon().lon(), 1e-9);
     39    assertEquals(0, images.get(0).getMovingCa(), 1e-9);
     40    assertEquals(55.6052777777, images.get(0).getMovingLatLon().lat(), 1e-9);
     41    assertEquals(13.0001388888, images.get(0).getMovingLatLon().lon(), 1e-9);
    4242    assertEquals(untaggedFile, images.get(0).getFile());
    4343    long endTime = System.currentTimeMillis() / 1000 * 1000 + 1000; // Rounding to next full second
     
    5252    List<MapillaryImportedImage> images = ImageUtil.readImagesFrom(untaggedFile, defaultLL);
    5353    assertEquals(1, images.size());
    54     assertEquals(42.73, images.get(0).getCa(), 1e-9);
    55     assertEquals(defaultLL, images.get(0).getLatLon());
     54    assertEquals(42.73, images.get(0).getMovingCa(), 1e-9);
     55    assertEquals(defaultLL, images.get(0).getMovingLatLon());
    5656    assertEquals(untaggedFile, images.get(0).getFile());
    5757    long endTime = System.currentTimeMillis() / 1000 * 1000 + 1000; // Rounding to next full second
     
    6666    List<MapillaryImportedImage> images = ImageUtil.readImagesFrom(untaggedFile, defaultLL);
    6767    assertEquals(1, images.size());
    68     assertEquals(0, images.get(0).getCa(), 1e-9);
    69     assertEquals(defaultLL, images.get(0).getLatLon());
     68    assertEquals(0, images.get(0).getMovingCa(), 1e-9);
     69    assertEquals(defaultLL, images.get(0).getMovingLatLon());
    7070    assertEquals(untaggedFile, images.get(0).getFile());
    7171    /* http://www.wolframalpha.com/input/?i=convert+2015-12-24T01%3A02%3A03%2B0000+to+unixtime */
Note: See TracChangeset for help on using the changeset viewer.