Ignore:
Timestamp:
2015-12-02T17:06:43+01:00 (9 years ago)
Author:
floscher
Message:

[mapillary] Always place images without coordinates exactly in the center

Previously they were spread out horizontally, but that led to strange situations when importing many not-geotagged images:

  • When dealing with more than say 20 imported images, or you were very much zoomed in, the images began to appear outside your viewport
  • When you imported one batch, moved the viewport, then imported a second batch, the first image of the second batch already had an offset
File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryUtils.java

    r31787 r31789  
    4444
    4545  private static double MIN_ZOOM_SQUARE_SIDE = 0.002;
    46 
    47   private static int noTagsPics = 0;
    4846
    4947  /**
     
    328326   */
    329327  public static MapillaryImportedImage readNoTags(File file, LatLon pos) {
    330     double HORIZONTAL_DISTANCE = 0.0001;
    331     double horDev;
    332 
    333     if (noTagsPics % 2 == 0)
    334       horDev = HORIZONTAL_DISTANCE * noTagsPics / 2;
    335     else
    336       horDev = -HORIZONTAL_DISTANCE * ((noTagsPics + 1) / 2);
    337     noTagsPics++;
    338 
    339328    ImageMetadata metadata = null;
    340329    try {
     
    351340              ExifTagConstants.EXIF_TAG_DATE_TIME_ORIGINAL);
    352341      if (datetimeOriginal == null)
    353         return new MapillaryImportedImage(pos.lat(), pos.lon() + horDev, 0,
     342        return new MapillaryImportedImage(pos.lat(), pos.lon(), 0,
    354343            file);
    355344      else {
    356345        try {
    357           return new MapillaryImportedImage(pos.lat(), pos.lon() + horDev, 0,
     346          return new MapillaryImportedImage(pos.lat(), pos.lon(), 0,
    358347              file, datetimeOriginal.getStringValue());
    359348        } catch (ImageReadException e) {
     
    362351      }
    363352    }
    364     return new MapillaryImportedImage(pos.lat(), pos.lon() + horDev, 0, file);
     353    return new MapillaryImportedImage(pos.lat(), pos.lon(), 0, file);
    365354  }
    366355
Note: See TracChangeset for help on using the changeset viewer.