Changeset 32033 in osm for applications/editors/josm/plugins/mapillary/src
- Timestamp:
- 2016-01-31T11:37:54+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java
r31983 r32033 51 51 * Creates a new object in the given position and with the given direction. 52 52 * 53 * @param lat 54 * The latitude where the picture was taken. 55 * @param lon 56 * The longitude where the picture was taken. 57 * @param ca 58 * The direction of the picture (0 means north). 59 */ 60 protected MapillaryAbstractImage(final double lat, final double lon, final double ca) { 61 this.latLon = new LatLon(lat, lon); 53 * @param latLon The latitude and longitude where the picture was taken. 54 * @param ca The direction of the picture (0 means north). 55 */ 56 protected MapillaryAbstractImage(final LatLon latLon, final double ca) { 57 this.latLon = latLon; 62 58 this.tempLatLon = this.latLon; 63 59 this.movingLatLon = this.latLon; -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java
r31882 r32033 4 4 import java.util.ArrayList; 5 5 import java.util.List; 6 7 import org.openstreetmap.josm.data.coor.LatLon; 6 8 7 9 /** … … 25 27 * Main constructor of the class MapillaryImage 26 28 * 27 * @param key 28 * The unique identifier of the image. 29 * @param lat 30 * The latitude where it is positioned. 31 * @param lon 32 * The longitude where it is positioned. 33 * @param ca 34 * The direction of the images in degrees, meaning 0 north. 29 * @param key The unique identifier of the image. 30 * @param latLon The latitude and longitude where it is positioned. 31 * @param ca The direction of the images in degrees, meaning 0 north. 35 32 */ 36 public MapillaryImage(String key, double lat, double lon,double ca) {37 super(lat , lon, ca);33 public MapillaryImage(final String key, final LatLon latLon, final double ca) { 34 super(latLon, ca); 38 35 this.key = key; 39 36 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImportedImage.java
r31882 r32033 9 9 import javax.imageio.ImageIO; 10 10 11 import org.openstreetmap.josm.data.coor.LatLon; 11 12 import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryUtils; 12 13 … … 27 28 * Using when the EXIF tags doesn't contain that info. 28 29 * 29 * @param lat 30 * Latitude where the picture was taken. 31 * @param lon 32 * Longitude where the picture was taken. 33 * @param ca 34 * Direction of the picture (0 means north). 35 * @param file 36 * The file containing the picture. 30 * @param latLon The latitude and longitude where the picture was taken. 31 * @param ca Direction of the picture (0 means north). 32 * @param file The file containing the picture. 37 33 */ 38 public MapillaryImportedImage( double lat, double lon,double ca, File file) {39 this(lat , lon, ca, file, MapillaryUtils.currentDate());34 public MapillaryImportedImage(final LatLon latLon, final double ca, final File file) { 35 this(latLon, ca, file, MapillaryUtils.currentDate()); 40 36 } 41 37 … … 43 39 * Main constructor of the class. 44 40 * 45 * @param lat 46 * Latitude where the picture was taken. 47 * @param lon 48 * Longitude where the picture was taken. 49 * @param ca 50 * Direction of the picture (0 means north), 51 * @param file 52 * The file containing the picture. 53 * @param datetimeOriginal 54 * The date the picture was taken. 41 * @param latLon Latitude and Longitude where the picture was taken. 42 * @param ca Direction of the picture (0 means north), 43 * @param file The file containing the picture. 44 * @param datetimeOriginal The date the picture was taken. 55 45 */ 56 public MapillaryImportedImage(double lat, double lon, double ca, File file, 57 String datetimeOriginal) { 58 super(lat, lon, ca); 46 public MapillaryImportedImage(final LatLon latLon, final double ca, final File file, final String datetimeOriginal) { 47 super(latLon, ca); 59 48 this.file = file; 60 49 try { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySequenceDownloadThread.java
r31909 r32033 16 16 import org.openstreetmap.josm.Main; 17 17 import org.openstreetmap.josm.data.Bounds; 18 import org.openstreetmap.josm.data.coor.LatLon; 18 19 import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage; 19 20 import org.openstreetmap.josm.plugins.mapillary.MapillaryData; … … 71 72 for (int j = 0; j < cas.size(); j++) { 72 73 try { 73 images.add(new MapillaryImage(keys.getString(j), coords 74 .getJsonArray(j).getJsonNumber(1).doubleValue(), coords 75 .getJsonArray(j).getJsonNumber(0).doubleValue(), cas 76 .getJsonNumber(j).doubleValue())); 74 images.add(new MapillaryImage( 75 keys.getString(j), 76 new LatLon( 77 coords.getJsonArray(j).getJsonNumber(1).doubleValue(), 78 coords.getJsonArray(j).getJsonNumber(0).doubleValue() 79 ), 80 cas.getJsonNumber(j).doubleValue())); 77 81 } catch (IndexOutOfBoundsException e) { 78 82 Main.warn("Mapillary bug at " + MapillaryURL.searchSequenceURL(bounds, page)); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryUtils.java
r31983 r32033 280 280 caValue = ((RationalNumber) ca.getValue()).doubleValue(); 281 281 if (datetimeOriginal != null) { 282 return new MapillaryImportedImage(latValue, lonValue, caValue, file, datetimeOriginal.getStringValue()); 283 } 284 return new MapillaryImportedImage(latValue, lonValue, caValue, file); 282 return new MapillaryImportedImage(new LatLon(latValue, lonValue), caValue, file, datetimeOriginal.getStringValue()); 283 } 284 return new MapillaryImportedImage(new LatLon(latValue, lonValue), caValue, file); 285 285 } 286 286 throw new IllegalStateException("Invalid format."); … … 323 323 ExifTagConstants.EXIF_TAG_DATE_TIME_ORIGINAL); 324 324 if (datetimeOriginal == null) { 325 return new MapillaryImportedImage(pos .lat(), pos.lon(), 0, file);325 return new MapillaryImportedImage(pos, 0, file); 326 326 } 327 327 try { 328 return new MapillaryImportedImage(pos .lat(), pos.lon(), 0, file, datetimeOriginal.getStringValue());328 return new MapillaryImportedImage(pos, 0, file, datetimeOriginal.getStringValue()); 329 329 } catch (ImageReadException e) { 330 330 Main.error(e); 331 331 } 332 332 } 333 return new MapillaryImportedImage(pos .lat(), pos.lon(), 0, file);333 return new MapillaryImportedImage(pos, 0, file); 334 334 } 335 335
Note:
See TracChangeset
for help on using the changeset viewer.