Changeset 36309 in osm
- Timestamp:
- 2024-08-15T22:50:35+02:00 (4 months ago)
- Location:
- applications/editors/josm/plugins/ElevationProfile
- Files:
-
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/ElevationProfile/README
r34095 r36309 7 7 8 8 SRTM data in test/data is downloaded from http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/ 9 10 Please report bugs to oliver.wieland@online.de. -
applications/editors/josm/plugins/ElevationProfile/build.xml
r35978 r36309 4 4 <property name="commit.message" value="[josm_elevationprofile]"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="18 494"/>6 <property name="plugin.main.version" value="18970"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationHelper.java
r36243 r36309 247 247 } 248 248 249 int delta = (int) Math.max( Math.ceil(origSize / targetSize), 2);249 int delta = (int) Math.max(origSize / targetSize, 2); 250 250 251 251 List<WayPoint> res = new ArrayList<>(targetSize); -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationMapMode.java
r33215 r36309 9 9 10 10 /** 11 * Provides the map mode and controls visibility of the elevation profile layer/panel. 11 12 * @author Oliver Wieland <oliver.wieland@online.de> 12 * Provides the map mode and controls visibility of the elevation profile layer/panel.13 13 */ 14 14 public class ElevationMapMode extends MapMode implements IElevationModelListener { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/HgtReader.java
r35967 r36309 107 107 try (InputStream fis = Compression.getUncompressedFileInputStream(Paths.get(file))) { 108 108 // choose the right endianness 109 ByteBuffer bb = ByteBuffer.wrap(IOUtils.toByteArray(fis)); 110 //System.out.println(Arrays.toString(bb.array())); 109 ByteBuffer bb = ByteBuffer.wrap(fis.readAllBytes()); 111 110 bb.order(ByteOrder.BIG_ENDIAN); 112 int size = (int) Math.sqrt(bb.array().length / 2 );111 int size = (int) Math.sqrt(bb.array().length / 2.0); 113 112 data = new short[size][size]; 114 113 int x = 0; … … 130 129 * Reads the elevation value for the given coordinate. 131 130 * 132 * See also <a href="http ://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file">stackexchange.com</a>131 * See also <a href="https://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file">stackexchange.com</a> 133 132 * @param coor the coordinate to get the elevation data for 134 133 * @return the elevation value or <code>Double.NaN</code>, if no value is present … … 142 141 * Reads the elevation value for the given coordinate. 143 142 * 144 * See also <a href="http ://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file">stackexchange.com</a>143 * See also <a href="https://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file">stackexchange.com</a> 145 144 * @param coor the coordinate to get the elevation data for 146 145 * @param fileName The expected filename … … 205 204 206 205 float fraction = ((float) SRTM_EXTENT) / (mapSize - 1); 207 int latitude = (int) Math.round(frac( latDegrees) / fraction);208 int longitude = (int) Math.round(frac( lonDegrees) / fraction);206 int latitude = (int) Math.round(frac(Math.abs(latDegrees)) / fraction); 207 int longitude = (int) Math.round(frac(Math.abs(lonDegrees)) / fraction); 209 208 if (latDegrees >= 0) 210 209 { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/IElevationProfile.java
r35964 r36309 9 9 10 10 /** 11 * Interface for an elevation profile providing special properties/values. 11 12 * @author Oliver Wieland <oliver.wieland@online.de> 12 * Interface for an elevation profile providing special properties/values.13 13 */ 14 14 public interface IElevationProfile { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/UnitMode.java
r32775 r36309 3 3 4 4 /** 5 * Enumeration for different unit types. 5 6 * @author Oliver Wieland <oliver.wieland@online.de> 6 * Enumeration for different unit types.7 7 */ 8 8 public enum UnitMode { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gpx/ElevationModel.java
r35221 r36309 24 24 */ 25 25 public class ElevationModel implements IGpxVisitor, IElevationModel { 26 // private int sliceSize;27 26 private int trackCounter; 28 27 private final GpxData gpxData; … … 61 60 62 61 /** 62 * Return the tracks of the elevation model 63 63 * @return the tracks 64 64 */ -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gpx/ElevationWayPointKind.java
r32775 r36309 3 3 4 4 /** 5 * Enumeration which classifies way points within an elevation profile. 5 6 * @author Oliver Wieland <oliver.wieland@online.de> 6 * Enumeration which classifies way points within an elevation profile.7 7 */ 8 8 public enum ElevationWayPointKind { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gpx/GeoidCorrectionKind.java
r32775 r36309 3 3 4 4 /** 5 * Enumeration for available elevation correction modes. 5 6 * @author Oliver Wieland <oliver.wieland@online.de> 6 * Enumeration for available elevation correction modes.7 7 */ 8 8 public enum GeoidCorrectionKind { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gpx/IGpxWaypointVisitor.java
r32775 r36309 5 5 6 6 /** 7 * Interface for all GPX data visitors. Hopefully this will be part of JOSM some day. 7 8 * @author Oliver Wieland <oliver.wieland@online.de> 8 * Interface for all GPX data visitors. Hopefully this will be part of JOSM some day.9 9 */ 10 10 public interface IGpxWaypointVisitor { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/ElevationGridLayer.java
r35964 r36309 41 41 42 42 /** 43 * Elevation grid display layer 43 44 * @author Oliver Wieland <oliver.wieland@online.de> 44 45 * … … 284 285 285 286 @Override 286 public void destroy() {287 public synchronized void destroy() { 287 288 super.destroy(); 288 289 HgtReader.clearCache(); -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/ElevationGridTileController.java
r32775 r36309 44 44 return tile; 45 45 } 46 47 /**48 *49 */50 46 } -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/ElevationGridTileLoader.java
r35964 r36309 19 19 20 20 /** 21 * Tile loader for the elevation grid display 21 22 * @author Olli 22 23 * … … 24 25 public class ElevationGridTileLoader extends TMSCachedTileLoader { 25 26 26 class ElevationGridTileJob extends JCSCachedTileLoaderJob<String, BufferedImageCacheEntry> implements TileJob {27 static class ElevationGridTileJob extends JCSCachedTileLoaderJob<String, BufferedImageCacheEntry> implements TileJob { 27 28 28 29 private final Tile tile; 29 30 private final TileLoaderListener listener; 30 private final ICacheAccess<String, BufferedImageCacheEntry> cache;31 31 32 32 protected ElevationGridTileJob(TileLoaderListener listener, Tile tile, ICacheAccess<String, BufferedImageCacheEntry> cache, TileJobOptions options, 33 33 ThreadPoolExecutor downloadJobExecutor) { 34 34 super(cache, options, downloadJobExecutor); 35 this.cache = cache;36 35 this.tile = tile; 37 36 this.listener = listener; -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/ElevationGridTileSource.java
r32027 r36309 8 8 9 9 /** 10 * Tile source class for the tile loader 10 11 * @author Olli 11 *12 12 */ 13 13 public class ElevationGridTileSource extends TMSTileSource { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/SimpleVertexRenderer.java
r32775 r36309 8 8 9 9 /** 10 * Simple implementation of vertex renderer 10 11 * @author Olli 11 12 * -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java
r35165 r36309 46 46 47 47 /** 48 * @author Oliver Wieland <oliver.wieland@online.de>49 48 * Implements a JOSM ToggleDialog to show the elevation profile. It monitors the 50 49 * connection between layer and elevation profile. 50 * @author Oliver Wieland <oliver.wieland@online.de> 51 51 */ 52 52 public class ElevationProfileDialog extends ToggleDialog -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/TextAlignment.java
r32775 r36309 3 3 4 4 /** 5 * Different text alignments 5 6 * @author Oliver Wieland <oliver.wieland@online.de> 6 *7 7 */ 8 8 public enum TextAlignment { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/TriangleDir.java
r32775 r36309 3 3 4 4 /** 5 * All the triangle directions 5 6 * @author Oliver Wieland <oliver.wieland@online.de> 6 *7 7 */ 8 8 public enum TriangleDir {
Note:
See TracChangeset
for help on using the changeset viewer.