for (int x = 0; x < rpi.getRouteSummary().length; x++) {
ri.getRouteSummary()[x] = new RouteSummary();
ri.getRouteSummary()[x].setDescription(rpi.getRouteSummary()[x].getDescription());
ri.getRouteSummary()[x].setDistance(rpi.getRouteSummary()[x].getDistance());
ri.getRouteSummary()[x].setPoint(new Point());
ri.getRouteSummary()[x].setPoint(rpi.getRouteSummary()[x].getPoint());
}
}
ri.setRouteTotals(new RouteTotals());
ri.setRouteTotals(rpi.getRouteTotals());
double totalTime = 0;
if (rpi.getSegDescription() != null) {
ri.setSegDescription(new SegmentDescription[rpi.getSegDescription().length]);
for (int x = 0; x < rpi.getSegDescription().length; x++) {
ri.getSegDescription()[x] = new SegmentDescription();
ri.getSegDescription()[x].setCity(new City());
ri.getSegDescription()[x].getCity().setName(rpi.getSegDescription()[x].getCity().getName());
ri.getSegDescription()[x].getCity().setState(rpi.getSegDescription()[x].getCity().getState());
ri.getSegDescription()[x].setCommand(rpi.getSegDescription()[x].getCommand());
ri.getSegDescription()[x].setCumulativeDistance(rpi.getSegDescription()[x].getCumulativeDistance());
ri.getSegDescription()[x].setDescription(rpi.getSegDescription()[x].getDescription());
ri.getSegDescription()[x].setDistance(rpi.getSegDescription()[x].getDistance());
ri.getSegDescription()[x].setPoint(new Point());
ri.getSegDescription()[x].getPoint().setX(rpi.getSegDescription()[x].getPoint().getX());
ri.getSegDescription()[x].getPoint().setY(rpi.getSegDescription()[x].getPoint().getY());
ri.getSegDescription()[x].setPoiRoute(rpi.getSegDescription()[x].getPoiRoute());
ri.getSegDescription()[x].setTime(rpi.getSegDescription()[x].getTime());
if (!rpi.getSegDescription()[x].getTime().equals(""))
totalTime += Double.parseDouble(rpi.getSegDescription()[x].getTime().substring(0,rpi.getSegDescription()[x].getTime().indexOf(' ')));
// String teste="";
// if (!ri.getSegDescription()[x].getFullCoords().equals(""))
// teste = convertFromDecarta(7, ri.getSegDescription()[x].getFullCoords());
int z = 0;
if (rpi.getSegDescription()[x].getPoiRouteDetails() != null) {
ri.getSegDescription()[x].setPoiRouteDetails(new POIDetails[rpi.getSegDescription()[x].getPoiRouteDetails().length]);
for (z = 0; z < rpi.getSegDescription()[x].getPoiRouteDetails().length; z++) {
ri.getSegDescription()[x].getPoiRouteDetails()[z] = new POIDetails();
ri.getSegDescription()[x].getPoiRouteDetails()[z].setAddressInfo(rpi.getSegDescription()[x].getPoiRouteDetails()[z]
.getAddressInfo());
ri.getSegDescription()[x].getPoiRouteDetails()[z].setClientID(rpi.getSegDescription()[x].getPoiRouteDetails()[z]
.getClientID());
ri.getSegDescription()[x].getPoiRouteDetails()[z].setName(rpi.getSegDescription()[x].getPoiRouteDetails()[z].getName());
ri.getSegDescription()[x].getPoiRouteDetails()[z].setPoint(new Point());
ri.getSegDescription()[x].getPoiRouteDetails()[z].getPoint().setX(
rpi.getSegDescription()[x].getPoiRouteDetails()[z].getPoint().getX());
ri.getSegDescription()[x].getPoiRouteDetails()[z].getPoint().setY(
rpi.getSegDescription()[x].getPoiRouteDetails()[z].getPoint().getY());
ri.getSegDescription()[x].getPoiRouteDetails()[z].setSource(rpi.getSegDescription()[x].getPoiRouteDetails()[z]