@Test public void convertSingleLocationCoordinateTest() throws ParameterValueException { List<Double> locationsList = new ArrayList<>(); locationsList.add(8.681495); locationsList.add(49.41461); Coordinate coordinates = MatrixRequestHandler.convertSingleLocationCoordinate(locationsList); Assert.assertEquals(8.681495, coordinates.x, 0); Assert.assertEquals(49.41461, coordinates.y, 0); Assert.assertEquals(Double.NaN, coordinates.z, 0); }
protected static Coordinate convertSingleLocationCoordinate(List<Double> coordinate) throws ParameterValueException { if (coordinate.size() != 2) throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_LOCATIONS); return new Coordinate(coordinate.get(0), coordinate.get(1)); }
MatrixRequestHandler { protected static Coordinate convertSingleLocationCoordinate(List<Double> coordinate) throws ParameterValueException { if (coordinate.size() != 2) throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_LOCATIONS); return new Coordinate(coordinate.get(0), coordinate.get(1)); } }
MatrixRequestHandler { protected static Coordinate convertSingleLocationCoordinate(List<Double> coordinate) throws ParameterValueException { if (coordinate.size() != 2) throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_LOCATIONS); return new Coordinate(coordinate.get(0), coordinate.get(1)); } private  MatrixRequestHandler(); }
MatrixRequestHandler { protected static Coordinate convertSingleLocationCoordinate(List<Double> coordinate) throws ParameterValueException { if (coordinate.size() != 2) throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_LOCATIONS); return new Coordinate(coordinate.get(0), coordinate.get(1)); } private  MatrixRequestHandler(); static MatrixResult generateMatrixFromRequest(MatrixRequest request); static org.heigit.ors.matrix.MatrixRequest convertMatrixRequest(MatrixRequest request); static int convertMetrics(MatrixRequestEnums.Metrics[] metrics); }
MatrixRequestHandler { protected static Coordinate convertSingleLocationCoordinate(List<Double> coordinate) throws ParameterValueException { if (coordinate.size() != 2) throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_LOCATIONS); return new Coordinate(coordinate.get(0), coordinate.get(1)); } private  MatrixRequestHandler(); static MatrixResult generateMatrixFromRequest(MatrixRequest request); static org.heigit.ors.matrix.MatrixRequest convertMatrixRequest(MatrixRequest request); static int convertMetrics(MatrixRequestEnums.Metrics[] metrics);  }