fixing issue on parsing lat/long
This commit is contained in:
parent
c6c9c7aa3a
commit
363bc89550
|
@ -155,20 +155,24 @@ public class ConvertToServiceModel {
|
|||
}
|
||||
|
||||
List<String> latList = mapFields.get("Latitudine Centroide");
|
||||
if(latList!=null){
|
||||
if(latList!=null && latList.size()>0){
|
||||
try {
|
||||
Double centroidLat = Double.parseDouble(latList.get(0));
|
||||
concessione.setCentroidLat(centroidLat);
|
||||
if(!latList.get(0).isEmpty()) {
|
||||
Double centroidLat = Double.parseDouble(latList.get(0));
|
||||
concessione.setCentroidLat(centroidLat);
|
||||
}
|
||||
}catch (Exception e) {
|
||||
throw new Exception("Unable to parse "+latList.get(0)+" as valid latitude");
|
||||
}
|
||||
}
|
||||
|
||||
List<String> longList = mapFields.get("Longitudine Centroide");
|
||||
if(longList!=null){
|
||||
if(longList!=null && longList.size()>0){
|
||||
try {
|
||||
Double centroidLong = Double.parseDouble(longList.get(0));
|
||||
concessione.setCentroidLong(centroidLong);
|
||||
if(!longList.get(0).isEmpty()) {
|
||||
Double centroidLong = Double.parseDouble(longList.get(0));
|
||||
concessione.setCentroidLong(centroidLong);
|
||||
}
|
||||
}catch (Exception e) {
|
||||
throw new Exception("Unable to parse "+longList.get(0)+" as valid longitude");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue