public Double change(String str){
str = str.trim();
String[] data= str
.replace("°", ";")
.replace("′", ";")
.replace("'", ";")
.replace("″", "")
.replace("\"", "")
.split(";");
Double res= 0d;
for (int i = data.length; i >0 ; i--) {
double sub = Double.parseDouble(data[i-1]);
if(i==1){
res=sub +res;
}else{
res=(res+sub)/60;
}
}
return res;
}
经纬度度分秒转化十进制
l-coder-dd2024-10-13 17:41