1 package tim.prune.function.srtm;
3 import tim.prune.data.Coordinate;
4 import tim.prune.data.DataPoint;
7 * Class to represent a single tile of Srtm data, from a single hgt.zip file
11 /** Latitude in degrees north/south */
12 private int _latitude = 0;
13 /** Longitude ini degrees east/west */
14 private int _longitude = 0;
17 * Constructor working out the tile for a single point
18 * @param inPoint data point
20 public SrtmTile(DataPoint inPoint)
22 Coordinate latitude = inPoint.getLatitude();
23 _latitude = (int) Math.floor(latitude.getDouble());
24 Coordinate longitude = inPoint.getLongitude();
25 _longitude = (int) Math.floor(longitude.getDouble());
30 * @param inOther other tile object
31 * @return true if both represent same tile
33 public boolean equals(SrtmTile inOther)
35 return (_latitude == inOther._latitude) && (_longitude == inOther._longitude);
38 /** @return latitude as int */
39 public int getLatitude() {
43 /** @return longitude as int */
44 public int getLongitude() {
49 * @return filename of tile
51 public String getTileName()
53 return (_latitude >= 0?"N":"S")
54 + (Math.abs(_latitude) < 10?"0":"")
56 + (_longitude >= 0?"E":"W")
57 + (Math.abs(_longitude) < 100?"0":"")
58 + (Math.abs(_longitude) < 10?"0":"")
59 + Math.abs(_longitude)