Skip to content
Snippets Groups Projects
Commit c5b095f2 authored by Rodríguez Ortega, Alejandro's avatar Rodríguez Ortega, Alejandro
Browse files

Fix bug with latitude & longitude, Changing "MultiPolygon" for "LineString"

parent b6715e83
No related branches found
No related tags found
No related merge requests found
...@@ -103,7 +103,13 @@ public class AnonymizerService { ...@@ -103,7 +103,13 @@ public class AnonymizerService {
puntos.add(DataUtils.getGpsPointFromVehiclePoint(vehiclePoints.getJSONObject(ipoint))); puntos.add(DataUtils.getGpsPointFromVehiclePoint(vehiclePoints.getJSONObject(ipoint)));
} }
} }
if (route == null || route.getNodes().isEmpty()) {
continue;
}
DivideInTraysCover ditc = new DivideInTraysCover(route); DivideInTraysCover ditc = new DivideInTraysCover(route);
if (ditc == null || ditc.doFindingTrays().isEmpty()) {
continue;
}
ArrayList<GPSRoute> rutasAntesdeAnonimizar = ditc.doFindingTrays(); ArrayList<GPSRoute> rutasAntesdeAnonimizar = ditc.doFindingTrays();
int borrados = 0; int borrados = 0;
//int b=0; //int b=0;
......
...@@ -64,8 +64,8 @@ public class DataUtils { ...@@ -64,8 +64,8 @@ public class DataUtils {
return null; return null;
} }
Long time = dateTime.toEpochSecond() *1000; Long time = dateTime.toEpochSecond() *1000;
double lon = vehicle.getJSONObject("location").getJSONArray("coordinates").getDouble(0); double lon = vehicle.getJSONObject("location").getJSONArray("coordinates").getDouble(1);
double lat =vehicle.getJSONObject("location").getJSONArray("coordinates").getDouble(1); double lat =vehicle.getJSONObject("location").getJSONArray("coordinates").getDouble(0);
double speed = vehicle.getDouble("speed"); double speed = vehicle.getDouble("speed");
GPSPoint p =new GPSPoint(time,lat,lon,speed); GPSPoint p =new GPSPoint(time,lat,lon,speed);
p.setTime(dateTime.toEpochSecond()); p.setTime(dateTime.toEpochSecond());
...@@ -176,7 +176,7 @@ public class DataUtils { ...@@ -176,7 +176,7 @@ public class DataUtils {
trozos.add(poligons); trozos.add(poligons);
coordinates.add(trozos); coordinates.add(trozos);
location.set("coordinates",coordinates); location.set("coordinates",coordinates);
location.put("type","MultiPolygon"); location.put("type","LineString");
node.set("location",location); node.set("location",location);
return node; return node;
...@@ -228,10 +228,10 @@ public class DataUtils { ...@@ -228,10 +228,10 @@ public class DataUtils {
return output; return output;
} catch (Exception e) { } catch (Exception e) {
System.err.println("Error in storeTrafficFlow model= " + model+" "+e.getMessage());// + " \njsonInput " + jsonInput); System.err.println("Error in storeDataFlow model= " + model+" "+e.getMessage());// + " \njsonInput " + jsonInput);
System.err.println(e.getMessage()); System.err.println(e.getMessage());
//System.exit(0); //System.exit(0);
return "Error in storeTrafficFlow model= " + model+" "+e.getMessage(); return "Error in storeDataFlow model= " + model+" "+e.getMessage();
} }
finally { finally {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment