Answers to: How to calculate north east lat/lon coordinates of a tile?https://help.openstreetmap.org/questions/69372/how-to-calculate-north-east-latlon-coordinates-of-a-tile<p>HI there! I know the below code calculates the north west corner long/lat coordinates of a tile, but is there a way to calculate the north east, south east or south west corner long/lat coordinates? (I'm terrible at maths...).</p>
<p>I'm programming in java, and any zoom around 17 - 19 would do.</p>
<p>static double tile2lon(int x, int z) {
return x / Math.pow(2.0, z) * 360.0 - 180;
}</p>
<p>static double tile2lat(int y, int z) {
double n = Math.PI - (2.0 * Math.PI * y) / Math.pow(2.0, z);
return Math.toDegrees(Math.atan(Math.sinh(n)));
}</p>
<p>Thank you very much!</p>enThu, 30 May 2019 03:06:35 +0100Answer by xj18205https://help.openstreetmap.org/questions/69372/how-to-calculate-north-east-latlon-coordinates-of-a-tile/69373<p>I just realised I can use the NW corner of the surround tiles to work out this answer!</p>xj18205Thu, 30 May 2019 03:06:35 +0100https://help.openstreetmap.org/questions/69372/how-to-calculate-north-east-latlon-coordinates-of-a-tile/69373