another check on parsing lat/long

This commit is contained in:
Francesco Mangiacrapa 2020-12-10 11:31:19 +01:00
parent 363bc89550
commit 16c1ecef11
1 changed files with 6 additions and 4 deletions

View File

@ -157,8 +157,9 @@ public class ConvertToServiceModel {
List<String> latList = mapFields.get("Latitudine Centroide");
if(latList!=null && latList.size()>0){
try {
if(!latList.get(0).isEmpty()) {
Double centroidLat = Double.parseDouble(latList.get(0));
String theLat = latList.get(0);
if(theLat!=null && !theLat.isEmpty()) {
Double centroidLat = Double.parseDouble(theLat);
concessione.setCentroidLat(centroidLat);
}
}catch (Exception e) {
@ -169,8 +170,9 @@ public class ConvertToServiceModel {
List<String> longList = mapFields.get("Longitudine Centroide");
if(longList!=null && longList.size()>0){
try {
if(!longList.get(0).isEmpty()) {
Double centroidLong = Double.parseDouble(longList.get(0));
String theLong = longList.get(0);
if(theLong!=null && !theLong.isEmpty()) {
Double centroidLong = Double.parseDouble(theLong);
concessione.setCentroidLong(centroidLong);
}
}catch (Exception e) {