首先感谢维基百科,再者感谢stackoverflow
援引自这里,可以将经纬度信息转成DMS格式的这个是exif中存储的格式
http://en.wikipedia.org/wiki/Geographic_coordinate_conversion#Components_of_a_typical_coordinate
java代码如下:
String decimalToDMS(double coord) { String output, degrees, minutes, seconds; // gets the modulus the coordinate divided by one (MOD1). // in other words gets all the numbers after the decimal point. // e.g. mod := -79.982195 % 1 == 0.982195 // // next get the integer part of the coord. On other words the whole number part. // e.g. intPart := -79 double mod = coord % 1; int intPart = (int)coord; //set degrees to the value of intPart //e.g. degrees := "-79" degrees = String.valueOf(intPart); // next times the MOD1 of degrees by 60 so we can find the integer part for minutes. // get the MOD1 of the new coord to find the numbers after the decimal point. // e.g. coord := 0.982195 * 60 == 58.9317 // mod := 58.9317 % 1 == 0.9317 // // next get the value of the integer part of the coord. // e.g. intPart := 58 coord = mod * 60; mod = coord % 1; intPart = (int)coord