target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void setIdTest() { IsochronesRequest request = new IsochronesRequest(); request.setId("foo"); Assert.assertEquals("foo", request.getId()); }
public void setId(String id) { this.id = id; this.hasId = true; }
IsochronesRequest { public void setId(String id) { this.id = id; this.hasId = true; } }
IsochronesRequest { public void setId(String id) { this.id = id; this.hasId = true; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public void setId(String id) { this.id = id; this.hasId = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public void setId(String id) { this.id = id; this.hasId = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void TestOverlappingRegion() { String[] names = _builder.findBorderCrossing(new Coordinate[] { new Coordinate(101.5,101.5), new Coordinate(102.5,101.5) }); Assert.assertEquals(2, names.length); String[] names2 = _builder.findBorderCrossing(new Coordinate[] { new Coordinate(101.5,101.5), new Coordinate(101.75,101.5) }); Assert.assertEquals(1, names2.length); }
public String[] findBorderCrossing(Coordinate[] coords) { ArrayList<CountryBordersPolygon> countries = new ArrayList<>(); boolean hasInternational = false; boolean overlap = false; int lsLen = coords.length; if(lsLen > 1) { for(int i=0; i<lsLen; i++) { Coordinate c = coords[i]; if(!Double.isNaN(c.x) && !Double.isNaN(c.y)) { CountryBordersPolygon[] cnts = cbReader.getCandidateCountry(c); for (CountryBordersPolygon cbp : cnts) { if (!countries.contains(cbp)) { countries.add(cbp); } } if(cnts.length == 0) hasInternational = true; } } } if(countries.size() > 1) { ArrayList<CountryBordersPolygon> temp = new ArrayList<>(); for(int i=0; i<lsLen; i++) { Coordinate c = coords[i]; if(!Double.isNaN(c.x) && !Double.isNaN(c.y)) { boolean found = false; int countriesFound = 0; for(CountryBordersPolygon cbp : countries) { if (cbp.inArea(c)) { found = true; countriesFound++; if(!temp.contains(cbp)) { temp.add(cbp); } } } if(countriesFound > 1) { overlap = true; } if(!found) { hasInternational = true; } } } countries = temp; } if(countries.size() > 1 && overlap) { boolean crosses = false; LineString ls = gf.createLineString(coords); for (CountryBordersPolygon cp : countries) { if (cp.crossesBoundary(ls)) { crosses = true; break; } } if(!crosses) { CountryBordersPolygon cp = countries.get(0); countries.clear(); countries.add(cp); } } ArrayList<String> names = new ArrayList<>(); for(int i=0; i<countries.size(); i++) { if (!names.contains(countries.get(i).getName())) names.add(countries.get(i).getName()); } if(hasInternational && !countries.isEmpty()) { names.add(CountryBordersReader.INTERNATIONAL_NAME); } return names.toArray(new String[names.size()]); }
BordersGraphStorageBuilder extends AbstractGraphStorageBuilder { public String[] findBorderCrossing(Coordinate[] coords) { ArrayList<CountryBordersPolygon> countries = new ArrayList<>(); boolean hasInternational = false; boolean overlap = false; int lsLen = coords.length; if(lsLen > 1) { for(int i=0; i<lsLen; i++) { Coordinate c = coords[i]; if(!Double.isNaN(c.x) && !Double.isNaN(c.y)) { CountryBordersPolygon[] cnts = cbReader.getCandidateCountry(c); for (CountryBordersPolygon cbp : cnts) { if (!countries.contains(cbp)) { countries.add(cbp); } } if(cnts.length == 0) hasInternational = true; } } } if(countries.size() > 1) { ArrayList<CountryBordersPolygon> temp = new ArrayList<>(); for(int i=0; i<lsLen; i++) { Coordinate c = coords[i]; if(!Double.isNaN(c.x) && !Double.isNaN(c.y)) { boolean found = false; int countriesFound = 0; for(CountryBordersPolygon cbp : countries) { if (cbp.inArea(c)) { found = true; countriesFound++; if(!temp.contains(cbp)) { temp.add(cbp); } } } if(countriesFound > 1) { overlap = true; } if(!found) { hasInternational = true; } } } countries = temp; } if(countries.size() > 1 && overlap) { boolean crosses = false; LineString ls = gf.createLineString(coords); for (CountryBordersPolygon cp : countries) { if (cp.crossesBoundary(ls)) { crosses = true; break; } } if(!crosses) { CountryBordersPolygon cp = countries.get(0); countries.clear(); countries.add(cp); } } ArrayList<String> names = new ArrayList<>(); for(int i=0; i<countries.size(); i++) { if (!names.contains(countries.get(i).getName())) names.add(countries.get(i).getName()); } if(hasInternational && !countries.isEmpty()) { names.add(CountryBordersReader.INTERNATIONAL_NAME); } return names.toArray(new String[names.size()]); } }
BordersGraphStorageBuilder extends AbstractGraphStorageBuilder { public String[] findBorderCrossing(Coordinate[] coords) { ArrayList<CountryBordersPolygon> countries = new ArrayList<>(); boolean hasInternational = false; boolean overlap = false; int lsLen = coords.length; if(lsLen > 1) { for(int i=0; i<lsLen; i++) { Coordinate c = coords[i]; if(!Double.isNaN(c.x) && !Double.isNaN(c.y)) { CountryBordersPolygon[] cnts = cbReader.getCandidateCountry(c); for (CountryBordersPolygon cbp : cnts) { if (!countries.contains(cbp)) { countries.add(cbp); } } if(cnts.length == 0) hasInternational = true; } } } if(countries.size() > 1) { ArrayList<CountryBordersPolygon> temp = new ArrayList<>(); for(int i=0; i<lsLen; i++) { Coordinate c = coords[i]; if(!Double.isNaN(c.x) && !Double.isNaN(c.y)) { boolean found = false; int countriesFound = 0; for(CountryBordersPolygon cbp : countries) { if (cbp.inArea(c)) { found = true; countriesFound++; if(!temp.contains(cbp)) { temp.add(cbp); } } } if(countriesFound > 1) { overlap = true; } if(!found) { hasInternational = true; } } } countries = temp; } if(countries.size() > 1 && overlap) { boolean crosses = false; LineString ls = gf.createLineString(coords); for (CountryBordersPolygon cp : countries) { if (cp.crossesBoundary(ls)) { crosses = true; break; } } if(!crosses) { CountryBordersPolygon cp = countries.get(0); countries.clear(); countries.add(cp); } } ArrayList<String> names = new ArrayList<>(); for(int i=0; i<countries.size(); i++) { if (!names.contains(countries.get(i).getName())) names.add(countries.get(i).getName()); } if(hasInternational && !countries.isEmpty()) { names.add(CountryBordersReader.INTERNATIONAL_NAME); } return names.toArray(new String[names.size()]); } BordersGraphStorageBuilder(); }
BordersGraphStorageBuilder extends AbstractGraphStorageBuilder { public String[] findBorderCrossing(Coordinate[] coords) { ArrayList<CountryBordersPolygon> countries = new ArrayList<>(); boolean hasInternational = false; boolean overlap = false; int lsLen = coords.length; if(lsLen > 1) { for(int i=0; i<lsLen; i++) { Coordinate c = coords[i]; if(!Double.isNaN(c.x) && !Double.isNaN(c.y)) { CountryBordersPolygon[] cnts = cbReader.getCandidateCountry(c); for (CountryBordersPolygon cbp : cnts) { if (!countries.contains(cbp)) { countries.add(cbp); } } if(cnts.length == 0) hasInternational = true; } } } if(countries.size() > 1) { ArrayList<CountryBordersPolygon> temp = new ArrayList<>(); for(int i=0; i<lsLen; i++) { Coordinate c = coords[i]; if(!Double.isNaN(c.x) && !Double.isNaN(c.y)) { boolean found = false; int countriesFound = 0; for(CountryBordersPolygon cbp : countries) { if (cbp.inArea(c)) { found = true; countriesFound++; if(!temp.contains(cbp)) { temp.add(cbp); } } } if(countriesFound > 1) { overlap = true; } if(!found) { hasInternational = true; } } } countries = temp; } if(countries.size() > 1 && overlap) { boolean crosses = false; LineString ls = gf.createLineString(coords); for (CountryBordersPolygon cp : countries) { if (cp.crossesBoundary(ls)) { crosses = true; break; } } if(!crosses) { CountryBordersPolygon cp = countries.get(0); countries.clear(); countries.add(cp); } } ArrayList<String> names = new ArrayList<>(); for(int i=0; i<countries.size(); i++) { if (!names.contains(countries.get(i).getName())) names.add(countries.get(i).getName()); } if(hasInternational && !countries.isEmpty()) { names.add(CountryBordersReader.INTERNATIONAL_NAME); } return names.toArray(new String[names.size()]); } BordersGraphStorageBuilder(); @Override GraphExtension init(GraphHopper graphhopper); void setBordersBuilder(CountryBordersReader cbr); @Override void processWay(ReaderWay way); @Override void processWay(ReaderWay way, Coordinate[] coords, HashMap<Integer, HashMap<String,String>> nodeTags); @Override void processEdge(ReaderWay way, EdgeIteratorState edge); @Override String getName(); String[] findBorderCrossing(Coordinate[] coords); CountryBordersReader getCbReader(); }
BordersGraphStorageBuilder extends AbstractGraphStorageBuilder { public String[] findBorderCrossing(Coordinate[] coords) { ArrayList<CountryBordersPolygon> countries = new ArrayList<>(); boolean hasInternational = false; boolean overlap = false; int lsLen = coords.length; if(lsLen > 1) { for(int i=0; i<lsLen; i++) { Coordinate c = coords[i]; if(!Double.isNaN(c.x) && !Double.isNaN(c.y)) { CountryBordersPolygon[] cnts = cbReader.getCandidateCountry(c); for (CountryBordersPolygon cbp : cnts) { if (!countries.contains(cbp)) { countries.add(cbp); } } if(cnts.length == 0) hasInternational = true; } } } if(countries.size() > 1) { ArrayList<CountryBordersPolygon> temp = new ArrayList<>(); for(int i=0; i<lsLen; i++) { Coordinate c = coords[i]; if(!Double.isNaN(c.x) && !Double.isNaN(c.y)) { boolean found = false; int countriesFound = 0; for(CountryBordersPolygon cbp : countries) { if (cbp.inArea(c)) { found = true; countriesFound++; if(!temp.contains(cbp)) { temp.add(cbp); } } } if(countriesFound > 1) { overlap = true; } if(!found) { hasInternational = true; } } } countries = temp; } if(countries.size() > 1 && overlap) { boolean crosses = false; LineString ls = gf.createLineString(coords); for (CountryBordersPolygon cp : countries) { if (cp.crossesBoundary(ls)) { crosses = true; break; } } if(!crosses) { CountryBordersPolygon cp = countries.get(0); countries.clear(); countries.add(cp); } } ArrayList<String> names = new ArrayList<>(); for(int i=0; i<countries.size(); i++) { if (!names.contains(countries.get(i).getName())) names.add(countries.get(i).getName()); } if(hasInternational && !countries.isEmpty()) { names.add(CountryBordersReader.INTERNATIONAL_NAME); } return names.toArray(new String[names.size()]); } BordersGraphStorageBuilder(); @Override GraphExtension init(GraphHopper graphhopper); void setBordersBuilder(CountryBordersReader cbr); @Override void processWay(ReaderWay way); @Override void processWay(ReaderWay way, Coordinate[] coords, HashMap<Integer, HashMap<String,String>> nodeTags); @Override void processEdge(ReaderWay way, EdgeIteratorState edge); @Override String getName(); String[] findBorderCrossing(Coordinate[] coords); CountryBordersReader getCbReader(); static final String BUILDER_NAME; }
@Test public void hasIdTest() { IsochronesRequest request = new IsochronesRequest(); Assert.assertFalse(request.hasId()); request.setId("foo"); Assert.assertTrue(request.hasId()); }
public boolean hasId() { return hasId; }
IsochronesRequest { public boolean hasId() { return hasId; } }
IsochronesRequest { public boolean hasId() { return hasId; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public boolean hasId() { return hasId; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public boolean hasId() { return hasId; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void setAreaUnitTest() throws ParameterValueException { IsochronesRequest request = new IsochronesRequest(); request.setAreaUnit(APIEnums.Units.forValue("km")); Assert.assertEquals(APIEnums.Units.KILOMETRES, request.getAreaUnit()); }
public void setAreaUnit(APIEnums.Units areaUnit) { this.areaUnit = areaUnit; hasAreaUnits = true; }
IsochronesRequest { public void setAreaUnit(APIEnums.Units areaUnit) { this.areaUnit = areaUnit; hasAreaUnits = true; } }
IsochronesRequest { public void setAreaUnit(APIEnums.Units areaUnit) { this.areaUnit = areaUnit; hasAreaUnits = true; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public void setAreaUnit(APIEnums.Units areaUnit) { this.areaUnit = areaUnit; hasAreaUnits = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public void setAreaUnit(APIEnums.Units areaUnit) { this.areaUnit = areaUnit; hasAreaUnits = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void getSmoothingTest() { IsochronesRequest request = new IsochronesRequest(); Assert.assertNull(request.getSmoothing()); }
public Double getSmoothing() { return smoothing; }
IsochronesRequest { public Double getSmoothing() { return smoothing; } }
IsochronesRequest { public Double getSmoothing() { return smoothing; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public Double getSmoothing() { return smoothing; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public Double getSmoothing() { return smoothing; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void setSmoothingTest() { IsochronesRequest request = new IsochronesRequest(); request.setSmoothing(0.1); Assert.assertEquals(0.1, request.getSmoothing(), 0); }
public void setSmoothing(Double smoothing) { this.smoothing = smoothing; this.hasSmoothing = true; }
IsochronesRequest { public void setSmoothing(Double smoothing) { this.smoothing = smoothing; this.hasSmoothing = true; } }
IsochronesRequest { public void setSmoothing(Double smoothing) { this.smoothing = smoothing; this.hasSmoothing = true; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public void setSmoothing(Double smoothing) { this.smoothing = smoothing; this.hasSmoothing = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public void setSmoothing(Double smoothing) { this.smoothing = smoothing; this.hasSmoothing = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void hasSmoothingTest() { IsochronesRequest request = new IsochronesRequest(); Assert.assertFalse(request.hasSmoothing()); request.setSmoothing(0.1); Assert.assertTrue(request.hasSmoothing()); }
public boolean hasSmoothing() { return hasSmoothing; }
IsochronesRequest { public boolean hasSmoothing() { return hasSmoothing; } }
IsochronesRequest { public boolean hasSmoothing() { return hasSmoothing; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public boolean hasSmoothing() { return hasSmoothing; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public boolean hasSmoothing() { return hasSmoothing; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void getResponseTypeTest() { IsochronesRequest request = new IsochronesRequest(); Assert.assertEquals(APIEnums.RouteResponseType.GEOJSON, request.getResponseType()); }
public APIEnums.RouteResponseType getResponseType() { return responseType; }
IsochronesRequest { public APIEnums.RouteResponseType getResponseType() { return responseType; } }
IsochronesRequest { public APIEnums.RouteResponseType getResponseType() { return responseType; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public APIEnums.RouteResponseType getResponseType() { return responseType; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public APIEnums.RouteResponseType getResponseType() { return responseType; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void setResponseTypeTest() { IsochronesRequest request = new IsochronesRequest(); request.setResponseType(APIEnums.RouteResponseType.JSON); Assert.assertEquals(APIEnums.RouteResponseType.JSON, request.getResponseType()); }
public void setResponseType(APIEnums.RouteResponseType responseType) { this.responseType = responseType; }
IsochronesRequest { public void setResponseType(APIEnums.RouteResponseType responseType) { this.responseType = responseType; } }
IsochronesRequest { public void setResponseType(APIEnums.RouteResponseType responseType) { this.responseType = responseType; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public void setResponseType(APIEnums.RouteResponseType responseType) { this.responseType = responseType; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public void setResponseType(APIEnums.RouteResponseType responseType) { this.responseType = responseType; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void getAttributesTest() { IsochronesRequest request = new IsochronesRequest(); Assert.assertNull(request.getAttributes()); }
public IsochronesRequestEnums.Attributes[] getAttributes() { return attributes; }
IsochronesRequest { public IsochronesRequestEnums.Attributes[] getAttributes() { return attributes; } }
IsochronesRequest { public IsochronesRequestEnums.Attributes[] getAttributes() { return attributes; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public IsochronesRequestEnums.Attributes[] getAttributes() { return attributes; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public IsochronesRequestEnums.Attributes[] getAttributes() { return attributes; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void getLocationTest() { IsochronesRequest request = new IsochronesRequest(); Assert.assertEquals(Double[][].class, request.getLocations().getClass()); }
public Double[][] getLocations() { return locations; }
IsochronesRequest { public Double[][] getLocations() { return locations; } }
IsochronesRequest { public Double[][] getLocations() { return locations; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public Double[][] getLocations() { return locations; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public Double[][] getLocations() { return locations; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void setLocationTypeTest() { IsochronesRequest request = new IsochronesRequest(); request.setLocationType(IsochronesRequestEnums.LocationType.DESTINATION); Assert.assertEquals(IsochronesRequestEnums.LocationType.DESTINATION, request.getLocationType()); }
public void setLocationType(IsochronesRequestEnums.LocationType locationType) { this.locationType = locationType; hasLocationType = true; }
IsochronesRequest { public void setLocationType(IsochronesRequestEnums.LocationType locationType) { this.locationType = locationType; hasLocationType = true; } }
IsochronesRequest { public void setLocationType(IsochronesRequestEnums.LocationType locationType) { this.locationType = locationType; hasLocationType = true; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public void setLocationType(IsochronesRequestEnums.LocationType locationType) { this.locationType = locationType; hasLocationType = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public void setLocationType(IsochronesRequestEnums.LocationType locationType) { this.locationType = locationType; hasLocationType = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void TestInitiallyProcessedIfNoSidewalk() { WheelchairSidewalkWay way = new WheelchairSidewalkWay(new ReaderWay(1)); assertTrue(way.hasWayBeenFullyProcessed()); }
@Override public boolean hasWayBeenFullyProcessed() { if(side == OSMAttachedSidewalkProcessor.Side.BOTH && lastPrepared == OSMAttachedSidewalkProcessor.Side.RIGHT) { return true; } return side == lastPrepared; }
WheelchairSidewalkWay extends PedestrianWay { @Override public boolean hasWayBeenFullyProcessed() { if(side == OSMAttachedSidewalkProcessor.Side.BOTH && lastPrepared == OSMAttachedSidewalkProcessor.Side.RIGHT) { return true; } return side == lastPrepared; } }
WheelchairSidewalkWay extends PedestrianWay { @Override public boolean hasWayBeenFullyProcessed() { if(side == OSMAttachedSidewalkProcessor.Side.BOTH && lastPrepared == OSMAttachedSidewalkProcessor.Side.RIGHT) { return true; } return side == lastPrepared; } WheelchairSidewalkWay(ReaderWay way); }
WheelchairSidewalkWay extends PedestrianWay { @Override public boolean hasWayBeenFullyProcessed() { if(side == OSMAttachedSidewalkProcessor.Side.BOTH && lastPrepared == OSMAttachedSidewalkProcessor.Side.RIGHT) { return true; } return side == lastPrepared; } WheelchairSidewalkWay(ReaderWay way); @Override boolean hasWayBeenFullyProcessed(); @Override void prepare(); }
WheelchairSidewalkWay extends PedestrianWay { @Override public boolean hasWayBeenFullyProcessed() { if(side == OSMAttachedSidewalkProcessor.Side.BOTH && lastPrepared == OSMAttachedSidewalkProcessor.Side.RIGHT) { return true; } return side == lastPrepared; } WheelchairSidewalkWay(ReaderWay way); @Override boolean hasWayBeenFullyProcessed(); @Override void prepare(); }
@Test public void getProfileTest() { IsochronesRequest request = new IsochronesRequest(); Assert.assertNull(request.getProfile()); }
public APIEnums.Profile getProfile() { return profile; }
IsochronesRequest { public APIEnums.Profile getProfile() { return profile; } }
IsochronesRequest { public APIEnums.Profile getProfile() { return profile; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public APIEnums.Profile getProfile() { return profile; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public APIEnums.Profile getProfile() { return profile; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void setProfileTest() { IsochronesRequest request = new IsochronesRequest(); request.setProfile(APIEnums.Profile.DRIVING_CAR); Assert.assertEquals(APIEnums.Profile.DRIVING_CAR, request.getProfile()); }
public void setProfile(APIEnums.Profile profile) { this.profile = profile; }
IsochronesRequest { public void setProfile(APIEnums.Profile profile) { this.profile = profile; } }
IsochronesRequest { public void setProfile(APIEnums.Profile profile) { this.profile = profile; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public void setProfile(APIEnums.Profile profile) { this.profile = profile; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public void setProfile(APIEnums.Profile profile) { this.profile = profile; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void getIsochronesOptionsTest() { IsochronesRequest request = new IsochronesRequest(); Assert.assertNull(request.getIsochronesOptions()); }
public RouteRequestOptions getIsochronesOptions() { return isochronesOptions; }
IsochronesRequest { public RouteRequestOptions getIsochronesOptions() { return isochronesOptions; } }
IsochronesRequest { public RouteRequestOptions getIsochronesOptions() { return isochronesOptions; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public RouteRequestOptions getIsochronesOptions() { return isochronesOptions; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public RouteRequestOptions getIsochronesOptions() { return isochronesOptions; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void setIsochronesOptionsTest() { IsochronesRequest request = new IsochronesRequest(); request.setIsochronesOptions(new RouteRequestOptions()); Assert.assertEquals(RouteRequestOptions.class, request.getIsochronesOptions().getClass()); }
public void setIsochronesOptions(RouteRequestOptions isochronesOptions) { this.isochronesOptions = isochronesOptions; this.hasOptions = true; }
IsochronesRequest { public void setIsochronesOptions(RouteRequestOptions isochronesOptions) { this.isochronesOptions = isochronesOptions; this.hasOptions = true; } }
IsochronesRequest { public void setIsochronesOptions(RouteRequestOptions isochronesOptions) { this.isochronesOptions = isochronesOptions; this.hasOptions = true; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public void setIsochronesOptions(RouteRequestOptions isochronesOptions) { this.isochronesOptions = isochronesOptions; this.hasOptions = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public void setIsochronesOptions(RouteRequestOptions isochronesOptions) { this.isochronesOptions = isochronesOptions; this.hasOptions = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void getRangeTest() { IsochronesRequest request = new IsochronesRequest(); Assert.assertNull(request.getRange()); }
public List<Double> getRange() { return range; }
IsochronesRequest { public List<Double> getRange() { return range; } }
IsochronesRequest { public List<Double> getRange() { return range; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public List<Double> getRange() { return range; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public List<Double> getRange() { return range; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void setRangeTest() { IsochronesRequest request = new IsochronesRequest(); request.setRange(new ArrayList<>()); Assert.assertNotNull(request.getRange()); }
public void setRange(List<Double> range) { this.range = range; hasRange = true; }
IsochronesRequest { public void setRange(List<Double> range) { this.range = range; hasRange = true; } }
IsochronesRequest { public void setRange(List<Double> range) { this.range = range; hasRange = true; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public void setRange(List<Double> range) { this.range = range; hasRange = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public void setRange(List<Double> range) { this.range = range; hasRange = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void setRangeTypeTest() { IsochronesRequest request = new IsochronesRequest(); request.setRangeType(IsochronesRequestEnums.RangeType.DISTANCE); Assert.assertEquals(IsochronesRequestEnums.RangeType.DISTANCE, request.getRangeType()); }
public void setRangeType(IsochronesRequestEnums.RangeType rangeType) { this.rangeType = rangeType; hasRangeType = true; }
IsochronesRequest { public void setRangeType(IsochronesRequestEnums.RangeType rangeType) { this.rangeType = rangeType; hasRangeType = true; } }
IsochronesRequest { public void setRangeType(IsochronesRequestEnums.RangeType rangeType) { this.rangeType = rangeType; hasRangeType = true; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public void setRangeType(IsochronesRequestEnums.RangeType rangeType) { this.rangeType = rangeType; hasRangeType = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public void setRangeType(IsochronesRequestEnums.RangeType rangeType) { this.rangeType = rangeType; hasRangeType = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void getIntervalTest() { IsochronesRequest request = new IsochronesRequest(); Assert.assertNull(request.getInterval()); }
public Double getInterval() { return interval; }
IsochronesRequest { public Double getInterval() { return interval; } }
IsochronesRequest { public Double getInterval() { return interval; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public Double getInterval() { return interval; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public Double getInterval() { return interval; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void setIntervalTest() { IsochronesRequest request = new IsochronesRequest(); request.setInterval(new Double("0.0")); Assert.assertEquals(new Double("0.0"), request.getInterval()); }
public void setInterval(Double interval) { this.interval = interval; hasInterval = true; }
IsochronesRequest { public void setInterval(Double interval) { this.interval = interval; hasInterval = true; } }
IsochronesRequest { public void setInterval(Double interval) { this.interval = interval; hasInterval = true; } @JsonCreator IsochronesRequest(); }
IsochronesRequest { public void setInterval(Double interval) { this.interval = interval; hasInterval = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); }
IsochronesRequest { public void setInterval(Double interval) { this.interval = interval; hasInterval = true; } @JsonCreator IsochronesRequest(); String getId(); void setId(String id); boolean hasId(); APIEnums.Units getAreaUnit(); void setAreaUnit(APIEnums.Units areaUnit); boolean hasAreaUnits(); Double getSmoothing(); void setSmoothing(Double smoothing); boolean hasSmoothing(); APIEnums.RouteResponseType getResponseType(); void setResponseType(APIEnums.RouteResponseType responseType); boolean getIntersections(); void setIntersections(Boolean intersections); boolean hasIntersections(); APIEnums.Units getRangeUnit(); void setRangeUnit(APIEnums.Units rangeUnit); boolean hasRangeUnits(); IsochronesRequestEnums.Attributes[] getAttributes(); void setAttributes(IsochronesRequestEnums.Attributes[] attributes); boolean hasAttributes(); Double[][] getLocations(); void setLocations(Double[][] locations); boolean hasLocations(); IsochronesRequestEnums.LocationType getLocationType(); void setLocationType(IsochronesRequestEnums.LocationType locationType); boolean hasLocationType(); APIEnums.Profile getProfile(); void setProfile(APIEnums.Profile profile); RouteRequestOptions getIsochronesOptions(); void setIsochronesOptions(RouteRequestOptions isochronesOptions); boolean hasOptions(); List<Double> getRange(); void setRange(List<Double> range); boolean hasRange(); IsochronesRequestEnums.RangeType getRangeType(); void setRangeType(IsochronesRequestEnums.RangeType rangeType); boolean hasRangeType(); Double getInterval(); void setInterval(Double interval); boolean hasInterval(); static final String PARAM_ID; static final String PARAM_PROFILE; static final String PARAM_LOCATIONS; static final String PARAM_LOCATION_TYPE; static final String PARAM_OPTIONS; static final String PARAM_RANGE; static final String PARAM_RANGE_TYPE; static final String PARAM_RANGE_UNITS; static final String PARAM_AREA_UNITS; static final String PARAM_INTERSECTIONS; static final String PARAM_ATTRIBUTES; static final String PARAM_INTERVAL; static final String PARAM_SMOOTHING; }
@Test public void convertSmoothing() throws ParameterValueException { Float smoothing = handler.convertSmoothing(10.234); Assert.assertEquals(10.234, smoothing, 0.01); }
Float convertSmoothing(Double smoothingValue) throws ParameterValueException { float f = (float) smoothingValue.doubleValue(); if (smoothingValue < 0 || smoothingValue > 100) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_SMOOTHING, smoothingValue.toString()); return f; }
IsochronesRequestHandler extends GenericHandler { Float convertSmoothing(Double smoothingValue) throws ParameterValueException { float f = (float) smoothingValue.doubleValue(); if (smoothingValue < 0 || smoothingValue > 100) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_SMOOTHING, smoothingValue.toString()); return f; } }
IsochronesRequestHandler extends GenericHandler { Float convertSmoothing(Double smoothingValue) throws ParameterValueException { float f = (float) smoothingValue.doubleValue(); if (smoothingValue < 0 || smoothingValue > 100) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_SMOOTHING, smoothingValue.toString()); return f; } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { Float convertSmoothing(Double smoothingValue) throws ParameterValueException { float f = (float) smoothingValue.doubleValue(); if (smoothingValue < 0 || smoothingValue > 100) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_SMOOTHING, smoothingValue.toString()); return f; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { Float convertSmoothing(Double smoothingValue) throws ParameterValueException { float f = (float) smoothingValue.doubleValue(); if (smoothingValue < 0 || smoothingValue > 100) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_SMOOTHING, smoothingValue.toString()); return f; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void TestInitiallyNotProcessedIfSidewalk() { ReaderWay readerWay = new ReaderWay(1); readerWay.setTag("sidewalk", "left"); WheelchairSidewalkWay way = new WheelchairSidewalkWay(readerWay); assertFalse(way.hasWayBeenFullyProcessed()); }
@Override public boolean hasWayBeenFullyProcessed() { if(side == OSMAttachedSidewalkProcessor.Side.BOTH && lastPrepared == OSMAttachedSidewalkProcessor.Side.RIGHT) { return true; } return side == lastPrepared; }
WheelchairSidewalkWay extends PedestrianWay { @Override public boolean hasWayBeenFullyProcessed() { if(side == OSMAttachedSidewalkProcessor.Side.BOTH && lastPrepared == OSMAttachedSidewalkProcessor.Side.RIGHT) { return true; } return side == lastPrepared; } }
WheelchairSidewalkWay extends PedestrianWay { @Override public boolean hasWayBeenFullyProcessed() { if(side == OSMAttachedSidewalkProcessor.Side.BOTH && lastPrepared == OSMAttachedSidewalkProcessor.Side.RIGHT) { return true; } return side == lastPrepared; } WheelchairSidewalkWay(ReaderWay way); }
WheelchairSidewalkWay extends PedestrianWay { @Override public boolean hasWayBeenFullyProcessed() { if(side == OSMAttachedSidewalkProcessor.Side.BOTH && lastPrepared == OSMAttachedSidewalkProcessor.Side.RIGHT) { return true; } return side == lastPrepared; } WheelchairSidewalkWay(ReaderWay way); @Override boolean hasWayBeenFullyProcessed(); @Override void prepare(); }
WheelchairSidewalkWay extends PedestrianWay { @Override public boolean hasWayBeenFullyProcessed() { if(side == OSMAttachedSidewalkProcessor.Side.BOTH && lastPrepared == OSMAttachedSidewalkProcessor.Side.RIGHT) { return true; } return side == lastPrepared; } WheelchairSidewalkWay(ReaderWay way); @Override boolean hasWayBeenFullyProcessed(); @Override void prepare(); }
@Test(expected = ParameterValueException.class) public void convertSmoothingFailWhenTooHigh() throws ParameterValueException { handler.convertSmoothing(105.0); }
Float convertSmoothing(Double smoothingValue) throws ParameterValueException { float f = (float) smoothingValue.doubleValue(); if (smoothingValue < 0 || smoothingValue > 100) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_SMOOTHING, smoothingValue.toString()); return f; }
IsochronesRequestHandler extends GenericHandler { Float convertSmoothing(Double smoothingValue) throws ParameterValueException { float f = (float) smoothingValue.doubleValue(); if (smoothingValue < 0 || smoothingValue > 100) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_SMOOTHING, smoothingValue.toString()); return f; } }
IsochronesRequestHandler extends GenericHandler { Float convertSmoothing(Double smoothingValue) throws ParameterValueException { float f = (float) smoothingValue.doubleValue(); if (smoothingValue < 0 || smoothingValue > 100) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_SMOOTHING, smoothingValue.toString()); return f; } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { Float convertSmoothing(Double smoothingValue) throws ParameterValueException { float f = (float) smoothingValue.doubleValue(); if (smoothingValue < 0 || smoothingValue > 100) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_SMOOTHING, smoothingValue.toString()); return f; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { Float convertSmoothing(Double smoothingValue) throws ParameterValueException { float f = (float) smoothingValue.doubleValue(); if (smoothingValue < 0 || smoothingValue > 100) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_SMOOTHING, smoothingValue.toString()); return f; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test(expected = ParameterValueException.class) public void convertSmoothingFailWhenTooLow() throws ParameterValueException { handler.convertSmoothing(-5.0); }
Float convertSmoothing(Double smoothingValue) throws ParameterValueException { float f = (float) smoothingValue.doubleValue(); if (smoothingValue < 0 || smoothingValue > 100) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_SMOOTHING, smoothingValue.toString()); return f; }
IsochronesRequestHandler extends GenericHandler { Float convertSmoothing(Double smoothingValue) throws ParameterValueException { float f = (float) smoothingValue.doubleValue(); if (smoothingValue < 0 || smoothingValue > 100) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_SMOOTHING, smoothingValue.toString()); return f; } }
IsochronesRequestHandler extends GenericHandler { Float convertSmoothing(Double smoothingValue) throws ParameterValueException { float f = (float) smoothingValue.doubleValue(); if (smoothingValue < 0 || smoothingValue > 100) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_SMOOTHING, smoothingValue.toString()); return f; } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { Float convertSmoothing(Double smoothingValue) throws ParameterValueException { float f = (float) smoothingValue.doubleValue(); if (smoothingValue < 0 || smoothingValue > 100) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_SMOOTHING, smoothingValue.toString()); return f; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { Float convertSmoothing(Double smoothingValue) throws ParameterValueException { float f = (float) smoothingValue.doubleValue(); if (smoothingValue < 0 || smoothingValue > 100) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_SMOOTHING, smoothingValue.toString()); return f; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void convertLocationType() throws ParameterValueException { String locationType = handler.convertLocationType(IsochronesRequestEnums.LocationType.DESTINATION); Assert.assertEquals("destination", locationType); locationType = handler.convertLocationType(IsochronesRequestEnums.LocationType.START); Assert.assertEquals("start", locationType); }
String convertLocationType(IsochronesRequestEnums.LocationType locationType) throws ParameterValueException { IsochronesRequestEnums.LocationType value; switch (locationType) { case DESTINATION: value = IsochronesRequestEnums.LocationType.DESTINATION; break; case START: value = IsochronesRequestEnums.LocationType.START; break; default: throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATION_TYPE, locationType.toString()); } return value.toString(); }
IsochronesRequestHandler extends GenericHandler { String convertLocationType(IsochronesRequestEnums.LocationType locationType) throws ParameterValueException { IsochronesRequestEnums.LocationType value; switch (locationType) { case DESTINATION: value = IsochronesRequestEnums.LocationType.DESTINATION; break; case START: value = IsochronesRequestEnums.LocationType.START; break; default: throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATION_TYPE, locationType.toString()); } return value.toString(); } }
IsochronesRequestHandler extends GenericHandler { String convertLocationType(IsochronesRequestEnums.LocationType locationType) throws ParameterValueException { IsochronesRequestEnums.LocationType value; switch (locationType) { case DESTINATION: value = IsochronesRequestEnums.LocationType.DESTINATION; break; case START: value = IsochronesRequestEnums.LocationType.START; break; default: throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATION_TYPE, locationType.toString()); } return value.toString(); } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { String convertLocationType(IsochronesRequestEnums.LocationType locationType) throws ParameterValueException { IsochronesRequestEnums.LocationType value; switch (locationType) { case DESTINATION: value = IsochronesRequestEnums.LocationType.DESTINATION; break; case START: value = IsochronesRequestEnums.LocationType.START; break; default: throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATION_TYPE, locationType.toString()); } return value.toString(); } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { String convertLocationType(IsochronesRequestEnums.LocationType locationType) throws ParameterValueException { IsochronesRequestEnums.LocationType value; switch (locationType) { case DESTINATION: value = IsochronesRequestEnums.LocationType.DESTINATION; break; case START: value = IsochronesRequestEnums.LocationType.START; break; default: throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATION_TYPE, locationType.toString()); } return value.toString(); } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void convertRangeType() throws ParameterValueException { TravelRangeType rangeType = handler.convertRangeType(IsochronesRequestEnums.RangeType.DISTANCE); Assert.assertEquals(TravelRangeType.DISTANCE, rangeType); rangeType = handler.convertRangeType(IsochronesRequestEnums.RangeType.TIME); Assert.assertEquals(TravelRangeType.TIME, rangeType); }
TravelRangeType convertRangeType(IsochronesRequestEnums.RangeType rangeType) throws ParameterValueException { TravelRangeType travelRangeType; switch (rangeType) { case DISTANCE: travelRangeType = TravelRangeType.DISTANCE; break; case TIME: travelRangeType = TravelRangeType.TIME; break; default: throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_RANGE_TYPE, rangeType.toString()); } return travelRangeType; }
IsochronesRequestHandler extends GenericHandler { TravelRangeType convertRangeType(IsochronesRequestEnums.RangeType rangeType) throws ParameterValueException { TravelRangeType travelRangeType; switch (rangeType) { case DISTANCE: travelRangeType = TravelRangeType.DISTANCE; break; case TIME: travelRangeType = TravelRangeType.TIME; break; default: throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_RANGE_TYPE, rangeType.toString()); } return travelRangeType; } }
IsochronesRequestHandler extends GenericHandler { TravelRangeType convertRangeType(IsochronesRequestEnums.RangeType rangeType) throws ParameterValueException { TravelRangeType travelRangeType; switch (rangeType) { case DISTANCE: travelRangeType = TravelRangeType.DISTANCE; break; case TIME: travelRangeType = TravelRangeType.TIME; break; default: throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_RANGE_TYPE, rangeType.toString()); } return travelRangeType; } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { TravelRangeType convertRangeType(IsochronesRequestEnums.RangeType rangeType) throws ParameterValueException { TravelRangeType travelRangeType; switch (rangeType) { case DISTANCE: travelRangeType = TravelRangeType.DISTANCE; break; case TIME: travelRangeType = TravelRangeType.TIME; break; default: throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_RANGE_TYPE, rangeType.toString()); } return travelRangeType; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { TravelRangeType convertRangeType(IsochronesRequestEnums.RangeType rangeType) throws ParameterValueException { TravelRangeType travelRangeType; switch (rangeType) { case DISTANCE: travelRangeType = TravelRangeType.DISTANCE; break; case TIME: travelRangeType = TravelRangeType.TIME; break; default: throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_RANGE_TYPE, rangeType.toString()); } return travelRangeType; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void convertAreaUnit() throws ParameterValueException { String unit = handler.convertAreaUnit(APIEnums.Units.KILOMETRES); Assert.assertEquals("km", unit); unit = handler.convertAreaUnit(APIEnums.Units.METRES); Assert.assertEquals("m", unit); unit = handler.convertAreaUnit(APIEnums.Units.MILES); Assert.assertEquals("mi", unit); }
String convertAreaUnit(APIEnums.Units unitsIn) throws ParameterValueException { DistanceUnit areaUnit; try { areaUnit = DistanceUnitUtil.getFromString(unitsIn.toString(), DistanceUnit.UNKNOWN); if (areaUnit == DistanceUnit.UNKNOWN) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_AREA_UNITS, unitsIn.toString()); return DistanceUnitUtil.toString(areaUnit); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_AREA_UNITS, unitsIn.toString()); } }
IsochronesRequestHandler extends GenericHandler { String convertAreaUnit(APIEnums.Units unitsIn) throws ParameterValueException { DistanceUnit areaUnit; try { areaUnit = DistanceUnitUtil.getFromString(unitsIn.toString(), DistanceUnit.UNKNOWN); if (areaUnit == DistanceUnit.UNKNOWN) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_AREA_UNITS, unitsIn.toString()); return DistanceUnitUtil.toString(areaUnit); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_AREA_UNITS, unitsIn.toString()); } } }
IsochronesRequestHandler extends GenericHandler { String convertAreaUnit(APIEnums.Units unitsIn) throws ParameterValueException { DistanceUnit areaUnit; try { areaUnit = DistanceUnitUtil.getFromString(unitsIn.toString(), DistanceUnit.UNKNOWN); if (areaUnit == DistanceUnit.UNKNOWN) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_AREA_UNITS, unitsIn.toString()); return DistanceUnitUtil.toString(areaUnit); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_AREA_UNITS, unitsIn.toString()); } } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { String convertAreaUnit(APIEnums.Units unitsIn) throws ParameterValueException { DistanceUnit areaUnit; try { areaUnit = DistanceUnitUtil.getFromString(unitsIn.toString(), DistanceUnit.UNKNOWN); if (areaUnit == DistanceUnit.UNKNOWN) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_AREA_UNITS, unitsIn.toString()); return DistanceUnitUtil.toString(areaUnit); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_AREA_UNITS, unitsIn.toString()); } } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { String convertAreaUnit(APIEnums.Units unitsIn) throws ParameterValueException { DistanceUnit areaUnit; try { areaUnit = DistanceUnitUtil.getFromString(unitsIn.toString(), DistanceUnit.UNKNOWN); if (areaUnit == DistanceUnit.UNKNOWN) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_AREA_UNITS, unitsIn.toString()); return DistanceUnitUtil.toString(areaUnit); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_AREA_UNITS, unitsIn.toString()); } } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void convertRangeUnit() throws ParameterValueException { String unit = handler.convertRangeUnit(APIEnums.Units.KILOMETRES); Assert.assertEquals("km", unit); unit = handler.convertRangeUnit(APIEnums.Units.METRES); Assert.assertEquals("m", unit); unit = handler.convertRangeUnit(APIEnums.Units.MILES); Assert.assertEquals("mi", unit); }
String convertRangeUnit(APIEnums.Units unitsIn) throws ParameterValueException { DistanceUnit units; try { units = DistanceUnitUtil.getFromString(unitsIn.toString(), DistanceUnit.UNKNOWN); if (units == DistanceUnit.UNKNOWN) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_RANGE_UNITS, unitsIn.toString()); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_RANGE_UNITS, unitsIn.toString()); } return DistanceUnitUtil.toString(units); }
IsochronesRequestHandler extends GenericHandler { String convertRangeUnit(APIEnums.Units unitsIn) throws ParameterValueException { DistanceUnit units; try { units = DistanceUnitUtil.getFromString(unitsIn.toString(), DistanceUnit.UNKNOWN); if (units == DistanceUnit.UNKNOWN) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_RANGE_UNITS, unitsIn.toString()); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_RANGE_UNITS, unitsIn.toString()); } return DistanceUnitUtil.toString(units); } }
IsochronesRequestHandler extends GenericHandler { String convertRangeUnit(APIEnums.Units unitsIn) throws ParameterValueException { DistanceUnit units; try { units = DistanceUnitUtil.getFromString(unitsIn.toString(), DistanceUnit.UNKNOWN); if (units == DistanceUnit.UNKNOWN) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_RANGE_UNITS, unitsIn.toString()); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_RANGE_UNITS, unitsIn.toString()); } return DistanceUnitUtil.toString(units); } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { String convertRangeUnit(APIEnums.Units unitsIn) throws ParameterValueException { DistanceUnit units; try { units = DistanceUnitUtil.getFromString(unitsIn.toString(), DistanceUnit.UNKNOWN); if (units == DistanceUnit.UNKNOWN) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_RANGE_UNITS, unitsIn.toString()); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_RANGE_UNITS, unitsIn.toString()); } return DistanceUnitUtil.toString(units); } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { String convertRangeUnit(APIEnums.Units unitsIn) throws ParameterValueException { DistanceUnit units; try { units = DistanceUnitUtil.getFromString(unitsIn.toString(), DistanceUnit.UNKNOWN); if (units == DistanceUnit.UNKNOWN) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_RANGE_UNITS, unitsIn.toString()); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_RANGE_UNITS, unitsIn.toString()); } return DistanceUnitUtil.toString(units); } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void convertSingleCoordinate() throws ParameterValueException { Coordinate coord = handler.convertSingleCoordinate(new Double[]{123.4, 321.0}); Assert.assertEquals(123.4, coord.x, 0.0001); Assert.assertEquals(321.0, coord.y, 0.0001); }
Coordinate convertSingleCoordinate(Double[] coordinate) throws ParameterValueException { Coordinate realCoordinate; if (coordinate.length != 2) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } try { realCoordinate = new Coordinate(coordinate[0], coordinate[1]); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } return realCoordinate; }
IsochronesRequestHandler extends GenericHandler { Coordinate convertSingleCoordinate(Double[] coordinate) throws ParameterValueException { Coordinate realCoordinate; if (coordinate.length != 2) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } try { realCoordinate = new Coordinate(coordinate[0], coordinate[1]); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } return realCoordinate; } }
IsochronesRequestHandler extends GenericHandler { Coordinate convertSingleCoordinate(Double[] coordinate) throws ParameterValueException { Coordinate realCoordinate; if (coordinate.length != 2) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } try { realCoordinate = new Coordinate(coordinate[0], coordinate[1]); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } return realCoordinate; } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { Coordinate convertSingleCoordinate(Double[] coordinate) throws ParameterValueException { Coordinate realCoordinate; if (coordinate.length != 2) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } try { realCoordinate = new Coordinate(coordinate[0], coordinate[1]); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } return realCoordinate; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { Coordinate convertSingleCoordinate(Double[] coordinate) throws ParameterValueException { Coordinate realCoordinate; if (coordinate.length != 2) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } try { realCoordinate = new Coordinate(coordinate[0], coordinate[1]); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } return realCoordinate; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test(expected = ParameterValueException.class) public void convertSingleCoordinateInvalidLengthShort() throws ParameterValueException { handler.convertSingleCoordinate(new Double[]{123.4}); }
Coordinate convertSingleCoordinate(Double[] coordinate) throws ParameterValueException { Coordinate realCoordinate; if (coordinate.length != 2) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } try { realCoordinate = new Coordinate(coordinate[0], coordinate[1]); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } return realCoordinate; }
IsochronesRequestHandler extends GenericHandler { Coordinate convertSingleCoordinate(Double[] coordinate) throws ParameterValueException { Coordinate realCoordinate; if (coordinate.length != 2) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } try { realCoordinate = new Coordinate(coordinate[0], coordinate[1]); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } return realCoordinate; } }
IsochronesRequestHandler extends GenericHandler { Coordinate convertSingleCoordinate(Double[] coordinate) throws ParameterValueException { Coordinate realCoordinate; if (coordinate.length != 2) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } try { realCoordinate = new Coordinate(coordinate[0], coordinate[1]); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } return realCoordinate; } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { Coordinate convertSingleCoordinate(Double[] coordinate) throws ParameterValueException { Coordinate realCoordinate; if (coordinate.length != 2) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } try { realCoordinate = new Coordinate(coordinate[0], coordinate[1]); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } return realCoordinate; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { Coordinate convertSingleCoordinate(Double[] coordinate) throws ParameterValueException { Coordinate realCoordinate; if (coordinate.length != 2) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } try { realCoordinate = new Coordinate(coordinate[0], coordinate[1]); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } return realCoordinate; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test(expected = ParameterValueException.class) public void convertSingleCoordinateInvalidLengthLong() throws ParameterValueException { handler.convertSingleCoordinate(new Double[]{123.4, 123.4, 123.4}); }
Coordinate convertSingleCoordinate(Double[] coordinate) throws ParameterValueException { Coordinate realCoordinate; if (coordinate.length != 2) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } try { realCoordinate = new Coordinate(coordinate[0], coordinate[1]); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } return realCoordinate; }
IsochronesRequestHandler extends GenericHandler { Coordinate convertSingleCoordinate(Double[] coordinate) throws ParameterValueException { Coordinate realCoordinate; if (coordinate.length != 2) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } try { realCoordinate = new Coordinate(coordinate[0], coordinate[1]); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } return realCoordinate; } }
IsochronesRequestHandler extends GenericHandler { Coordinate convertSingleCoordinate(Double[] coordinate) throws ParameterValueException { Coordinate realCoordinate; if (coordinate.length != 2) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } try { realCoordinate = new Coordinate(coordinate[0], coordinate[1]); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } return realCoordinate; } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { Coordinate convertSingleCoordinate(Double[] coordinate) throws ParameterValueException { Coordinate realCoordinate; if (coordinate.length != 2) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } try { realCoordinate = new Coordinate(coordinate[0], coordinate[1]); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } return realCoordinate; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { Coordinate convertSingleCoordinate(Double[] coordinate) throws ParameterValueException { Coordinate realCoordinate; if (coordinate.length != 2) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } try { realCoordinate = new Coordinate(coordinate[0], coordinate[1]); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_LOCATIONS); } return realCoordinate; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void setRangeAndIntervals() throws ParameterValueException { TravellerInfo info = new TravellerInfo(); List<Double> rangeValues = new ArrayList<>(); rangeValues.add(20.0); double intervalValue = 10; handler.setRangeAndIntervals(info, rangeValues, intervalValue); Assert.assertEquals(10.0, info.getRanges()[0], 0.0f); Assert.assertEquals(20.0, info.getRanges()[1], 0.0f); info = new TravellerInfo(); rangeValues = new ArrayList<>(); rangeValues.add(15.0); rangeValues.add(30.0); handler.setRangeAndIntervals(info, rangeValues, intervalValue); Assert.assertEquals(15.0, info.getRanges()[0], 0.0f); Assert.assertEquals(30.0, info.getRanges()[1], 0.0f); }
void setRangeAndIntervals(TravellerInfo travellerInfo, List<Double> rangeValues, Double intervalValue) throws ParameterValueException { double rangeValue = -1; if (rangeValues.size() == 1) { try { rangeValue = rangeValues.get(0); travellerInfo.setRanges(new double[]{rangeValue}); } catch (NumberFormatException ex) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, "range"); } } else { double[] ranges = new double[rangeValues.size()]; double maxRange = Double.MIN_VALUE; for (int i = 0; i < ranges.length; i++) { double dv = rangeValues.get(i); if (dv > maxRange) maxRange = dv; ranges[i] = dv; } Arrays.sort(ranges); travellerInfo.setRanges(ranges); } if (rangeValues.size() == 1 && rangeValue != -1 && intervalValue != null){ travellerInfo.setRanges(rangeValue, intervalValue); } }
IsochronesRequestHandler extends GenericHandler { void setRangeAndIntervals(TravellerInfo travellerInfo, List<Double> rangeValues, Double intervalValue) throws ParameterValueException { double rangeValue = -1; if (rangeValues.size() == 1) { try { rangeValue = rangeValues.get(0); travellerInfo.setRanges(new double[]{rangeValue}); } catch (NumberFormatException ex) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, "range"); } } else { double[] ranges = new double[rangeValues.size()]; double maxRange = Double.MIN_VALUE; for (int i = 0; i < ranges.length; i++) { double dv = rangeValues.get(i); if (dv > maxRange) maxRange = dv; ranges[i] = dv; } Arrays.sort(ranges); travellerInfo.setRanges(ranges); } if (rangeValues.size() == 1 && rangeValue != -1 && intervalValue != null){ travellerInfo.setRanges(rangeValue, intervalValue); } } }
IsochronesRequestHandler extends GenericHandler { void setRangeAndIntervals(TravellerInfo travellerInfo, List<Double> rangeValues, Double intervalValue) throws ParameterValueException { double rangeValue = -1; if (rangeValues.size() == 1) { try { rangeValue = rangeValues.get(0); travellerInfo.setRanges(new double[]{rangeValue}); } catch (NumberFormatException ex) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, "range"); } } else { double[] ranges = new double[rangeValues.size()]; double maxRange = Double.MIN_VALUE; for (int i = 0; i < ranges.length; i++) { double dv = rangeValues.get(i); if (dv > maxRange) maxRange = dv; ranges[i] = dv; } Arrays.sort(ranges); travellerInfo.setRanges(ranges); } if (rangeValues.size() == 1 && rangeValue != -1 && intervalValue != null){ travellerInfo.setRanges(rangeValue, intervalValue); } } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { void setRangeAndIntervals(TravellerInfo travellerInfo, List<Double> rangeValues, Double intervalValue) throws ParameterValueException { double rangeValue = -1; if (rangeValues.size() == 1) { try { rangeValue = rangeValues.get(0); travellerInfo.setRanges(new double[]{rangeValue}); } catch (NumberFormatException ex) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, "range"); } } else { double[] ranges = new double[rangeValues.size()]; double maxRange = Double.MIN_VALUE; for (int i = 0; i < ranges.length; i++) { double dv = rangeValues.get(i); if (dv > maxRange) maxRange = dv; ranges[i] = dv; } Arrays.sort(ranges); travellerInfo.setRanges(ranges); } if (rangeValues.size() == 1 && rangeValue != -1 && intervalValue != null){ travellerInfo.setRanges(rangeValue, intervalValue); } } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { void setRangeAndIntervals(TravellerInfo travellerInfo, List<Double> rangeValues, Double intervalValue) throws ParameterValueException { double rangeValue = -1; if (rangeValues.size() == 1) { try { rangeValue = rangeValues.get(0); travellerInfo.setRanges(new double[]{rangeValue}); } catch (NumberFormatException ex) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, "range"); } } else { double[] ranges = new double[rangeValues.size()]; double maxRange = Double.MIN_VALUE; for (int i = 0; i < ranges.length; i++) { double dv = rangeValues.get(i); if (dv > maxRange) maxRange = dv; ranges[i] = dv; } Arrays.sort(ranges); travellerInfo.setRanges(ranges); } if (rangeValues.size() == 1 && rangeValue != -1 && intervalValue != null){ travellerInfo.setRanges(rangeValue, intervalValue); } } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void TestInitiallyNotProcessed() { assertFalse(way.hasWayBeenFullyProcessed()); }
@Override public boolean hasWayBeenFullyProcessed() { return hasBeenProcessed; }
WheelchairSeparateWay extends PedestrianWay { @Override public boolean hasWayBeenFullyProcessed() { return hasBeenProcessed; } }
WheelchairSeparateWay extends PedestrianWay { @Override public boolean hasWayBeenFullyProcessed() { return hasBeenProcessed; } WheelchairSeparateWay(ReaderWay way); }
WheelchairSeparateWay extends PedestrianWay { @Override public boolean hasWayBeenFullyProcessed() { return hasBeenProcessed; } WheelchairSeparateWay(ReaderWay way); @Override boolean hasWayBeenFullyProcessed(); @Override void prepare(); }
WheelchairSeparateWay extends PedestrianWay { @Override public boolean hasWayBeenFullyProcessed() { return hasBeenProcessed; } WheelchairSeparateWay(ReaderWay way); @Override boolean hasWayBeenFullyProcessed(); @Override void prepare(); }
@Test public void TestDetectControlledBorder() { VirtualEdgeIteratorState ve1 = generateEdge(1); VirtualEdgeIteratorState ve2 = generateEdge(2); VirtualEdgeIteratorState ve3 = generateEdge(3); BordersExtractor be = new BordersExtractor(_graphstorage, new int[0]); assertEquals(true, be.isControlledBorder(1)); assertEquals(false, be.isControlledBorder(2)); assertEquals(false, be.isControlledBorder(3)); }
public boolean isControlledBorder(int edgeId) { return storage.getEdgeValue(edgeId, BordersGraphStorage.Property.TYPE) == BordersGraphStorage.CONTROLLED_BORDER; }
BordersExtractor { public boolean isControlledBorder(int edgeId) { return storage.getEdgeValue(edgeId, BordersGraphStorage.Property.TYPE) == BordersGraphStorage.CONTROLLED_BORDER; } }
BordersExtractor { public boolean isControlledBorder(int edgeId) { return storage.getEdgeValue(edgeId, BordersGraphStorage.Property.TYPE) == BordersGraphStorage.CONTROLLED_BORDER; } BordersExtractor(BordersGraphStorage storage, int[] avoidCountries); }
BordersExtractor { public boolean isControlledBorder(int edgeId) { return storage.getEdgeValue(edgeId, BordersGraphStorage.Property.TYPE) == BordersGraphStorage.CONTROLLED_BORDER; } BordersExtractor(BordersGraphStorage storage, int[] avoidCountries); int getValue(int edgeId); boolean isBorder(int edgeId); boolean isControlledBorder(int edgeId); boolean isOpenBorder(int edgeId); boolean restrictedCountry(int edgeId); boolean isSameCountry(List<Integer> edgeIds); }
BordersExtractor { public boolean isControlledBorder(int edgeId) { return storage.getEdgeValue(edgeId, BordersGraphStorage.Property.TYPE) == BordersGraphStorage.CONTROLLED_BORDER; } BordersExtractor(BordersGraphStorage storage, int[] avoidCountries); int getValue(int edgeId); boolean isBorder(int edgeId); boolean isControlledBorder(int edgeId); boolean isOpenBorder(int edgeId); boolean restrictedCountry(int edgeId); boolean isSameCountry(List<Integer> edgeIds); }
@Test public void convertAttributes() { IsochronesRequestEnums.Attributes[] atts = new IsochronesRequestEnums.Attributes[]{IsochronesRequestEnums.Attributes.AREA, IsochronesRequestEnums.Attributes.REACH_FACTOR, IsochronesRequestEnums.Attributes.TOTAL_POPULATION}; String[] attStr = handler.convertAttributes(atts); Assert.assertEquals("area", attStr[0]); Assert.assertEquals("reachfactor", attStr[1]); Assert.assertEquals("total_pop", attStr[2]); }
String[] convertAttributes(IsochronesRequestEnums.Attributes[] attributes) { return convertAPIEnumListToStrings(attributes); }
IsochronesRequestHandler extends GenericHandler { String[] convertAttributes(IsochronesRequestEnums.Attributes[] attributes) { return convertAPIEnumListToStrings(attributes); } }
IsochronesRequestHandler extends GenericHandler { String[] convertAttributes(IsochronesRequestEnums.Attributes[] attributes) { return convertAPIEnumListToStrings(attributes); } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { String[] convertAttributes(IsochronesRequestEnums.Attributes[] attributes) { return convertAPIEnumListToStrings(attributes); } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { String[] convertAttributes(IsochronesRequestEnums.Attributes[] attributes) { return convertAPIEnumListToStrings(attributes); } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void convertCalcMethod() throws ParameterValueException { String calcMethod = handler.convertCalcMethod(IsochronesRequestEnums.CalculationMethod.CONCAVE_BALLS); Assert.assertEquals("concaveballs", calcMethod); calcMethod = handler.convertCalcMethod(IsochronesRequestEnums.CalculationMethod.GRID); Assert.assertEquals("grid", calcMethod); }
String convertCalcMethod(IsochronesRequestEnums.CalculationMethod bareCalcMethod) throws ParameterValueException { try { switch (bareCalcMethod) { case CONCAVE_BALLS: return "concaveballs"; case GRID: return "grid"; case FASTISOCHRONE: return "fastisochrone"; default: return "none"; } } catch (Exception ex) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, "calc_method"); } }
IsochronesRequestHandler extends GenericHandler { String convertCalcMethod(IsochronesRequestEnums.CalculationMethod bareCalcMethod) throws ParameterValueException { try { switch (bareCalcMethod) { case CONCAVE_BALLS: return "concaveballs"; case GRID: return "grid"; case FASTISOCHRONE: return "fastisochrone"; default: return "none"; } } catch (Exception ex) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, "calc_method"); } } }
IsochronesRequestHandler extends GenericHandler { String convertCalcMethod(IsochronesRequestEnums.CalculationMethod bareCalcMethod) throws ParameterValueException { try { switch (bareCalcMethod) { case CONCAVE_BALLS: return "concaveballs"; case GRID: return "grid"; case FASTISOCHRONE: return "fastisochrone"; default: return "none"; } } catch (Exception ex) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, "calc_method"); } } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { String convertCalcMethod(IsochronesRequestEnums.CalculationMethod bareCalcMethod) throws ParameterValueException { try { switch (bareCalcMethod) { case CONCAVE_BALLS: return "concaveballs"; case GRID: return "grid"; case FASTISOCHRONE: return "fastisochrone"; default: return "none"; } } catch (Exception ex) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, "calc_method"); } } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { String convertCalcMethod(IsochronesRequestEnums.CalculationMethod bareCalcMethod) throws ParameterValueException { try { switch (bareCalcMethod) { case CONCAVE_BALLS: return "concaveballs"; case GRID: return "grid"; case FASTISOCHRONE: return "fastisochrone"; default: return "none"; } } catch (Exception ex) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, "calc_method"); } } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void convertIsochroneRequest() throws Exception { IsochronesRequest request = new IsochronesRequest(); Double[][] locations = {{9.676034, 50.409675}, {9.676034, 50.409675}}; Coordinate coord0 = new Coordinate(); coord0.x = 9.676034; coord0.y = 50.409675; request.setLocations(locations); request.setProfile(APIEnums.Profile.DRIVING_CAR); List<Double> range = new ArrayList<>(); range.add(300.0); range.add(600.0); request.setRange(range); IsochroneRequest isochroneRequest = handler.convertIsochroneRequest(request); Assert.assertNotNull(isochroneRequest); Assert.assertFalse(isochroneRequest.getIncludeIntersections()); Assert.assertNull(request.getAttributes()); Assert.assertFalse(request.hasSmoothing()); Assert.assertNull(request.getSmoothing()); Assert.assertNull(request.getId()); Assert.assertEquals(coord0.x, isochroneRequest.getLocations()[0].x, 0); Assert.assertEquals(coord0.y, isochroneRequest.getLocations()[0].y, 0); Assert.assertEquals(coord0.x, isochroneRequest.getLocations()[1].x, 0); Assert.assertEquals(coord0.y, isochroneRequest.getLocations()[1].y, 0); Assert.assertEquals(2, isochroneRequest.getTravellers().size()); for (int i = 0; i < isochroneRequest.getTravellers().size(); i++) { TravellerInfo travellerInfo = isochroneRequest.getTravellers().get(i); Assert.assertEquals(String.valueOf(i), travellerInfo.getId()); Assert.assertEquals(coord0, travellerInfo.getLocation()); Assert.assertEquals(IsochronesRequestEnums.LocationType.START.toString(), travellerInfo.getLocationType()); Assert.assertNotNull(travellerInfo.getRanges()); Assert.assertEquals(TravelRangeType.TIME, travellerInfo.getRangeType()); Assert.assertNotNull(travellerInfo.getRouteSearchParameters()); } }
IsochroneRequest convertIsochroneRequest(IsochronesRequest request) throws Exception { IsochroneRequest convertedIsochroneRequest = new IsochroneRequest(); Double[][] locations = request.getLocations(); for (int i = 0; i < request.getLocations().length; i++) { Double[] location = locations[i]; TravellerInfo travellerInfo = constructTravellerInfo(location, request); travellerInfo.setId(Integer.toString(i)); try { convertedIsochroneRequest.addTraveller(travellerInfo); } catch (Exception ex) { throw new InternalServerException(IsochronesErrorCodes.UNKNOWN, IsochronesRequest.PARAM_INTERVAL); } } if (request.hasId()) convertedIsochroneRequest.setId(request.getId()); if (request.hasRangeUnits()) convertedIsochroneRequest.setUnits(convertRangeUnit(request.getRangeUnit())); if (request.hasAreaUnits()) convertedIsochroneRequest.setAreaUnits(convertAreaUnit(request.getAreaUnit())); if (request.hasAttributes()) convertedIsochroneRequest.setAttributes(convertAttributes(request.getAttributes())); if (request.hasSmoothing()) convertedIsochroneRequest.setSmoothingFactor(convertSmoothing(request.getSmoothing())); if (request.hasIntersections()) convertedIsochroneRequest.setIncludeIntersections(request.getIntersections()); if(request.hasOptions()) convertedIsochroneRequest.setCalcMethod(convertCalcMethod(CONCAVE_BALLS)); else convertedIsochroneRequest.setCalcMethod(convertCalcMethod(FASTISOCHRONE)); return convertedIsochroneRequest; }
IsochronesRequestHandler extends GenericHandler { IsochroneRequest convertIsochroneRequest(IsochronesRequest request) throws Exception { IsochroneRequest convertedIsochroneRequest = new IsochroneRequest(); Double[][] locations = request.getLocations(); for (int i = 0; i < request.getLocations().length; i++) { Double[] location = locations[i]; TravellerInfo travellerInfo = constructTravellerInfo(location, request); travellerInfo.setId(Integer.toString(i)); try { convertedIsochroneRequest.addTraveller(travellerInfo); } catch (Exception ex) { throw new InternalServerException(IsochronesErrorCodes.UNKNOWN, IsochronesRequest.PARAM_INTERVAL); } } if (request.hasId()) convertedIsochroneRequest.setId(request.getId()); if (request.hasRangeUnits()) convertedIsochroneRequest.setUnits(convertRangeUnit(request.getRangeUnit())); if (request.hasAreaUnits()) convertedIsochroneRequest.setAreaUnits(convertAreaUnit(request.getAreaUnit())); if (request.hasAttributes()) convertedIsochroneRequest.setAttributes(convertAttributes(request.getAttributes())); if (request.hasSmoothing()) convertedIsochroneRequest.setSmoothingFactor(convertSmoothing(request.getSmoothing())); if (request.hasIntersections()) convertedIsochroneRequest.setIncludeIntersections(request.getIntersections()); if(request.hasOptions()) convertedIsochroneRequest.setCalcMethod(convertCalcMethod(CONCAVE_BALLS)); else convertedIsochroneRequest.setCalcMethod(convertCalcMethod(FASTISOCHRONE)); return convertedIsochroneRequest; } }
IsochronesRequestHandler extends GenericHandler { IsochroneRequest convertIsochroneRequest(IsochronesRequest request) throws Exception { IsochroneRequest convertedIsochroneRequest = new IsochroneRequest(); Double[][] locations = request.getLocations(); for (int i = 0; i < request.getLocations().length; i++) { Double[] location = locations[i]; TravellerInfo travellerInfo = constructTravellerInfo(location, request); travellerInfo.setId(Integer.toString(i)); try { convertedIsochroneRequest.addTraveller(travellerInfo); } catch (Exception ex) { throw new InternalServerException(IsochronesErrorCodes.UNKNOWN, IsochronesRequest.PARAM_INTERVAL); } } if (request.hasId()) convertedIsochroneRequest.setId(request.getId()); if (request.hasRangeUnits()) convertedIsochroneRequest.setUnits(convertRangeUnit(request.getRangeUnit())); if (request.hasAreaUnits()) convertedIsochroneRequest.setAreaUnits(convertAreaUnit(request.getAreaUnit())); if (request.hasAttributes()) convertedIsochroneRequest.setAttributes(convertAttributes(request.getAttributes())); if (request.hasSmoothing()) convertedIsochroneRequest.setSmoothingFactor(convertSmoothing(request.getSmoothing())); if (request.hasIntersections()) convertedIsochroneRequest.setIncludeIntersections(request.getIntersections()); if(request.hasOptions()) convertedIsochroneRequest.setCalcMethod(convertCalcMethod(CONCAVE_BALLS)); else convertedIsochroneRequest.setCalcMethod(convertCalcMethod(FASTISOCHRONE)); return convertedIsochroneRequest; } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { IsochroneRequest convertIsochroneRequest(IsochronesRequest request) throws Exception { IsochroneRequest convertedIsochroneRequest = new IsochroneRequest(); Double[][] locations = request.getLocations(); for (int i = 0; i < request.getLocations().length; i++) { Double[] location = locations[i]; TravellerInfo travellerInfo = constructTravellerInfo(location, request); travellerInfo.setId(Integer.toString(i)); try { convertedIsochroneRequest.addTraveller(travellerInfo); } catch (Exception ex) { throw new InternalServerException(IsochronesErrorCodes.UNKNOWN, IsochronesRequest.PARAM_INTERVAL); } } if (request.hasId()) convertedIsochroneRequest.setId(request.getId()); if (request.hasRangeUnits()) convertedIsochroneRequest.setUnits(convertRangeUnit(request.getRangeUnit())); if (request.hasAreaUnits()) convertedIsochroneRequest.setAreaUnits(convertAreaUnit(request.getAreaUnit())); if (request.hasAttributes()) convertedIsochroneRequest.setAttributes(convertAttributes(request.getAttributes())); if (request.hasSmoothing()) convertedIsochroneRequest.setSmoothingFactor(convertSmoothing(request.getSmoothing())); if (request.hasIntersections()) convertedIsochroneRequest.setIncludeIntersections(request.getIntersections()); if(request.hasOptions()) convertedIsochroneRequest.setCalcMethod(convertCalcMethod(CONCAVE_BALLS)); else convertedIsochroneRequest.setCalcMethod(convertCalcMethod(FASTISOCHRONE)); return convertedIsochroneRequest; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { IsochroneRequest convertIsochroneRequest(IsochronesRequest request) throws Exception { IsochroneRequest convertedIsochroneRequest = new IsochroneRequest(); Double[][] locations = request.getLocations(); for (int i = 0; i < request.getLocations().length; i++) { Double[] location = locations[i]; TravellerInfo travellerInfo = constructTravellerInfo(location, request); travellerInfo.setId(Integer.toString(i)); try { convertedIsochroneRequest.addTraveller(travellerInfo); } catch (Exception ex) { throw new InternalServerException(IsochronesErrorCodes.UNKNOWN, IsochronesRequest.PARAM_INTERVAL); } } if (request.hasId()) convertedIsochroneRequest.setId(request.getId()); if (request.hasRangeUnits()) convertedIsochroneRequest.setUnits(convertRangeUnit(request.getRangeUnit())); if (request.hasAreaUnits()) convertedIsochroneRequest.setAreaUnits(convertAreaUnit(request.getAreaUnit())); if (request.hasAttributes()) convertedIsochroneRequest.setAttributes(convertAttributes(request.getAttributes())); if (request.hasSmoothing()) convertedIsochroneRequest.setSmoothingFactor(convertSmoothing(request.getSmoothing())); if (request.hasIntersections()) convertedIsochroneRequest.setIncludeIntersections(request.getIntersections()); if(request.hasOptions()) convertedIsochroneRequest.setCalcMethod(convertCalcMethod(CONCAVE_BALLS)); else convertedIsochroneRequest.setCalcMethod(convertCalcMethod(FASTISOCHRONE)); return convertedIsochroneRequest; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void constructTravellerInfo() throws Exception { Double[][] coordinates = {{1.0, 3.0}, {1.0, 3.0}}; Double[] coordinate = {1.0, 3.0}; Coordinate realCoordinate = new Coordinate(); realCoordinate.x = 1.0; realCoordinate.y = 3.0; IsochronesRequest request = new IsochronesRequest(); request.setProfile(APIEnums.Profile.DRIVING_CAR); request.setLocations(coordinates); List<Double> range = new ArrayList<>(); range.add(300.0); range.add(600.0); request.setRange(range); IsochronesRequestHandler isochronesRequestHandler = new IsochronesRequestHandler(); TravellerInfo travellerInfo = isochronesRequestHandler.constructTravellerInfo(coordinate, request); Assert.assertEquals(String.valueOf(0), travellerInfo.getId()); Assert.assertEquals(realCoordinate, travellerInfo.getLocation()); Assert.assertEquals("start", travellerInfo.getLocationType()); Assert.assertEquals(range.toString(), Arrays.toString(travellerInfo.getRanges())); Assert.assertEquals(TravelRangeType.TIME, travellerInfo.getRangeType()); }
TravellerInfo constructTravellerInfo(Double[] coordinate, IsochronesRequest request) throws Exception { TravellerInfo travellerInfo = new TravellerInfo(); RouteSearchParameters routeSearchParameters = constructRouteSearchParameters(request); travellerInfo.setRouteSearchParameters(routeSearchParameters); if (request.hasRangeType()) travellerInfo.setRangeType(convertRangeType(request.getRangeType())); if (request.hasLocationType()) travellerInfo.setLocationType(convertLocationType(request.getLocationType())); travellerInfo.setLocation(convertSingleCoordinate(coordinate)); travellerInfo.getRanges(); if (request.getRange() == null) { throw new ParameterValueException(IsochronesErrorCodes.MISSING_PARAMETER, IsochronesRequest.PARAM_RANGE); } List<Double> rangeValues = request.getRange(); Double intervalValue = request.getInterval(); setRangeAndIntervals(travellerInfo, rangeValues, intervalValue); return travellerInfo; }
IsochronesRequestHandler extends GenericHandler { TravellerInfo constructTravellerInfo(Double[] coordinate, IsochronesRequest request) throws Exception { TravellerInfo travellerInfo = new TravellerInfo(); RouteSearchParameters routeSearchParameters = constructRouteSearchParameters(request); travellerInfo.setRouteSearchParameters(routeSearchParameters); if (request.hasRangeType()) travellerInfo.setRangeType(convertRangeType(request.getRangeType())); if (request.hasLocationType()) travellerInfo.setLocationType(convertLocationType(request.getLocationType())); travellerInfo.setLocation(convertSingleCoordinate(coordinate)); travellerInfo.getRanges(); if (request.getRange() == null) { throw new ParameterValueException(IsochronesErrorCodes.MISSING_PARAMETER, IsochronesRequest.PARAM_RANGE); } List<Double> rangeValues = request.getRange(); Double intervalValue = request.getInterval(); setRangeAndIntervals(travellerInfo, rangeValues, intervalValue); return travellerInfo; } }
IsochronesRequestHandler extends GenericHandler { TravellerInfo constructTravellerInfo(Double[] coordinate, IsochronesRequest request) throws Exception { TravellerInfo travellerInfo = new TravellerInfo(); RouteSearchParameters routeSearchParameters = constructRouteSearchParameters(request); travellerInfo.setRouteSearchParameters(routeSearchParameters); if (request.hasRangeType()) travellerInfo.setRangeType(convertRangeType(request.getRangeType())); if (request.hasLocationType()) travellerInfo.setLocationType(convertLocationType(request.getLocationType())); travellerInfo.setLocation(convertSingleCoordinate(coordinate)); travellerInfo.getRanges(); if (request.getRange() == null) { throw new ParameterValueException(IsochronesErrorCodes.MISSING_PARAMETER, IsochronesRequest.PARAM_RANGE); } List<Double> rangeValues = request.getRange(); Double intervalValue = request.getInterval(); setRangeAndIntervals(travellerInfo, rangeValues, intervalValue); return travellerInfo; } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { TravellerInfo constructTravellerInfo(Double[] coordinate, IsochronesRequest request) throws Exception { TravellerInfo travellerInfo = new TravellerInfo(); RouteSearchParameters routeSearchParameters = constructRouteSearchParameters(request); travellerInfo.setRouteSearchParameters(routeSearchParameters); if (request.hasRangeType()) travellerInfo.setRangeType(convertRangeType(request.getRangeType())); if (request.hasLocationType()) travellerInfo.setLocationType(convertLocationType(request.getLocationType())); travellerInfo.setLocation(convertSingleCoordinate(coordinate)); travellerInfo.getRanges(); if (request.getRange() == null) { throw new ParameterValueException(IsochronesErrorCodes.MISSING_PARAMETER, IsochronesRequest.PARAM_RANGE); } List<Double> rangeValues = request.getRange(); Double intervalValue = request.getInterval(); setRangeAndIntervals(travellerInfo, rangeValues, intervalValue); return travellerInfo; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { TravellerInfo constructTravellerInfo(Double[] coordinate, IsochronesRequest request) throws Exception { TravellerInfo travellerInfo = new TravellerInfo(); RouteSearchParameters routeSearchParameters = constructRouteSearchParameters(request); travellerInfo.setRouteSearchParameters(routeSearchParameters); if (request.hasRangeType()) travellerInfo.setRangeType(convertRangeType(request.getRangeType())); if (request.hasLocationType()) travellerInfo.setLocationType(convertLocationType(request.getLocationType())); travellerInfo.setLocation(convertSingleCoordinate(coordinate)); travellerInfo.getRanges(); if (request.getRange() == null) { throw new ParameterValueException(IsochronesErrorCodes.MISSING_PARAMETER, IsochronesRequest.PARAM_RANGE); } List<Double> rangeValues = request.getRange(); Double intervalValue = request.getInterval(); setRangeAndIntervals(travellerInfo, rangeValues, intervalValue); return travellerInfo; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void constructRouteSearchParametersTest() throws Exception { Double[][] coordinates = {{1.0, 3.0}, {1.0, 3.0}}; IsochronesRequestHandler isochronesRequestHandler = new IsochronesRequestHandler(); IsochronesRequest request = new IsochronesRequest(); request.setProfile(APIEnums.Profile.DRIVING_CAR); request.setLocations(coordinates); RouteSearchParameters routeSearchParameters = isochronesRequestHandler.constructRouteSearchParameters(request); Assert.assertEquals(RoutingProfileType.DRIVING_CAR, routeSearchParameters.getProfileType()); Assert.assertEquals(WeightingMethod.FASTEST, routeSearchParameters.getWeightingMethod()); Assert.assertFalse(routeSearchParameters.getConsiderTurnRestrictions()); Assert.assertNull(routeSearchParameters.getAvoidAreas()); Assert.assertEquals(0, routeSearchParameters.getAvoidFeatureTypes()); Assert.assertEquals(0, routeSearchParameters.getVehicleType()); Assert.assertFalse(routeSearchParameters.getFlexibleMode()); Assert.assertEquals(BordersExtractor.Avoid.NONE, routeSearchParameters.getAvoidBorders()); Assert.assertNull(routeSearchParameters.getProfileParameters()); Assert.assertNull(routeSearchParameters.getBearings()); Assert.assertNull(routeSearchParameters.getMaximumRadiuses()); Assert.assertNull(routeSearchParameters.getAvoidCountries()); Assert.assertNull(routeSearchParameters.getOptions()); }
RouteSearchParameters constructRouteSearchParameters(IsochronesRequest request) throws Exception { RouteSearchParameters routeSearchParameters = new RouteSearchParameters(); int profileType; try { profileType = convertToIsochronesProfileType(request.getProfile()); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_PROFILE); } if (profileType == RoutingProfileType.UNKNOWN) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_PROFILE); routeSearchParameters.setProfileType(profileType); if (request.hasOptions()) { routeSearchParameters = processIsochronesRequestOptions(request, routeSearchParameters); } routeSearchParameters.setConsiderTurnRestrictions(false); return routeSearchParameters; }
IsochronesRequestHandler extends GenericHandler { RouteSearchParameters constructRouteSearchParameters(IsochronesRequest request) throws Exception { RouteSearchParameters routeSearchParameters = new RouteSearchParameters(); int profileType; try { profileType = convertToIsochronesProfileType(request.getProfile()); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_PROFILE); } if (profileType == RoutingProfileType.UNKNOWN) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_PROFILE); routeSearchParameters.setProfileType(profileType); if (request.hasOptions()) { routeSearchParameters = processIsochronesRequestOptions(request, routeSearchParameters); } routeSearchParameters.setConsiderTurnRestrictions(false); return routeSearchParameters; } }
IsochronesRequestHandler extends GenericHandler { RouteSearchParameters constructRouteSearchParameters(IsochronesRequest request) throws Exception { RouteSearchParameters routeSearchParameters = new RouteSearchParameters(); int profileType; try { profileType = convertToIsochronesProfileType(request.getProfile()); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_PROFILE); } if (profileType == RoutingProfileType.UNKNOWN) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_PROFILE); routeSearchParameters.setProfileType(profileType); if (request.hasOptions()) { routeSearchParameters = processIsochronesRequestOptions(request, routeSearchParameters); } routeSearchParameters.setConsiderTurnRestrictions(false); return routeSearchParameters; } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { RouteSearchParameters constructRouteSearchParameters(IsochronesRequest request) throws Exception { RouteSearchParameters routeSearchParameters = new RouteSearchParameters(); int profileType; try { profileType = convertToIsochronesProfileType(request.getProfile()); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_PROFILE); } if (profileType == RoutingProfileType.UNKNOWN) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_PROFILE); routeSearchParameters.setProfileType(profileType); if (request.hasOptions()) { routeSearchParameters = processIsochronesRequestOptions(request, routeSearchParameters); } routeSearchParameters.setConsiderTurnRestrictions(false); return routeSearchParameters; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { RouteSearchParameters constructRouteSearchParameters(IsochronesRequest request) throws Exception { RouteSearchParameters routeSearchParameters = new RouteSearchParameters(); int profileType; try { profileType = convertToIsochronesProfileType(request.getProfile()); } catch (Exception e) { throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_PROFILE); } if (profileType == RoutingProfileType.UNKNOWN) throw new ParameterValueException(IsochronesErrorCodes.INVALID_PARAMETER_VALUE, IsochronesRequest.PARAM_PROFILE); routeSearchParameters.setProfileType(profileType); if (request.hasOptions()) { routeSearchParameters = processIsochronesRequestOptions(request, routeSearchParameters); } routeSearchParameters.setConsiderTurnRestrictions(false); return routeSearchParameters; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void processIsochronesRequestOptionsTest() throws Exception { IsochronesRequestHandler isochronesRequestHandler = new IsochronesRequestHandler(); RouteSearchParameters routeSearchParameters = isochronesRequestHandler.constructRouteSearchParameters(request); Assert.assertEquals(RoutingProfileType.DRIVING_CAR, routeSearchParameters.getProfileType()); Assert.assertEquals(WeightingMethod.FASTEST, routeSearchParameters.getWeightingMethod()); Assert.assertFalse(routeSearchParameters.getConsiderTurnRestrictions()); checkPolygon(routeSearchParameters.getAvoidAreas(), geoJsonPolygon); Assert.assertEquals(16, routeSearchParameters.getAvoidFeatureTypes()); Assert.assertEquals(0, routeSearchParameters.getVehicleType()); Assert.assertFalse(routeSearchParameters.getFlexibleMode()); Assert.assertEquals(BordersExtractor.Avoid.CONTROLLED, routeSearchParameters.getAvoidBorders()); Assert.assertNull(routeSearchParameters.getBearings()); Assert.assertNull(routeSearchParameters.getMaximumRadiuses()); Assert.assertNull(routeSearchParameters.getOptions()); Assert.assertEquals(115, routeSearchParameters.getAvoidCountries()[0]); ProfileWeightingCollection weightings = routeSearchParameters.getProfileParameters().getWeightings(); ProfileWeighting weighting; Iterator<ProfileWeighting> iter = weightings.getIterator(); while (iter.hasNext() && (weighting = iter.next()) != null) { if (weighting.getName().equals("green")) { Assert.assertEquals(0.5, weighting.getParameters().getDouble("factor", -1), 0); } if (weighting.getName().equals("quiet")) { Assert.assertEquals(0.2, weighting.getParameters().getDouble("factor", -1), 0); } if (weighting.getName().equals("steepness_difficulty")) { Assert.assertEquals(3, weighting.getParameters().getInt("level", -1), 0); } } }
RouteSearchParameters processIsochronesRequestOptions(IsochronesRequest request, RouteSearchParameters parameters) throws StatusCodeException { RouteRequestOptions options = request.getIsochronesOptions(); parameters = new RouteRequestHandler().processRequestOptions(options, parameters); if (options.hasProfileParams()) parameters.setProfileParams(convertParameters(options, parameters.getProfileType())); return parameters; }
IsochronesRequestHandler extends GenericHandler { RouteSearchParameters processIsochronesRequestOptions(IsochronesRequest request, RouteSearchParameters parameters) throws StatusCodeException { RouteRequestOptions options = request.getIsochronesOptions(); parameters = new RouteRequestHandler().processRequestOptions(options, parameters); if (options.hasProfileParams()) parameters.setProfileParams(convertParameters(options, parameters.getProfileType())); return parameters; } }
IsochronesRequestHandler extends GenericHandler { RouteSearchParameters processIsochronesRequestOptions(IsochronesRequest request, RouteSearchParameters parameters) throws StatusCodeException { RouteRequestOptions options = request.getIsochronesOptions(); parameters = new RouteRequestHandler().processRequestOptions(options, parameters); if (options.hasProfileParams()) parameters.setProfileParams(convertParameters(options, parameters.getProfileType())); return parameters; } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { RouteSearchParameters processIsochronesRequestOptions(IsochronesRequest request, RouteSearchParameters parameters) throws StatusCodeException { RouteRequestOptions options = request.getIsochronesOptions(); parameters = new RouteRequestHandler().processRequestOptions(options, parameters); if (options.hasProfileParams()) parameters.setProfileParams(convertParameters(options, parameters.getProfileType())); return parameters; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { RouteSearchParameters processIsochronesRequestOptions(IsochronesRequest request, RouteSearchParameters parameters) throws StatusCodeException { RouteRequestOptions options = request.getIsochronesOptions(); parameters = new RouteRequestHandler().processRequestOptions(options, parameters); if (options.hasProfileParams()) parameters.setProfileParams(convertParameters(options, parameters.getProfileType())); return parameters; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void getIsoMapsTest() { IsochronesRequestHandler isochronesRequestHandler = new IsochronesRequestHandler(); Assert.assertNull(isochronesRequestHandler.getIsoMaps()); }
public IsochroneMapCollection getIsoMaps() { return isoMaps; }
IsochronesRequestHandler extends GenericHandler { public IsochroneMapCollection getIsoMaps() { return isoMaps; } }
IsochronesRequestHandler extends GenericHandler { public IsochroneMapCollection getIsoMaps() { return isoMaps; } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { public IsochroneMapCollection getIsoMaps() { return isoMaps; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { public IsochroneMapCollection getIsoMaps() { return isoMaps; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void getIsochroneRequestTest() { IsochronesRequestHandler isochronesRequestHandler = new IsochronesRequestHandler(); Assert.assertNull(isochronesRequestHandler.getIsochroneRequest()); }
public IsochroneRequest getIsochroneRequest() { return isochroneRequest; }
IsochronesRequestHandler extends GenericHandler { public IsochroneRequest getIsochroneRequest() { return isochroneRequest; } }
IsochronesRequestHandler extends GenericHandler { public IsochroneRequest getIsochroneRequest() { return isochroneRequest; } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { public IsochroneRequest getIsochroneRequest() { return isochroneRequest; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { public IsochroneRequest getIsochroneRequest() { return isochroneRequest; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
@Test public void convertAPIEnumListToStrings() { String[] strVals = handler.convertAPIEnumListToStrings(new APIEnums.ExtraInfo[] {APIEnums.ExtraInfo.STEEPNESS, APIEnums.ExtraInfo.SURFACE}); Assert.assertEquals(2, strVals.length); Assert.assertEquals("steepness", strVals[0]); Assert.assertEquals("surface", strVals[1]); }
protected String[] convertAPIEnumListToStrings(Enum[] valuesIn) { String[] attributes = new String[valuesIn.length]; for (int i = 0; i < valuesIn.length; i++) { attributes[i] = convertAPIEnum(valuesIn[i]); } return attributes; }
GenericHandler { protected String[] convertAPIEnumListToStrings(Enum[] valuesIn) { String[] attributes = new String[valuesIn.length]; for (int i = 0; i < valuesIn.length; i++) { attributes[i] = convertAPIEnum(valuesIn[i]); } return attributes; } }
GenericHandler { protected String[] convertAPIEnumListToStrings(Enum[] valuesIn) { String[] attributes = new String[valuesIn.length]; for (int i = 0; i < valuesIn.length; i++) { attributes[i] = convertAPIEnum(valuesIn[i]); } return attributes; } GenericHandler(); }
GenericHandler { protected String[] convertAPIEnumListToStrings(Enum[] valuesIn) { String[] attributes = new String[valuesIn.length]; for (int i = 0; i < valuesIn.length; i++) { attributes[i] = convertAPIEnum(valuesIn[i]); } return attributes; } GenericHandler(); }
GenericHandler { protected String[] convertAPIEnumListToStrings(Enum[] valuesIn) { String[] attributes = new String[valuesIn.length]; for (int i = 0; i < valuesIn.length; i++) { attributes[i] = convertAPIEnum(valuesIn[i]); } return attributes; } GenericHandler(); static final String KEY_PROFILE; }
@Test public void convertAPIEnum() { String strVal = handler.convertAPIEnum(APIEnums.AvoidBorders.CONTROLLED); Assert.assertEquals("controlled", strVal); }
protected String convertAPIEnum(Enum valuesIn) { return valuesIn.toString(); }
GenericHandler { protected String convertAPIEnum(Enum valuesIn) { return valuesIn.toString(); } }
GenericHandler { protected String convertAPIEnum(Enum valuesIn) { return valuesIn.toString(); } GenericHandler(); }
GenericHandler { protected String convertAPIEnum(Enum valuesIn) { return valuesIn.toString(); } GenericHandler(); }
GenericHandler { protected String convertAPIEnum(Enum valuesIn) { return valuesIn.toString(); } GenericHandler(); static final String KEY_PROFILE; }
@Test public void TestDetectSidewalkInfoFromTags() { ReaderWay way = new ReaderWay(1); way.setTag("sidewalk:left:surface", "asphalt"); assertTrue(processor.hasSidewalkInfo(way)); way = new ReaderWay(1); way.setTag("footway:right:width", "0.5"); assertTrue(processor.hasSidewalkInfo(way)); way = new ReaderWay(1); assertFalse(processor.hasSidewalkInfo(way)); }
protected boolean hasSidewalkInfo(ReaderWay way) { return identifySidesWhereSidewalkIsPresent(way) != Side.NONE; }
OSMAttachedSidewalkProcessor { protected boolean hasSidewalkInfo(ReaderWay way) { return identifySidesWhereSidewalkIsPresent(way) != Side.NONE; } }
OSMAttachedSidewalkProcessor { protected boolean hasSidewalkInfo(ReaderWay way) { return identifySidesWhereSidewalkIsPresent(way) != Side.NONE; } }
OSMAttachedSidewalkProcessor { protected boolean hasSidewalkInfo(ReaderWay way) { return identifySidesWhereSidewalkIsPresent(way) != Side.NONE; } ReaderWay attachSidewalkTag(ReaderWay way, Side side); Side getPreparedSide(ReaderWay way); }
OSMAttachedSidewalkProcessor { protected boolean hasSidewalkInfo(ReaderWay way) { return identifySidesWhereSidewalkIsPresent(way) != Side.NONE; } ReaderWay attachSidewalkTag(ReaderWay way, Side side); Side getPreparedSide(ReaderWay way); static final String KEY_ORS_SIDEWALK_SIDE; static final String VAL_RIGHT; static final String VAL_LEFT; }
@Test public void convertVehicleType() throws IncompatibleParameterException { int type = handler.convertVehicleType(APIEnums.VehicleType.HGV, 2); Assert.assertEquals(2, type); }
protected int convertVehicleType(APIEnums.VehicleType vehicleTypeIn, int profileType) throws IncompatibleParameterException { if (!RoutingProfileType.isHeavyVehicle(profileType)) { throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "vehicle_type", vehicleTypeIn.toString(), KEY_PROFILE, RoutingProfileType.getName(profileType)); } if (vehicleTypeIn == null) { return HeavyVehicleAttributes.UNKNOWN; } return HeavyVehicleAttributes.getFromString(vehicleTypeIn.toString()); }
GenericHandler { protected int convertVehicleType(APIEnums.VehicleType vehicleTypeIn, int profileType) throws IncompatibleParameterException { if (!RoutingProfileType.isHeavyVehicle(profileType)) { throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "vehicle_type", vehicleTypeIn.toString(), KEY_PROFILE, RoutingProfileType.getName(profileType)); } if (vehicleTypeIn == null) { return HeavyVehicleAttributes.UNKNOWN; } return HeavyVehicleAttributes.getFromString(vehicleTypeIn.toString()); } }
GenericHandler { protected int convertVehicleType(APIEnums.VehicleType vehicleTypeIn, int profileType) throws IncompatibleParameterException { if (!RoutingProfileType.isHeavyVehicle(profileType)) { throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "vehicle_type", vehicleTypeIn.toString(), KEY_PROFILE, RoutingProfileType.getName(profileType)); } if (vehicleTypeIn == null) { return HeavyVehicleAttributes.UNKNOWN; } return HeavyVehicleAttributes.getFromString(vehicleTypeIn.toString()); } GenericHandler(); }
GenericHandler { protected int convertVehicleType(APIEnums.VehicleType vehicleTypeIn, int profileType) throws IncompatibleParameterException { if (!RoutingProfileType.isHeavyVehicle(profileType)) { throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "vehicle_type", vehicleTypeIn.toString(), KEY_PROFILE, RoutingProfileType.getName(profileType)); } if (vehicleTypeIn == null) { return HeavyVehicleAttributes.UNKNOWN; } return HeavyVehicleAttributes.getFromString(vehicleTypeIn.toString()); } GenericHandler(); }
GenericHandler { protected int convertVehicleType(APIEnums.VehicleType vehicleTypeIn, int profileType) throws IncompatibleParameterException { if (!RoutingProfileType.isHeavyVehicle(profileType)) { throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "vehicle_type", vehicleTypeIn.toString(), KEY_PROFILE, RoutingProfileType.getName(profileType)); } if (vehicleTypeIn == null) { return HeavyVehicleAttributes.UNKNOWN; } return HeavyVehicleAttributes.getFromString(vehicleTypeIn.toString()); } GenericHandler(); static final String KEY_PROFILE; }
@Test(expected = IncompatibleParameterException.class) public void convertVehicleTypeError() throws IncompatibleParameterException { handler.convertVehicleType(APIEnums.VehicleType.HGV, 1); }
protected int convertVehicleType(APIEnums.VehicleType vehicleTypeIn, int profileType) throws IncompatibleParameterException { if (!RoutingProfileType.isHeavyVehicle(profileType)) { throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "vehicle_type", vehicleTypeIn.toString(), KEY_PROFILE, RoutingProfileType.getName(profileType)); } if (vehicleTypeIn == null) { return HeavyVehicleAttributes.UNKNOWN; } return HeavyVehicleAttributes.getFromString(vehicleTypeIn.toString()); }
GenericHandler { protected int convertVehicleType(APIEnums.VehicleType vehicleTypeIn, int profileType) throws IncompatibleParameterException { if (!RoutingProfileType.isHeavyVehicle(profileType)) { throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "vehicle_type", vehicleTypeIn.toString(), KEY_PROFILE, RoutingProfileType.getName(profileType)); } if (vehicleTypeIn == null) { return HeavyVehicleAttributes.UNKNOWN; } return HeavyVehicleAttributes.getFromString(vehicleTypeIn.toString()); } }
GenericHandler { protected int convertVehicleType(APIEnums.VehicleType vehicleTypeIn, int profileType) throws IncompatibleParameterException { if (!RoutingProfileType.isHeavyVehicle(profileType)) { throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "vehicle_type", vehicleTypeIn.toString(), KEY_PROFILE, RoutingProfileType.getName(profileType)); } if (vehicleTypeIn == null) { return HeavyVehicleAttributes.UNKNOWN; } return HeavyVehicleAttributes.getFromString(vehicleTypeIn.toString()); } GenericHandler(); }
GenericHandler { protected int convertVehicleType(APIEnums.VehicleType vehicleTypeIn, int profileType) throws IncompatibleParameterException { if (!RoutingProfileType.isHeavyVehicle(profileType)) { throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "vehicle_type", vehicleTypeIn.toString(), KEY_PROFILE, RoutingProfileType.getName(profileType)); } if (vehicleTypeIn == null) { return HeavyVehicleAttributes.UNKNOWN; } return HeavyVehicleAttributes.getFromString(vehicleTypeIn.toString()); } GenericHandler(); }
GenericHandler { protected int convertVehicleType(APIEnums.VehicleType vehicleTypeIn, int profileType) throws IncompatibleParameterException { if (!RoutingProfileType.isHeavyVehicle(profileType)) { throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "vehicle_type", vehicleTypeIn.toString(), KEY_PROFILE, RoutingProfileType.getName(profileType)); } if (vehicleTypeIn == null) { return HeavyVehicleAttributes.UNKNOWN; } return HeavyVehicleAttributes.getFromString(vehicleTypeIn.toString()); } GenericHandler(); static final String KEY_PROFILE; }
@Test public void convertAvoidBorders() { BordersExtractor.Avoid avoid = handler.convertAvoidBorders(APIEnums.AvoidBorders.CONTROLLED); Assert.assertEquals(BordersExtractor.Avoid.CONTROLLED, avoid); avoid = handler.convertAvoidBorders(APIEnums.AvoidBorders.ALL); Assert.assertEquals(BordersExtractor.Avoid.ALL, avoid); avoid = handler.convertAvoidBorders(APIEnums.AvoidBorders.NONE); Assert.assertEquals(BordersExtractor.Avoid.NONE, avoid); }
protected BordersExtractor.Avoid convertAvoidBorders(APIEnums.AvoidBorders avoidBorders) { if (avoidBorders != null) { switch (avoidBorders) { case ALL: return BordersExtractor.Avoid.ALL; case CONTROLLED: return BordersExtractor.Avoid.CONTROLLED; default: return BordersExtractor.Avoid.NONE; } } return null; }
GenericHandler { protected BordersExtractor.Avoid convertAvoidBorders(APIEnums.AvoidBorders avoidBorders) { if (avoidBorders != null) { switch (avoidBorders) { case ALL: return BordersExtractor.Avoid.ALL; case CONTROLLED: return BordersExtractor.Avoid.CONTROLLED; default: return BordersExtractor.Avoid.NONE; } } return null; } }
GenericHandler { protected BordersExtractor.Avoid convertAvoidBorders(APIEnums.AvoidBorders avoidBorders) { if (avoidBorders != null) { switch (avoidBorders) { case ALL: return BordersExtractor.Avoid.ALL; case CONTROLLED: return BordersExtractor.Avoid.CONTROLLED; default: return BordersExtractor.Avoid.NONE; } } return null; } GenericHandler(); }
GenericHandler { protected BordersExtractor.Avoid convertAvoidBorders(APIEnums.AvoidBorders avoidBorders) { if (avoidBorders != null) { switch (avoidBorders) { case ALL: return BordersExtractor.Avoid.ALL; case CONTROLLED: return BordersExtractor.Avoid.CONTROLLED; default: return BordersExtractor.Avoid.NONE; } } return null; } GenericHandler(); }
GenericHandler { protected BordersExtractor.Avoid convertAvoidBorders(APIEnums.AvoidBorders avoidBorders) { if (avoidBorders != null) { switch (avoidBorders) { case ALL: return BordersExtractor.Avoid.ALL; case CONTROLLED: return BordersExtractor.Avoid.CONTROLLED; default: return BordersExtractor.Avoid.NONE; } } return null; } GenericHandler(); static final String KEY_PROFILE; }
@Test public void convertRouteProfileType() { int type = handler.convertRouteProfileType(APIEnums.Profile.DRIVING_CAR); Assert.assertEquals(1, type); type = handler.convertRouteProfileType(APIEnums.Profile.FOOT_WALKING); Assert.assertEquals(20, type); }
protected int convertRouteProfileType(APIEnums.Profile profile) { return RoutingProfileType.getFromString(profile.toString()); }
GenericHandler { protected int convertRouteProfileType(APIEnums.Profile profile) { return RoutingProfileType.getFromString(profile.toString()); } }
GenericHandler { protected int convertRouteProfileType(APIEnums.Profile profile) { return RoutingProfileType.getFromString(profile.toString()); } GenericHandler(); }
GenericHandler { protected int convertRouteProfileType(APIEnums.Profile profile) { return RoutingProfileType.getFromString(profile.toString()); } GenericHandler(); }
GenericHandler { protected int convertRouteProfileType(APIEnums.Profile profile) { return RoutingProfileType.getFromString(profile.toString()); } GenericHandler(); static final String KEY_PROFILE; }
@Test public void convertAvoidAreas() throws StatusCodeException { JSONObject geomJSON = new JSONObject(); geomJSON.put("type", "Polygon"); JSONArray poly = generateGeoJSONPolyCoords(); JSONArray coords = new JSONArray(); coords.add(0, poly); geomJSON.put("coordinates", coords); Polygon[] avoidAreas = handler.convertAvoidAreas(geomJSON, 1); Assert.assertEquals(1, avoidAreas.length); Assert.assertEquals(4, avoidAreas[0].getCoordinates().length); Assert.assertEquals(1, avoidAreas[0].getCoordinates()[0].x, 0.0); JSONObject geomJSONMulti = new JSONObject(); geomJSONMulti.put("type", "MultiPolygon"); JSONArray polys1 = new JSONArray(); polys1.add(0, poly); JSONArray polys2 = new JSONArray(); polys2.add(0, poly); coords = new JSONArray(); coords.add(0,polys1); coords.add(0,polys2); geomJSONMulti.put("coordinates", coords); avoidAreas = handler.convertAvoidAreas(geomJSONMulti, 1); Assert.assertEquals(2, avoidAreas.length); }
protected Polygon[] convertAvoidAreas(JSONObject geoJson, int profileType) throws StatusCodeException { org.json.JSONObject complexJson = new org.json.JSONObject(); complexJson.put("type", geoJson.get("type")); List<List<Double[]>> coordinates = (List<List<Double[]>>) geoJson.get("coordinates"); complexJson.put("coordinates", coordinates); Geometry convertedGeom; try { convertedGeom = GeometryJSON.parse(complexJson); } catch (Exception e) { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } Polygon[] avoidAreas; if (convertedGeom instanceof Polygon) { avoidAreas = new Polygon[]{(Polygon) convertedGeom}; } else if (convertedGeom instanceof MultiPolygon) { MultiPolygon multiPoly = (MultiPolygon) convertedGeom; avoidAreas = new Polygon[multiPoly.getNumGeometries()]; for (int i = 0; i < multiPoly.getNumGeometries(); i++) avoidAreas[i] = (Polygon) multiPoly.getGeometryN(i); } else { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } return avoidAreas; }
GenericHandler { protected Polygon[] convertAvoidAreas(JSONObject geoJson, int profileType) throws StatusCodeException { org.json.JSONObject complexJson = new org.json.JSONObject(); complexJson.put("type", geoJson.get("type")); List<List<Double[]>> coordinates = (List<List<Double[]>>) geoJson.get("coordinates"); complexJson.put("coordinates", coordinates); Geometry convertedGeom; try { convertedGeom = GeometryJSON.parse(complexJson); } catch (Exception e) { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } Polygon[] avoidAreas; if (convertedGeom instanceof Polygon) { avoidAreas = new Polygon[]{(Polygon) convertedGeom}; } else if (convertedGeom instanceof MultiPolygon) { MultiPolygon multiPoly = (MultiPolygon) convertedGeom; avoidAreas = new Polygon[multiPoly.getNumGeometries()]; for (int i = 0; i < multiPoly.getNumGeometries(); i++) avoidAreas[i] = (Polygon) multiPoly.getGeometryN(i); } else { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } return avoidAreas; } }
GenericHandler { protected Polygon[] convertAvoidAreas(JSONObject geoJson, int profileType) throws StatusCodeException { org.json.JSONObject complexJson = new org.json.JSONObject(); complexJson.put("type", geoJson.get("type")); List<List<Double[]>> coordinates = (List<List<Double[]>>) geoJson.get("coordinates"); complexJson.put("coordinates", coordinates); Geometry convertedGeom; try { convertedGeom = GeometryJSON.parse(complexJson); } catch (Exception e) { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } Polygon[] avoidAreas; if (convertedGeom instanceof Polygon) { avoidAreas = new Polygon[]{(Polygon) convertedGeom}; } else if (convertedGeom instanceof MultiPolygon) { MultiPolygon multiPoly = (MultiPolygon) convertedGeom; avoidAreas = new Polygon[multiPoly.getNumGeometries()]; for (int i = 0; i < multiPoly.getNumGeometries(); i++) avoidAreas[i] = (Polygon) multiPoly.getGeometryN(i); } else { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } return avoidAreas; } GenericHandler(); }
GenericHandler { protected Polygon[] convertAvoidAreas(JSONObject geoJson, int profileType) throws StatusCodeException { org.json.JSONObject complexJson = new org.json.JSONObject(); complexJson.put("type", geoJson.get("type")); List<List<Double[]>> coordinates = (List<List<Double[]>>) geoJson.get("coordinates"); complexJson.put("coordinates", coordinates); Geometry convertedGeom; try { convertedGeom = GeometryJSON.parse(complexJson); } catch (Exception e) { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } Polygon[] avoidAreas; if (convertedGeom instanceof Polygon) { avoidAreas = new Polygon[]{(Polygon) convertedGeom}; } else if (convertedGeom instanceof MultiPolygon) { MultiPolygon multiPoly = (MultiPolygon) convertedGeom; avoidAreas = new Polygon[multiPoly.getNumGeometries()]; for (int i = 0; i < multiPoly.getNumGeometries(); i++) avoidAreas[i] = (Polygon) multiPoly.getGeometryN(i); } else { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } return avoidAreas; } GenericHandler(); }
GenericHandler { protected Polygon[] convertAvoidAreas(JSONObject geoJson, int profileType) throws StatusCodeException { org.json.JSONObject complexJson = new org.json.JSONObject(); complexJson.put("type", geoJson.get("type")); List<List<Double[]>> coordinates = (List<List<Double[]>>) geoJson.get("coordinates"); complexJson.put("coordinates", coordinates); Geometry convertedGeom; try { convertedGeom = GeometryJSON.parse(complexJson); } catch (Exception e) { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } Polygon[] avoidAreas; if (convertedGeom instanceof Polygon) { avoidAreas = new Polygon[]{(Polygon) convertedGeom}; } else if (convertedGeom instanceof MultiPolygon) { MultiPolygon multiPoly = (MultiPolygon) convertedGeom; avoidAreas = new Polygon[multiPoly.getNumGeometries()]; for (int i = 0; i < multiPoly.getNumGeometries(); i++) avoidAreas[i] = (Polygon) multiPoly.getGeometryN(i); } else { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } return avoidAreas; } GenericHandler(); static final String KEY_PROFILE; }
@Test(expected = ParameterValueException.class) public void convertAvoidAreasInvalidType() throws StatusCodeException { JSONObject geomJSON = new JSONObject(); geomJSON.put("type", "LineString"); JSONArray poly = generateGeoJSONPolyCoords(); geomJSON.put("coordinates", poly); handler.convertAvoidAreas(geomJSON, 1); }
protected Polygon[] convertAvoidAreas(JSONObject geoJson, int profileType) throws StatusCodeException { org.json.JSONObject complexJson = new org.json.JSONObject(); complexJson.put("type", geoJson.get("type")); List<List<Double[]>> coordinates = (List<List<Double[]>>) geoJson.get("coordinates"); complexJson.put("coordinates", coordinates); Geometry convertedGeom; try { convertedGeom = GeometryJSON.parse(complexJson); } catch (Exception e) { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } Polygon[] avoidAreas; if (convertedGeom instanceof Polygon) { avoidAreas = new Polygon[]{(Polygon) convertedGeom}; } else if (convertedGeom instanceof MultiPolygon) { MultiPolygon multiPoly = (MultiPolygon) convertedGeom; avoidAreas = new Polygon[multiPoly.getNumGeometries()]; for (int i = 0; i < multiPoly.getNumGeometries(); i++) avoidAreas[i] = (Polygon) multiPoly.getGeometryN(i); } else { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } return avoidAreas; }
GenericHandler { protected Polygon[] convertAvoidAreas(JSONObject geoJson, int profileType) throws StatusCodeException { org.json.JSONObject complexJson = new org.json.JSONObject(); complexJson.put("type", geoJson.get("type")); List<List<Double[]>> coordinates = (List<List<Double[]>>) geoJson.get("coordinates"); complexJson.put("coordinates", coordinates); Geometry convertedGeom; try { convertedGeom = GeometryJSON.parse(complexJson); } catch (Exception e) { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } Polygon[] avoidAreas; if (convertedGeom instanceof Polygon) { avoidAreas = new Polygon[]{(Polygon) convertedGeom}; } else if (convertedGeom instanceof MultiPolygon) { MultiPolygon multiPoly = (MultiPolygon) convertedGeom; avoidAreas = new Polygon[multiPoly.getNumGeometries()]; for (int i = 0; i < multiPoly.getNumGeometries(); i++) avoidAreas[i] = (Polygon) multiPoly.getGeometryN(i); } else { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } return avoidAreas; } }
GenericHandler { protected Polygon[] convertAvoidAreas(JSONObject geoJson, int profileType) throws StatusCodeException { org.json.JSONObject complexJson = new org.json.JSONObject(); complexJson.put("type", geoJson.get("type")); List<List<Double[]>> coordinates = (List<List<Double[]>>) geoJson.get("coordinates"); complexJson.put("coordinates", coordinates); Geometry convertedGeom; try { convertedGeom = GeometryJSON.parse(complexJson); } catch (Exception e) { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } Polygon[] avoidAreas; if (convertedGeom instanceof Polygon) { avoidAreas = new Polygon[]{(Polygon) convertedGeom}; } else if (convertedGeom instanceof MultiPolygon) { MultiPolygon multiPoly = (MultiPolygon) convertedGeom; avoidAreas = new Polygon[multiPoly.getNumGeometries()]; for (int i = 0; i < multiPoly.getNumGeometries(); i++) avoidAreas[i] = (Polygon) multiPoly.getGeometryN(i); } else { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } return avoidAreas; } GenericHandler(); }
GenericHandler { protected Polygon[] convertAvoidAreas(JSONObject geoJson, int profileType) throws StatusCodeException { org.json.JSONObject complexJson = new org.json.JSONObject(); complexJson.put("type", geoJson.get("type")); List<List<Double[]>> coordinates = (List<List<Double[]>>) geoJson.get("coordinates"); complexJson.put("coordinates", coordinates); Geometry convertedGeom; try { convertedGeom = GeometryJSON.parse(complexJson); } catch (Exception e) { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } Polygon[] avoidAreas; if (convertedGeom instanceof Polygon) { avoidAreas = new Polygon[]{(Polygon) convertedGeom}; } else if (convertedGeom instanceof MultiPolygon) { MultiPolygon multiPoly = (MultiPolygon) convertedGeom; avoidAreas = new Polygon[multiPoly.getNumGeometries()]; for (int i = 0; i < multiPoly.getNumGeometries(); i++) avoidAreas[i] = (Polygon) multiPoly.getGeometryN(i); } else { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } return avoidAreas; } GenericHandler(); }
GenericHandler { protected Polygon[] convertAvoidAreas(JSONObject geoJson, int profileType) throws StatusCodeException { org.json.JSONObject complexJson = new org.json.JSONObject(); complexJson.put("type", geoJson.get("type")); List<List<Double[]>> coordinates = (List<List<Double[]>>) geoJson.get("coordinates"); complexJson.put("coordinates", coordinates); Geometry convertedGeom; try { convertedGeom = GeometryJSON.parse(complexJson); } catch (Exception e) { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } Polygon[] avoidAreas; if (convertedGeom instanceof Polygon) { avoidAreas = new Polygon[]{(Polygon) convertedGeom}; } else if (convertedGeom instanceof MultiPolygon) { MultiPolygon multiPoly = (MultiPolygon) convertedGeom; avoidAreas = new Polygon[multiPoly.getNumGeometries()]; for (int i = 0; i < multiPoly.getNumGeometries(); i++) avoidAreas[i] = (Polygon) multiPoly.getGeometryN(i); } else { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } return avoidAreas; } GenericHandler(); static final String KEY_PROFILE; }
@Test(expected = ParameterValueException.class) public void convertAvoidAreasInvalidFeature() throws StatusCodeException { JSONObject geomJSON = new JSONObject(); geomJSON.put("type", "Polygon"); JSONArray poly = generateGeoJSONPolyCoords(); geomJSON.put("coooooooooooordinates", poly); handler.convertAvoidAreas(geomJSON, 1); }
protected Polygon[] convertAvoidAreas(JSONObject geoJson, int profileType) throws StatusCodeException { org.json.JSONObject complexJson = new org.json.JSONObject(); complexJson.put("type", geoJson.get("type")); List<List<Double[]>> coordinates = (List<List<Double[]>>) geoJson.get("coordinates"); complexJson.put("coordinates", coordinates); Geometry convertedGeom; try { convertedGeom = GeometryJSON.parse(complexJson); } catch (Exception e) { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } Polygon[] avoidAreas; if (convertedGeom instanceof Polygon) { avoidAreas = new Polygon[]{(Polygon) convertedGeom}; } else if (convertedGeom instanceof MultiPolygon) { MultiPolygon multiPoly = (MultiPolygon) convertedGeom; avoidAreas = new Polygon[multiPoly.getNumGeometries()]; for (int i = 0; i < multiPoly.getNumGeometries(); i++) avoidAreas[i] = (Polygon) multiPoly.getGeometryN(i); } else { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } return avoidAreas; }
GenericHandler { protected Polygon[] convertAvoidAreas(JSONObject geoJson, int profileType) throws StatusCodeException { org.json.JSONObject complexJson = new org.json.JSONObject(); complexJson.put("type", geoJson.get("type")); List<List<Double[]>> coordinates = (List<List<Double[]>>) geoJson.get("coordinates"); complexJson.put("coordinates", coordinates); Geometry convertedGeom; try { convertedGeom = GeometryJSON.parse(complexJson); } catch (Exception e) { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } Polygon[] avoidAreas; if (convertedGeom instanceof Polygon) { avoidAreas = new Polygon[]{(Polygon) convertedGeom}; } else if (convertedGeom instanceof MultiPolygon) { MultiPolygon multiPoly = (MultiPolygon) convertedGeom; avoidAreas = new Polygon[multiPoly.getNumGeometries()]; for (int i = 0; i < multiPoly.getNumGeometries(); i++) avoidAreas[i] = (Polygon) multiPoly.getGeometryN(i); } else { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } return avoidAreas; } }
GenericHandler { protected Polygon[] convertAvoidAreas(JSONObject geoJson, int profileType) throws StatusCodeException { org.json.JSONObject complexJson = new org.json.JSONObject(); complexJson.put("type", geoJson.get("type")); List<List<Double[]>> coordinates = (List<List<Double[]>>) geoJson.get("coordinates"); complexJson.put("coordinates", coordinates); Geometry convertedGeom; try { convertedGeom = GeometryJSON.parse(complexJson); } catch (Exception e) { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } Polygon[] avoidAreas; if (convertedGeom instanceof Polygon) { avoidAreas = new Polygon[]{(Polygon) convertedGeom}; } else if (convertedGeom instanceof MultiPolygon) { MultiPolygon multiPoly = (MultiPolygon) convertedGeom; avoidAreas = new Polygon[multiPoly.getNumGeometries()]; for (int i = 0; i < multiPoly.getNumGeometries(); i++) avoidAreas[i] = (Polygon) multiPoly.getGeometryN(i); } else { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } return avoidAreas; } GenericHandler(); }
GenericHandler { protected Polygon[] convertAvoidAreas(JSONObject geoJson, int profileType) throws StatusCodeException { org.json.JSONObject complexJson = new org.json.JSONObject(); complexJson.put("type", geoJson.get("type")); List<List<Double[]>> coordinates = (List<List<Double[]>>) geoJson.get("coordinates"); complexJson.put("coordinates", coordinates); Geometry convertedGeom; try { convertedGeom = GeometryJSON.parse(complexJson); } catch (Exception e) { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } Polygon[] avoidAreas; if (convertedGeom instanceof Polygon) { avoidAreas = new Polygon[]{(Polygon) convertedGeom}; } else if (convertedGeom instanceof MultiPolygon) { MultiPolygon multiPoly = (MultiPolygon) convertedGeom; avoidAreas = new Polygon[multiPoly.getNumGeometries()]; for (int i = 0; i < multiPoly.getNumGeometries(); i++) avoidAreas[i] = (Polygon) multiPoly.getGeometryN(i); } else { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } return avoidAreas; } GenericHandler(); }
GenericHandler { protected Polygon[] convertAvoidAreas(JSONObject geoJson, int profileType) throws StatusCodeException { org.json.JSONObject complexJson = new org.json.JSONObject(); complexJson.put("type", geoJson.get("type")); List<List<Double[]>> coordinates = (List<List<Double[]>>) geoJson.get("coordinates"); complexJson.put("coordinates", coordinates); Geometry convertedGeom; try { convertedGeom = GeometryJSON.parse(complexJson); } catch (Exception e) { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } Polygon[] avoidAreas; if (convertedGeom instanceof Polygon) { avoidAreas = new Polygon[]{(Polygon) convertedGeom}; } else if (convertedGeom instanceof MultiPolygon) { MultiPolygon multiPoly = (MultiPolygon) convertedGeom; avoidAreas = new Polygon[multiPoly.getNumGeometries()]; for (int i = 0; i < multiPoly.getNumGeometries(); i++) avoidAreas[i] = (Polygon) multiPoly.getGeometryN(i); } else { throw new ParameterValueException(getInvalidParameterValueErrorCode(), "avoid_polygons"); } return avoidAreas; } GenericHandler(); static final String KEY_PROFILE; }
@Test public void convertFeatureTypes() throws UnknownParameterValueException, IncompatibleParameterException { APIEnums.AvoidFeatures[] avoids = new APIEnums.AvoidFeatures[] { APIEnums.AvoidFeatures.FERRIES, APIEnums.AvoidFeatures.FORDS }; int converted = handler.convertFeatureTypes(avoids, 1); Assert.assertEquals(24, converted); }
protected int convertFeatureTypes(APIEnums.AvoidFeatures[] avoidFeatures, int profileType) throws UnknownParameterValueException, IncompatibleParameterException { int flags = 0; for (APIEnums.AvoidFeatures avoid : avoidFeatures) { String avoidFeatureName = avoid.toString(); int flag = AvoidFeatureFlags.getFromString(avoidFeatureName); if (flag == 0) throw new UnknownParameterValueException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName); if (!AvoidFeatureFlags.isValid(profileType, flag)) throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName, KEY_PROFILE, RoutingProfileType.getName(profileType)); flags |= flag; } return flags; }
GenericHandler { protected int convertFeatureTypes(APIEnums.AvoidFeatures[] avoidFeatures, int profileType) throws UnknownParameterValueException, IncompatibleParameterException { int flags = 0; for (APIEnums.AvoidFeatures avoid : avoidFeatures) { String avoidFeatureName = avoid.toString(); int flag = AvoidFeatureFlags.getFromString(avoidFeatureName); if (flag == 0) throw new UnknownParameterValueException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName); if (!AvoidFeatureFlags.isValid(profileType, flag)) throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName, KEY_PROFILE, RoutingProfileType.getName(profileType)); flags |= flag; } return flags; } }
GenericHandler { protected int convertFeatureTypes(APIEnums.AvoidFeatures[] avoidFeatures, int profileType) throws UnknownParameterValueException, IncompatibleParameterException { int flags = 0; for (APIEnums.AvoidFeatures avoid : avoidFeatures) { String avoidFeatureName = avoid.toString(); int flag = AvoidFeatureFlags.getFromString(avoidFeatureName); if (flag == 0) throw new UnknownParameterValueException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName); if (!AvoidFeatureFlags.isValid(profileType, flag)) throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName, KEY_PROFILE, RoutingProfileType.getName(profileType)); flags |= flag; } return flags; } GenericHandler(); }
GenericHandler { protected int convertFeatureTypes(APIEnums.AvoidFeatures[] avoidFeatures, int profileType) throws UnknownParameterValueException, IncompatibleParameterException { int flags = 0; for (APIEnums.AvoidFeatures avoid : avoidFeatures) { String avoidFeatureName = avoid.toString(); int flag = AvoidFeatureFlags.getFromString(avoidFeatureName); if (flag == 0) throw new UnknownParameterValueException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName); if (!AvoidFeatureFlags.isValid(profileType, flag)) throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName, KEY_PROFILE, RoutingProfileType.getName(profileType)); flags |= flag; } return flags; } GenericHandler(); }
GenericHandler { protected int convertFeatureTypes(APIEnums.AvoidFeatures[] avoidFeatures, int profileType) throws UnknownParameterValueException, IncompatibleParameterException { int flags = 0; for (APIEnums.AvoidFeatures avoid : avoidFeatures) { String avoidFeatureName = avoid.toString(); int flag = AvoidFeatureFlags.getFromString(avoidFeatureName); if (flag == 0) throw new UnknownParameterValueException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName); if (!AvoidFeatureFlags.isValid(profileType, flag)) throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName, KEY_PROFILE, RoutingProfileType.getName(profileType)); flags |= flag; } return flags; } GenericHandler(); static final String KEY_PROFILE; }
@Test(expected = IncompatibleParameterException.class) public void convertFeatureTypesIncompatible() throws UnknownParameterValueException, IncompatibleParameterException { APIEnums.AvoidFeatures[] avoids = new APIEnums.AvoidFeatures[] { APIEnums.AvoidFeatures.STEPS}; handler.convertFeatureTypes(avoids, 1); }
protected int convertFeatureTypes(APIEnums.AvoidFeatures[] avoidFeatures, int profileType) throws UnknownParameterValueException, IncompatibleParameterException { int flags = 0; for (APIEnums.AvoidFeatures avoid : avoidFeatures) { String avoidFeatureName = avoid.toString(); int flag = AvoidFeatureFlags.getFromString(avoidFeatureName); if (flag == 0) throw new UnknownParameterValueException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName); if (!AvoidFeatureFlags.isValid(profileType, flag)) throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName, KEY_PROFILE, RoutingProfileType.getName(profileType)); flags |= flag; } return flags; }
GenericHandler { protected int convertFeatureTypes(APIEnums.AvoidFeatures[] avoidFeatures, int profileType) throws UnknownParameterValueException, IncompatibleParameterException { int flags = 0; for (APIEnums.AvoidFeatures avoid : avoidFeatures) { String avoidFeatureName = avoid.toString(); int flag = AvoidFeatureFlags.getFromString(avoidFeatureName); if (flag == 0) throw new UnknownParameterValueException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName); if (!AvoidFeatureFlags.isValid(profileType, flag)) throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName, KEY_PROFILE, RoutingProfileType.getName(profileType)); flags |= flag; } return flags; } }
GenericHandler { protected int convertFeatureTypes(APIEnums.AvoidFeatures[] avoidFeatures, int profileType) throws UnknownParameterValueException, IncompatibleParameterException { int flags = 0; for (APIEnums.AvoidFeatures avoid : avoidFeatures) { String avoidFeatureName = avoid.toString(); int flag = AvoidFeatureFlags.getFromString(avoidFeatureName); if (flag == 0) throw new UnknownParameterValueException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName); if (!AvoidFeatureFlags.isValid(profileType, flag)) throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName, KEY_PROFILE, RoutingProfileType.getName(profileType)); flags |= flag; } return flags; } GenericHandler(); }
GenericHandler { protected int convertFeatureTypes(APIEnums.AvoidFeatures[] avoidFeatures, int profileType) throws UnknownParameterValueException, IncompatibleParameterException { int flags = 0; for (APIEnums.AvoidFeatures avoid : avoidFeatures) { String avoidFeatureName = avoid.toString(); int flag = AvoidFeatureFlags.getFromString(avoidFeatureName); if (flag == 0) throw new UnknownParameterValueException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName); if (!AvoidFeatureFlags.isValid(profileType, flag)) throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName, KEY_PROFILE, RoutingProfileType.getName(profileType)); flags |= flag; } return flags; } GenericHandler(); }
GenericHandler { protected int convertFeatureTypes(APIEnums.AvoidFeatures[] avoidFeatures, int profileType) throws UnknownParameterValueException, IncompatibleParameterException { int flags = 0; for (APIEnums.AvoidFeatures avoid : avoidFeatures) { String avoidFeatureName = avoid.toString(); int flag = AvoidFeatureFlags.getFromString(avoidFeatureName); if (flag == 0) throw new UnknownParameterValueException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName); if (!AvoidFeatureFlags.isValid(profileType, flag)) throw new IncompatibleParameterException(getInvalidParameterValueErrorCode(), "avoid_features", avoidFeatureName, KEY_PROFILE, RoutingProfileType.getName(profileType)); flags |= flag; } return flags; } GenericHandler(); static final String KEY_PROFILE; }
@Test public void convertParameters() throws StatusCodeException { RouteRequestOptions opts = new RouteRequestOptions(); RequestProfileParams params = new RequestProfileParams(); RequestProfileParamsRestrictions restrictions = new RequestProfileParamsRestrictions(); restrictions.setHeight(10.0f); params.setRestrictions(restrictions); opts.setVehicleType(APIEnums.VehicleType.HGV); opts.setProfileParams(params); ProfileParameters generatedParams = handler.convertParameters(opts, 2); Assert.assertEquals(10.0f, ((VehicleParameters)generatedParams).getHeight(), 0.0); }
protected ProfileParameters convertParameters(RouteRequestOptions options, int profileType) throws StatusCodeException { ProfileParameters params = new ProfileParameters(); if (options.getProfileParams().hasRestrictions()) { RequestProfileParamsRestrictions restrictions = options.getProfileParams().getRestrictions(); APIEnums.VehicleType vehicleType = options.getVehicleType(); validateRestrictionsForProfile(restrictions, profileType); params = convertSpecificProfileParameters(profileType, restrictions, vehicleType); } if (options.getProfileParams().hasWeightings()) { RequestProfileParamsWeightings weightings = options.getProfileParams().getWeightings(); applyWeightings(weightings, params); } return params; }
GenericHandler { protected ProfileParameters convertParameters(RouteRequestOptions options, int profileType) throws StatusCodeException { ProfileParameters params = new ProfileParameters(); if (options.getProfileParams().hasRestrictions()) { RequestProfileParamsRestrictions restrictions = options.getProfileParams().getRestrictions(); APIEnums.VehicleType vehicleType = options.getVehicleType(); validateRestrictionsForProfile(restrictions, profileType); params = convertSpecificProfileParameters(profileType, restrictions, vehicleType); } if (options.getProfileParams().hasWeightings()) { RequestProfileParamsWeightings weightings = options.getProfileParams().getWeightings(); applyWeightings(weightings, params); } return params; } }
GenericHandler { protected ProfileParameters convertParameters(RouteRequestOptions options, int profileType) throws StatusCodeException { ProfileParameters params = new ProfileParameters(); if (options.getProfileParams().hasRestrictions()) { RequestProfileParamsRestrictions restrictions = options.getProfileParams().getRestrictions(); APIEnums.VehicleType vehicleType = options.getVehicleType(); validateRestrictionsForProfile(restrictions, profileType); params = convertSpecificProfileParameters(profileType, restrictions, vehicleType); } if (options.getProfileParams().hasWeightings()) { RequestProfileParamsWeightings weightings = options.getProfileParams().getWeightings(); applyWeightings(weightings, params); } return params; } GenericHandler(); }
GenericHandler { protected ProfileParameters convertParameters(RouteRequestOptions options, int profileType) throws StatusCodeException { ProfileParameters params = new ProfileParameters(); if (options.getProfileParams().hasRestrictions()) { RequestProfileParamsRestrictions restrictions = options.getProfileParams().getRestrictions(); APIEnums.VehicleType vehicleType = options.getVehicleType(); validateRestrictionsForProfile(restrictions, profileType); params = convertSpecificProfileParameters(profileType, restrictions, vehicleType); } if (options.getProfileParams().hasWeightings()) { RequestProfileParamsWeightings weightings = options.getProfileParams().getWeightings(); applyWeightings(weightings, params); } return params; } GenericHandler(); }
GenericHandler { protected ProfileParameters convertParameters(RouteRequestOptions options, int profileType) throws StatusCodeException { ProfileParameters params = new ProfileParameters(); if (options.getProfileParams().hasRestrictions()) { RequestProfileParamsRestrictions restrictions = options.getProfileParams().getRestrictions(); APIEnums.VehicleType vehicleType = options.getVehicleType(); validateRestrictionsForProfile(restrictions, profileType); params = convertSpecificProfileParameters(profileType, restrictions, vehicleType); } if (options.getProfileParams().hasWeightings()) { RequestProfileParamsWeightings weightings = options.getProfileParams().getWeightings(); applyWeightings(weightings, params); } return params; } GenericHandler(); static final String KEY_PROFILE; }
@Test public void TestIdentificationOfSidesWithSidewalkInfo() { ReaderWay way = new ReaderWay(1); way.setTag("sidewalk:left:surface", "asphalt"); assertEquals(OSMAttachedSidewalkProcessor.Side.LEFT, processor.identifySidesWhereSidewalkIsPresent(way)); way = new ReaderWay(1); way.setTag("sidewalk", "both"); assertEquals(OSMAttachedSidewalkProcessor.Side.BOTH, processor.identifySidesWhereSidewalkIsPresent(way)); way = new ReaderWay(1); way.setTag("sidewalk", "none"); assertEquals(OSMAttachedSidewalkProcessor.Side.NONE, processor.identifySidesWhereSidewalkIsPresent(way)); way = new ReaderWay(1); way.setTag("footway:right:width", "0.5"); assertEquals(OSMAttachedSidewalkProcessor.Side.RIGHT, processor.identifySidesWhereSidewalkIsPresent(way)); }
protected Side identifySidesWhereSidewalkIsPresent(ReaderWay osmWay) { boolean sidewalkOnLeftSide = false; boolean sidewalkOnRightSide = false; boolean sidewalkOnBothSides = false; if(osmWay.hasTag("sidewalk")) { String side = osmWay.getTag("sidewalk"); switch(side) { case VAL_LEFT: sidewalkOnLeftSide = true; break; case VAL_RIGHT: sidewalkOnRightSide = true; break; case "both": sidewalkOnBothSides = true; break; default: } } Set<String> sidewalkProperties = getSidewalkKeys(osmWay); for(String key : sidewalkProperties) { if(key.startsWith("sidewalk:left") || key.startsWith("footway:left")) sidewalkOnLeftSide = true; if(key.startsWith("sidewalk:right") || key.startsWith("footway:right")) sidewalkOnRightSide = true; if(key.startsWith("sidewalk:both") || key.startsWith("footway:both")) sidewalkOnBothSides = true; } if(sidewalkOnLeftSide && sidewalkOnRightSide) { sidewalkOnBothSides = true; } if(sidewalkOnBothSides) { return Side.BOTH; } if(sidewalkOnLeftSide) { return Side.LEFT; } if(sidewalkOnRightSide) { return Side.RIGHT; } return Side.NONE; }
OSMAttachedSidewalkProcessor { protected Side identifySidesWhereSidewalkIsPresent(ReaderWay osmWay) { boolean sidewalkOnLeftSide = false; boolean sidewalkOnRightSide = false; boolean sidewalkOnBothSides = false; if(osmWay.hasTag("sidewalk")) { String side = osmWay.getTag("sidewalk"); switch(side) { case VAL_LEFT: sidewalkOnLeftSide = true; break; case VAL_RIGHT: sidewalkOnRightSide = true; break; case "both": sidewalkOnBothSides = true; break; default: } } Set<String> sidewalkProperties = getSidewalkKeys(osmWay); for(String key : sidewalkProperties) { if(key.startsWith("sidewalk:left") || key.startsWith("footway:left")) sidewalkOnLeftSide = true; if(key.startsWith("sidewalk:right") || key.startsWith("footway:right")) sidewalkOnRightSide = true; if(key.startsWith("sidewalk:both") || key.startsWith("footway:both")) sidewalkOnBothSides = true; } if(sidewalkOnLeftSide && sidewalkOnRightSide) { sidewalkOnBothSides = true; } if(sidewalkOnBothSides) { return Side.BOTH; } if(sidewalkOnLeftSide) { return Side.LEFT; } if(sidewalkOnRightSide) { return Side.RIGHT; } return Side.NONE; } }
OSMAttachedSidewalkProcessor { protected Side identifySidesWhereSidewalkIsPresent(ReaderWay osmWay) { boolean sidewalkOnLeftSide = false; boolean sidewalkOnRightSide = false; boolean sidewalkOnBothSides = false; if(osmWay.hasTag("sidewalk")) { String side = osmWay.getTag("sidewalk"); switch(side) { case VAL_LEFT: sidewalkOnLeftSide = true; break; case VAL_RIGHT: sidewalkOnRightSide = true; break; case "both": sidewalkOnBothSides = true; break; default: } } Set<String> sidewalkProperties = getSidewalkKeys(osmWay); for(String key : sidewalkProperties) { if(key.startsWith("sidewalk:left") || key.startsWith("footway:left")) sidewalkOnLeftSide = true; if(key.startsWith("sidewalk:right") || key.startsWith("footway:right")) sidewalkOnRightSide = true; if(key.startsWith("sidewalk:both") || key.startsWith("footway:both")) sidewalkOnBothSides = true; } if(sidewalkOnLeftSide && sidewalkOnRightSide) { sidewalkOnBothSides = true; } if(sidewalkOnBothSides) { return Side.BOTH; } if(sidewalkOnLeftSide) { return Side.LEFT; } if(sidewalkOnRightSide) { return Side.RIGHT; } return Side.NONE; } }
OSMAttachedSidewalkProcessor { protected Side identifySidesWhereSidewalkIsPresent(ReaderWay osmWay) { boolean sidewalkOnLeftSide = false; boolean sidewalkOnRightSide = false; boolean sidewalkOnBothSides = false; if(osmWay.hasTag("sidewalk")) { String side = osmWay.getTag("sidewalk"); switch(side) { case VAL_LEFT: sidewalkOnLeftSide = true; break; case VAL_RIGHT: sidewalkOnRightSide = true; break; case "both": sidewalkOnBothSides = true; break; default: } } Set<String> sidewalkProperties = getSidewalkKeys(osmWay); for(String key : sidewalkProperties) { if(key.startsWith("sidewalk:left") || key.startsWith("footway:left")) sidewalkOnLeftSide = true; if(key.startsWith("sidewalk:right") || key.startsWith("footway:right")) sidewalkOnRightSide = true; if(key.startsWith("sidewalk:both") || key.startsWith("footway:both")) sidewalkOnBothSides = true; } if(sidewalkOnLeftSide && sidewalkOnRightSide) { sidewalkOnBothSides = true; } if(sidewalkOnBothSides) { return Side.BOTH; } if(sidewalkOnLeftSide) { return Side.LEFT; } if(sidewalkOnRightSide) { return Side.RIGHT; } return Side.NONE; } ReaderWay attachSidewalkTag(ReaderWay way, Side side); Side getPreparedSide(ReaderWay way); }
OSMAttachedSidewalkProcessor { protected Side identifySidesWhereSidewalkIsPresent(ReaderWay osmWay) { boolean sidewalkOnLeftSide = false; boolean sidewalkOnRightSide = false; boolean sidewalkOnBothSides = false; if(osmWay.hasTag("sidewalk")) { String side = osmWay.getTag("sidewalk"); switch(side) { case VAL_LEFT: sidewalkOnLeftSide = true; break; case VAL_RIGHT: sidewalkOnRightSide = true; break; case "both": sidewalkOnBothSides = true; break; default: } } Set<String> sidewalkProperties = getSidewalkKeys(osmWay); for(String key : sidewalkProperties) { if(key.startsWith("sidewalk:left") || key.startsWith("footway:left")) sidewalkOnLeftSide = true; if(key.startsWith("sidewalk:right") || key.startsWith("footway:right")) sidewalkOnRightSide = true; if(key.startsWith("sidewalk:both") || key.startsWith("footway:both")) sidewalkOnBothSides = true; } if(sidewalkOnLeftSide && sidewalkOnRightSide) { sidewalkOnBothSides = true; } if(sidewalkOnBothSides) { return Side.BOTH; } if(sidewalkOnLeftSide) { return Side.LEFT; } if(sidewalkOnRightSide) { return Side.RIGHT; } return Side.NONE; } ReaderWay attachSidewalkTag(ReaderWay way, Side side); Side getPreparedSide(ReaderWay way); static final String KEY_ORS_SIDEWALK_SIDE; static final String VAL_RIGHT; static final String VAL_LEFT; }
@Test public void convertSpecificProfileParameters() { RequestProfileParamsRestrictions restrictions = new RequestProfileParamsRestrictions(); restrictions.setHeight(10.0f); ProfileParameters params = handler.convertSpecificProfileParameters(2, restrictions, APIEnums.VehicleType.HGV); Assert.assertTrue(params instanceof VehicleParameters); Assert.assertEquals(10.0f, ((VehicleParameters)params).getHeight(), 0.0); }
protected ProfileParameters convertSpecificProfileParameters(int profileType, RequestProfileParamsRestrictions restrictions, APIEnums.VehicleType vehicleType) { ProfileParameters params = new ProfileParameters(); if (RoutingProfileType.isHeavyVehicle(profileType)) params = convertHeavyVehicleParameters(restrictions, vehicleType); if (RoutingProfileType.isWheelchair(profileType)) params = convertWheelchairParameters(restrictions); return params; }
GenericHandler { protected ProfileParameters convertSpecificProfileParameters(int profileType, RequestProfileParamsRestrictions restrictions, APIEnums.VehicleType vehicleType) { ProfileParameters params = new ProfileParameters(); if (RoutingProfileType.isHeavyVehicle(profileType)) params = convertHeavyVehicleParameters(restrictions, vehicleType); if (RoutingProfileType.isWheelchair(profileType)) params = convertWheelchairParameters(restrictions); return params; } }
GenericHandler { protected ProfileParameters convertSpecificProfileParameters(int profileType, RequestProfileParamsRestrictions restrictions, APIEnums.VehicleType vehicleType) { ProfileParameters params = new ProfileParameters(); if (RoutingProfileType.isHeavyVehicle(profileType)) params = convertHeavyVehicleParameters(restrictions, vehicleType); if (RoutingProfileType.isWheelchair(profileType)) params = convertWheelchairParameters(restrictions); return params; } GenericHandler(); }
GenericHandler { protected ProfileParameters convertSpecificProfileParameters(int profileType, RequestProfileParamsRestrictions restrictions, APIEnums.VehicleType vehicleType) { ProfileParameters params = new ProfileParameters(); if (RoutingProfileType.isHeavyVehicle(profileType)) params = convertHeavyVehicleParameters(restrictions, vehicleType); if (RoutingProfileType.isWheelchair(profileType)) params = convertWheelchairParameters(restrictions); return params; } GenericHandler(); }
GenericHandler { protected ProfileParameters convertSpecificProfileParameters(int profileType, RequestProfileParamsRestrictions restrictions, APIEnums.VehicleType vehicleType) { ProfileParameters params = new ProfileParameters(); if (RoutingProfileType.isHeavyVehicle(profileType)) params = convertHeavyVehicleParameters(restrictions, vehicleType); if (RoutingProfileType.isWheelchair(profileType)) params = convertWheelchairParameters(restrictions); return params; } GenericHandler(); static final String KEY_PROFILE; }
@Test public void testCalculateContour() { GraphHopperStorage graphHopperStorage = ToyGraphCreationUtil.createSimpleGraph(encodingManager); createMockStorages(graphHopperStorage); Contour contour = new Contour(graphHopperStorage, graphHopperStorage.getBaseGraph().getNodeAccess(), ins, cs); contour.calculateContour(); List<Double> coordinatesCell2 = cs.getCellContourOrder(2); assertEquals(2686, coordinatesCell2.size()); assertEquals(3.0, coordinatesCell2.get(0), 1e-10); assertEquals(1.0, coordinatesCell2.get(1), 1e-10); assertEquals(3.0, coordinatesCell2.get(2), 1e-10); assertEquals(1.003596954128078, coordinatesCell2.get(3), 1e-10); assertEquals(3.0, coordinatesCell2.get(2684), 1e-10); assertEquals(1.0, coordinatesCell2.get(2685), 1e-10); }
public void calculateContour() { handleBaseCells(); cellStorage.flush(); IntObjectMap<IntHashSet> superCells = handleSuperCells(); cellStorage.storeContourPointerMap(); if (isSupercellsEnabled()) cellStorage.storeSuperCells(superCells); cellStorage.setContourPrepared(true); cellStorage.flush(); }
Contour { public void calculateContour() { handleBaseCells(); cellStorage.flush(); IntObjectMap<IntHashSet> superCells = handleSuperCells(); cellStorage.storeContourPointerMap(); if (isSupercellsEnabled()) cellStorage.storeSuperCells(superCells); cellStorage.setContourPrepared(true); cellStorage.flush(); } }
Contour { public void calculateContour() { handleBaseCells(); cellStorage.flush(); IntObjectMap<IntHashSet> superCells = handleSuperCells(); cellStorage.storeContourPointerMap(); if (isSupercellsEnabled()) cellStorage.storeSuperCells(superCells); cellStorage.setContourPrepared(true); cellStorage.flush(); } Contour(GraphHopperStorage ghStorage, NodeAccess nodeAccess, IsochroneNodeStorage isochroneNodeStorage, CellStorage cellStorage); }
Contour { public void calculateContour() { handleBaseCells(); cellStorage.flush(); IntObjectMap<IntHashSet> superCells = handleSuperCells(); cellStorage.storeContourPointerMap(); if (isSupercellsEnabled()) cellStorage.storeSuperCells(superCells); cellStorage.setContourPrepared(true); cellStorage.flush(); } Contour(GraphHopperStorage ghStorage, NodeAccess nodeAccess, IsochroneNodeStorage isochroneNodeStorage, CellStorage cellStorage); static double distance(double lat1, double lat2, double lon1, double lon2); void calculateContour(); Contour setGhStorage(GraphHopperStorage ghStorage); }
Contour { public void calculateContour() { handleBaseCells(); cellStorage.flush(); IntObjectMap<IntHashSet> superCells = handleSuperCells(); cellStorage.storeContourPointerMap(); if (isSupercellsEnabled()) cellStorage.storeSuperCells(superCells); cellStorage.setContourPrepared(true); cellStorage.flush(); } Contour(GraphHopperStorage ghStorage, NodeAccess nodeAccess, IsochroneNodeStorage isochroneNodeStorage, CellStorage cellStorage); static double distance(double lat1, double lat2, double lon1, double lon2); void calculateContour(); Contour setGhStorage(GraphHopperStorage ghStorage); }
@Test public void testDistance() { double distance = Contour.distance(1, 1, 1, 2); assertEquals(111177.99068882648, distance, 1e-10); double distance2 = Contour.distance(1, 1, 0.5, -0.5); assertEquals(111177.99068882648, distance2, 1e-10); }
public static double distance(double lat1, double lat2, double lon1, double lon2) { final int R = 6371; double latDistance = Math.toRadians(lat2 - lat1); double lonDistance = Math.toRadians(lon2 - lon1); double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2); double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); double distance = R * c * 1000; distance = Math.pow(distance, 2); return Math.sqrt(distance); }
Contour { public static double distance(double lat1, double lat2, double lon1, double lon2) { final int R = 6371; double latDistance = Math.toRadians(lat2 - lat1); double lonDistance = Math.toRadians(lon2 - lon1); double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2); double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); double distance = R * c * 1000; distance = Math.pow(distance, 2); return Math.sqrt(distance); } }
Contour { public static double distance(double lat1, double lat2, double lon1, double lon2) { final int R = 6371; double latDistance = Math.toRadians(lat2 - lat1); double lonDistance = Math.toRadians(lon2 - lon1); double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2); double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); double distance = R * c * 1000; distance = Math.pow(distance, 2); return Math.sqrt(distance); } Contour(GraphHopperStorage ghStorage, NodeAccess nodeAccess, IsochroneNodeStorage isochroneNodeStorage, CellStorage cellStorage); }
Contour { public static double distance(double lat1, double lat2, double lon1, double lon2) { final int R = 6371; double latDistance = Math.toRadians(lat2 - lat1); double lonDistance = Math.toRadians(lon2 - lon1); double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2); double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); double distance = R * c * 1000; distance = Math.pow(distance, 2); return Math.sqrt(distance); } Contour(GraphHopperStorage ghStorage, NodeAccess nodeAccess, IsochroneNodeStorage isochroneNodeStorage, CellStorage cellStorage); static double distance(double lat1, double lat2, double lon1, double lon2); void calculateContour(); Contour setGhStorage(GraphHopperStorage ghStorage); }
Contour { public static double distance(double lat1, double lat2, double lon1, double lon2) { final int R = 6371; double latDistance = Math.toRadians(lat2 - lat1); double lonDistance = Math.toRadians(lon2 - lon1); double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2); double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); double distance = R * c * 1000; distance = Math.pow(distance, 2); return Math.sqrt(distance); } Contour(GraphHopperStorage ghStorage, NodeAccess nodeAccess, IsochroneNodeStorage isochroneNodeStorage, CellStorage cellStorage); static double distance(double lat1, double lat2, double lon1, double lon2); void calculateContour(); Contour setGhStorage(GraphHopperStorage ghStorage); }
@Test public void testExactWeightActiveCell() { GraphHopperStorage graphHopperStorage = ToyGraphCreationUtil.createMediumGraphWithAdditionalEdge(encodingManager); Weighting shortestWeighting = new ShortestWeighting(carEncoder); createMockStorages(graphHopperStorage); Eccentricity ecc = new Eccentricity(graphHopperStorage, null, ins, cs); ecc.loadExisting(shortestWeighting); ecc.calcEccentricities(shortestWeighting, carEncoder); ecc.calcBorderNodeDistances(shortestWeighting, carEncoder); FastIsochroneAlgorithm fastIsochroneAlgorithm = new FastIsochroneAlgorithm( graphHopperStorage.getBaseGraph(), shortestWeighting, TraversalMode.NODE_BASED, cs, ins, ecc.getEccentricityStorage(shortestWeighting), ecc.getBorderNodeDistanceStorage(shortestWeighting), null); fastIsochroneAlgorithm.calcIsochroneNodes(1, 5.0); Set<Integer> nodeIds = new HashSet<>(); Set<Integer> expectedNodeIds = new HashSet<>(); expectedNodeIds.add(4); expectedNodeIds.add(7); for (IntObjectCursor<SPTEntry> entry : fastIsochroneAlgorithm.getActiveCellMaps().get(3)) { nodeIds.add(entry.value.adjNode); } assertEquals(expectedNodeIds, nodeIds); assertEquals(5.0, fastIsochroneAlgorithm.getActiveCellMaps().get(3).get(4).weight, 1e-10); assertEquals(5.0, fastIsochroneAlgorithm.getActiveCellMaps().get(3).get(7).weight, 1e-10); }
public Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps() { return activeCellMaps; }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps() { return activeCellMaps; } }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps() { return activeCellMaps; } FastIsochroneAlgorithm(Graph graph, Weighting weighting, TraversalMode tMode, CellStorage cellStorage, IsochroneNodeStorage isochroneNodeStorage, EccentricityStorage eccentricityStorage, BorderNodeDistanceStorage borderNodeDistanceStorage, EdgeFilter additionalEdgeFilter); }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps() { return activeCellMaps; } FastIsochroneAlgorithm(Graph graph, Weighting weighting, TraversalMode tMode, CellStorage cellStorage, IsochroneNodeStorage isochroneNodeStorage, EccentricityStorage eccentricityStorage, BorderNodeDistanceStorage borderNodeDistanceStorage, EdgeFilter additionalEdgeFilter); @Override void init(int from, double isochroneLimit); @Override boolean finishedStartCellPhase(); @Override boolean finishedBorderNodePhase(); @Override boolean finishedActiveCellPhase(); Set<Integer> getFullyReachableCells(); IntObjectMap<SPTEntry> getStartCellMap(); String getName(); Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps(); }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps() { return activeCellMaps; } FastIsochroneAlgorithm(Graph graph, Weighting weighting, TraversalMode tMode, CellStorage cellStorage, IsochroneNodeStorage isochroneNodeStorage, EccentricityStorage eccentricityStorage, BorderNodeDistanceStorage borderNodeDistanceStorage, EdgeFilter additionalEdgeFilter); @Override void init(int from, double isochroneLimit); @Override boolean finishedStartCellPhase(); @Override boolean finishedBorderNodePhase(); @Override boolean finishedActiveCellPhase(); Set<Integer> getFullyReachableCells(); IntObjectMap<SPTEntry> getStartCellMap(); String getName(); Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps(); }
@Test public void testLimitInBetweenNodesActiveCell() { GraphHopperStorage graphHopperStorage = ToyGraphCreationUtil.createMediumGraphWithAdditionalEdge(encodingManager); Weighting shortestWeighting = new ShortestWeighting(carEncoder); createMockStorages(graphHopperStorage); Eccentricity ecc = new Eccentricity(graphHopperStorage, null, ins, cs); ecc.loadExisting(shortestWeighting); ecc.calcEccentricities(shortestWeighting, carEncoder); ecc.calcBorderNodeDistances(shortestWeighting, carEncoder); FastIsochroneAlgorithm fastIsochroneAlgorithm = new FastIsochroneAlgorithm( graphHopperStorage.getBaseGraph(), shortestWeighting, TraversalMode.NODE_BASED, cs, ins, ecc.getEccentricityStorage(shortestWeighting), ecc.getBorderNodeDistanceStorage(shortestWeighting), null); fastIsochroneAlgorithm.calcIsochroneNodes(1, 5.5); Set<Integer> nodeIds = new HashSet<>(); Set<Integer> expectedNodeIds = new HashSet<>(); expectedNodeIds.add(4); expectedNodeIds.add(5); expectedNodeIds.add(6); expectedNodeIds.add(7); for (IntObjectCursor<SPTEntry> entry : fastIsochroneAlgorithm.getActiveCellMaps().get(3)) { nodeIds.add(entry.value.adjNode); } assertEquals(expectedNodeIds, nodeIds); assertEquals(5.0, fastIsochroneAlgorithm.getActiveCellMaps().get(3).get(4).weight, 1e-10); assertEquals(6.0, fastIsochroneAlgorithm.getActiveCellMaps().get(3).get(5).weight, 1e-10); assertEquals(6.0, fastIsochroneAlgorithm.getActiveCellMaps().get(3).get(6).weight, 1e-10); assertEquals(5.0, fastIsochroneAlgorithm.getActiveCellMaps().get(3).get(7).weight, 1e-10); }
public Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps() { return activeCellMaps; }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps() { return activeCellMaps; } }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps() { return activeCellMaps; } FastIsochroneAlgorithm(Graph graph, Weighting weighting, TraversalMode tMode, CellStorage cellStorage, IsochroneNodeStorage isochroneNodeStorage, EccentricityStorage eccentricityStorage, BorderNodeDistanceStorage borderNodeDistanceStorage, EdgeFilter additionalEdgeFilter); }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps() { return activeCellMaps; } FastIsochroneAlgorithm(Graph graph, Weighting weighting, TraversalMode tMode, CellStorage cellStorage, IsochroneNodeStorage isochroneNodeStorage, EccentricityStorage eccentricityStorage, BorderNodeDistanceStorage borderNodeDistanceStorage, EdgeFilter additionalEdgeFilter); @Override void init(int from, double isochroneLimit); @Override boolean finishedStartCellPhase(); @Override boolean finishedBorderNodePhase(); @Override boolean finishedActiveCellPhase(); Set<Integer> getFullyReachableCells(); IntObjectMap<SPTEntry> getStartCellMap(); String getName(); Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps(); }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps() { return activeCellMaps; } FastIsochroneAlgorithm(Graph graph, Weighting weighting, TraversalMode tMode, CellStorage cellStorage, IsochroneNodeStorage isochroneNodeStorage, EccentricityStorage eccentricityStorage, BorderNodeDistanceStorage borderNodeDistanceStorage, EdgeFilter additionalEdgeFilter); @Override void init(int from, double isochroneLimit); @Override boolean finishedStartCellPhase(); @Override boolean finishedBorderNodePhase(); @Override boolean finishedActiveCellPhase(); Set<Integer> getFullyReachableCells(); IntObjectMap<SPTEntry> getStartCellMap(); String getName(); Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps(); }
@Test public void testStartCell() { GraphHopperStorage graphHopperStorage = ToyGraphCreationUtil.createMediumGraphWithAdditionalEdge(encodingManager); Weighting shortestWeighting = new ShortestWeighting(carEncoder); createMockStorages(graphHopperStorage); Eccentricity ecc = new Eccentricity(graphHopperStorage, null, ins, cs); ecc.loadExisting(shortestWeighting); ecc.calcEccentricities(shortestWeighting, carEncoder); ecc.calcBorderNodeDistances(shortestWeighting, carEncoder); FastIsochroneAlgorithm fastIsochroneAlgorithm = new FastIsochroneAlgorithm( graphHopperStorage.getBaseGraph(), shortestWeighting, TraversalMode.NODE_BASED, cs, ins, ecc.getEccentricityStorage(shortestWeighting), ecc.getBorderNodeDistanceStorage(shortestWeighting), null); fastIsochroneAlgorithm.calcIsochroneNodes(1, 5.5); Set<Integer> nodeIds = new HashSet<>(); Set<Integer> expectedNodeIds = new HashSet<>(); expectedNodeIds.add(0); expectedNodeIds.add(1); expectedNodeIds.add(2); expectedNodeIds.add(3); expectedNodeIds.add(8); for (IntObjectCursor<SPTEntry> entry : fastIsochroneAlgorithm.getStartCellMap()) { nodeIds.add(entry.value.adjNode); } assertEquals(expectedNodeIds, nodeIds); assertEquals(1.0, fastIsochroneAlgorithm.getStartCellMap().get(0).weight, 1e-10); assertEquals(0.0, fastIsochroneAlgorithm.getStartCellMap().get(1).weight, 1e-10); assertEquals(1.0, fastIsochroneAlgorithm.getStartCellMap().get(2).weight, 1e-10); assertEquals(3.0, fastIsochroneAlgorithm.getStartCellMap().get(3).weight, 1e-10); assertEquals(2.0, fastIsochroneAlgorithm.getStartCellMap().get(8).weight, 1e-10); }
public IntObjectMap<SPTEntry> getStartCellMap() { return startCellMap; }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public IntObjectMap<SPTEntry> getStartCellMap() { return startCellMap; } }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public IntObjectMap<SPTEntry> getStartCellMap() { return startCellMap; } FastIsochroneAlgorithm(Graph graph, Weighting weighting, TraversalMode tMode, CellStorage cellStorage, IsochroneNodeStorage isochroneNodeStorage, EccentricityStorage eccentricityStorage, BorderNodeDistanceStorage borderNodeDistanceStorage, EdgeFilter additionalEdgeFilter); }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public IntObjectMap<SPTEntry> getStartCellMap() { return startCellMap; } FastIsochroneAlgorithm(Graph graph, Weighting weighting, TraversalMode tMode, CellStorage cellStorage, IsochroneNodeStorage isochroneNodeStorage, EccentricityStorage eccentricityStorage, BorderNodeDistanceStorage borderNodeDistanceStorage, EdgeFilter additionalEdgeFilter); @Override void init(int from, double isochroneLimit); @Override boolean finishedStartCellPhase(); @Override boolean finishedBorderNodePhase(); @Override boolean finishedActiveCellPhase(); Set<Integer> getFullyReachableCells(); IntObjectMap<SPTEntry> getStartCellMap(); String getName(); Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps(); }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public IntObjectMap<SPTEntry> getStartCellMap() { return startCellMap; } FastIsochroneAlgorithm(Graph graph, Weighting weighting, TraversalMode tMode, CellStorage cellStorage, IsochroneNodeStorage isochroneNodeStorage, EccentricityStorage eccentricityStorage, BorderNodeDistanceStorage borderNodeDistanceStorage, EdgeFilter additionalEdgeFilter); @Override void init(int from, double isochroneLimit); @Override boolean finishedStartCellPhase(); @Override boolean finishedBorderNodePhase(); @Override boolean finishedActiveCellPhase(); Set<Integer> getFullyReachableCells(); IntObjectMap<SPTEntry> getStartCellMap(); String getName(); Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps(); }
@Test public void testFullyReachableCells() { GraphHopperStorage graphHopperStorage = ToyGraphCreationUtil.createMediumGraphWithAdditionalEdge(encodingManager); Weighting shortestWeighting = new ShortestWeighting(carEncoder); createMockStorages(graphHopperStorage); Eccentricity ecc = new Eccentricity(graphHopperStorage, null, ins, cs); ecc.loadExisting(shortestWeighting); ecc.calcEccentricities(shortestWeighting, carEncoder); ecc.calcBorderNodeDistances(shortestWeighting, carEncoder); FastIsochroneAlgorithm fastIsochroneAlgorithm = new FastIsochroneAlgorithm( graphHopperStorage.getBaseGraph(), shortestWeighting, TraversalMode.NODE_BASED, cs, ins, ecc.getEccentricityStorage(shortestWeighting), ecc.getBorderNodeDistanceStorage(shortestWeighting), null); fastIsochroneAlgorithm.calcIsochroneNodes(1, 5.5); Set<Integer> cellIds = fastIsochroneAlgorithm.getFullyReachableCells(); Set<Integer> expectedCellIds = new HashSet<>(); assertEquals(expectedCellIds, cellIds); fastIsochroneAlgorithm = new FastIsochroneAlgorithm( graphHopperStorage.getBaseGraph(), shortestWeighting, TraversalMode.NODE_BASED, cs, ins, ecc.getEccentricityStorage(shortestWeighting), ecc.getBorderNodeDistanceStorage(shortestWeighting), null); fastIsochroneAlgorithm.calcIsochroneNodes(1, 6); cellIds = fastIsochroneAlgorithm.getFullyReachableCells(); expectedCellIds = new HashSet<>(); expectedCellIds.add(2); assertEquals(expectedCellIds, cellIds); fastIsochroneAlgorithm = new FastIsochroneAlgorithm( graphHopperStorage.getBaseGraph(), shortestWeighting, TraversalMode.NODE_BASED, cs, ins, ecc.getEccentricityStorage(shortestWeighting), ecc.getBorderNodeDistanceStorage(shortestWeighting), null); fastIsochroneAlgorithm.calcIsochroneNodes(8, 6); cellIds = fastIsochroneAlgorithm.getFullyReachableCells(); expectedCellIds = new HashSet<>(); expectedCellIds.add(2); expectedCellIds.add(3); assertEquals(expectedCellIds, cellIds); }
public Set<Integer> getFullyReachableCells() { return fullyReachableCells; }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public Set<Integer> getFullyReachableCells() { return fullyReachableCells; } }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public Set<Integer> getFullyReachableCells() { return fullyReachableCells; } FastIsochroneAlgorithm(Graph graph, Weighting weighting, TraversalMode tMode, CellStorage cellStorage, IsochroneNodeStorage isochroneNodeStorage, EccentricityStorage eccentricityStorage, BorderNodeDistanceStorage borderNodeDistanceStorage, EdgeFilter additionalEdgeFilter); }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public Set<Integer> getFullyReachableCells() { return fullyReachableCells; } FastIsochroneAlgorithm(Graph graph, Weighting weighting, TraversalMode tMode, CellStorage cellStorage, IsochroneNodeStorage isochroneNodeStorage, EccentricityStorage eccentricityStorage, BorderNodeDistanceStorage borderNodeDistanceStorage, EdgeFilter additionalEdgeFilter); @Override void init(int from, double isochroneLimit); @Override boolean finishedStartCellPhase(); @Override boolean finishedBorderNodePhase(); @Override boolean finishedActiveCellPhase(); Set<Integer> getFullyReachableCells(); IntObjectMap<SPTEntry> getStartCellMap(); String getName(); Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps(); }
FastIsochroneAlgorithm extends AbstractIsochroneAlgorithm { public Set<Integer> getFullyReachableCells() { return fullyReachableCells; } FastIsochroneAlgorithm(Graph graph, Weighting weighting, TraversalMode tMode, CellStorage cellStorage, IsochroneNodeStorage isochroneNodeStorage, EccentricityStorage eccentricityStorage, BorderNodeDistanceStorage borderNodeDistanceStorage, EdgeFilter additionalEdgeFilter); @Override void init(int from, double isochroneLimit); @Override boolean finishedStartCellPhase(); @Override boolean finishedBorderNodePhase(); @Override boolean finishedActiveCellPhase(); Set<Integer> getFullyReachableCells(); IntObjectMap<SPTEntry> getStartCellMap(); String getName(); Map<Integer, IntObjectMap<SPTEntry>> getActiveCellMaps(); }
@Test public void testAddInitialBorderNode() { GraphHopperStorage graphHopperStorage = ToyGraphCreationUtil.createMediumGraph(encodingManager); createMockStorages(graphHopperStorage); Weighting shortestWeighting = new ShortestWeighting(carEncoder); ActiveCellDijkstra activeCellDijkstra = new ActiveCellDijkstra(graphHopperStorage.getBaseGraph(), shortestWeighting, ins, 2); activeCellDijkstra.setIsochroneLimit(5000); for (int nodeId : new int[]{3, 8}) { activeCellDijkstra.addInitialBordernode(nodeId, 0); } SPTEntry entry = activeCellDijkstra.fromHeap.poll(); assertEquals(3, entry.adjNode); assertEquals(0.0, entry.getWeightOfVisitedPath(), 1e-10); entry = activeCellDijkstra.fromHeap.poll(); assertEquals(8, entry.adjNode); assertEquals(0.0, entry.getWeightOfVisitedPath(), 1e-10); assertEquals(2, activeCellDijkstra.getFromMap().size()); }
protected void addInitialBordernode(int nodeId, double weight) { SPTEntry entry = new SPTEntry(nodeId, weight); fromHeap.add(entry); fromMap.put(nodeId, entry); }
ActiveCellDijkstra extends AbstractIsochroneDijkstra { protected void addInitialBordernode(int nodeId, double weight) { SPTEntry entry = new SPTEntry(nodeId, weight); fromHeap.add(entry); fromMap.put(nodeId, entry); } }
ActiveCellDijkstra extends AbstractIsochroneDijkstra { protected void addInitialBordernode(int nodeId, double weight) { SPTEntry entry = new SPTEntry(nodeId, weight); fromHeap.add(entry); fromMap.put(nodeId, entry); } ActiveCellDijkstra(Graph graph, Weighting weighting, IsochroneNodeStorage isochroneNodeStorage, int cellId); }
ActiveCellDijkstra extends AbstractIsochroneDijkstra { protected void addInitialBordernode(int nodeId, double weight) { SPTEntry entry = new SPTEntry(nodeId, weight); fromHeap.add(entry); fromMap.put(nodeId, entry); } ActiveCellDijkstra(Graph graph, Weighting weighting, IsochroneNodeStorage isochroneNodeStorage, int cellId); void setIsochroneLimit(double limit); @Override String getName(); }
ActiveCellDijkstra extends AbstractIsochroneDijkstra { protected void addInitialBordernode(int nodeId, double weight) { SPTEntry entry = new SPTEntry(nodeId, weight); fromHeap.add(entry); fromMap.put(nodeId, entry); } ActiveCellDijkstra(Graph graph, Weighting weighting, IsochroneNodeStorage isochroneNodeStorage, int cellId); void setIsochroneLimit(double limit); @Override String getName(); }
@Test public void testGetMaxWeight() { GraphHopperStorage graphHopperStorage = createSimpleGraph(); RangeDijkstra rangeDijkstra = new RangeDijkstra(graphHopperStorage.getBaseGraph(), new ShortestWeighting(carEncoder)); rangeDijkstra.setMaxVisitedNodes(getMaxCellNodesNumber() * 10); IntHashSet cellNodes = new IntHashSet(); IntHashSet relevantNodes = new IntHashSet(); cellNodes.addAll(0, 1, 2, 5); relevantNodes.addAll(0, 1, 2); rangeDijkstra.setCellNodes(cellNodes); assertEquals(3.0, rangeDijkstra.calcMaxWeight(0, cellNodes), 1e-10); rangeDijkstra = new RangeDijkstra(graphHopperStorage.getBaseGraph(), new ShortestWeighting(carEncoder)); rangeDijkstra.setMaxVisitedNodes(getMaxCellNodesNumber() * 10); rangeDijkstra.setCellNodes(cellNodes); assertEquals(1.0, rangeDijkstra.calcMaxWeight(0, relevantNodes), 1e-10); }
private void getMaxWeight() { for (IntObjectCursor<SPTEntry> entry : fromMap) { if (USERELEVANTONLY && !relevantNodes.contains(entry.key)) continue; if (maximumWeight < entry.value.weight) maximumWeight = entry.value.weight; } }
RangeDijkstra extends AbstractIsochroneDijkstra { private void getMaxWeight() { for (IntObjectCursor<SPTEntry> entry : fromMap) { if (USERELEVANTONLY && !relevantNodes.contains(entry.key)) continue; if (maximumWeight < entry.value.weight) maximumWeight = entry.value.weight; } } }
RangeDijkstra extends AbstractIsochroneDijkstra { private void getMaxWeight() { for (IntObjectCursor<SPTEntry> entry : fromMap) { if (USERELEVANTONLY && !relevantNodes.contains(entry.key)) continue; if (maximumWeight < entry.value.weight) maximumWeight = entry.value.weight; } } RangeDijkstra(Graph graph, Weighting weighting); }
RangeDijkstra extends AbstractIsochroneDijkstra { private void getMaxWeight() { for (IntObjectCursor<SPTEntry> entry : fromMap) { if (USERELEVANTONLY && !relevantNodes.contains(entry.key)) continue; if (maximumWeight < entry.value.weight) maximumWeight = entry.value.weight; } } RangeDijkstra(Graph graph, Weighting weighting); double calcMaxWeight(int from, IntHashSet relevantNodes); void setCellNodes(IntHashSet cellNodes); int getFoundCellNodeSize(); @Override String getName(); }
RangeDijkstra extends AbstractIsochroneDijkstra { private void getMaxWeight() { for (IntObjectCursor<SPTEntry> entry : fromMap) { if (USERELEVANTONLY && !relevantNodes.contains(entry.key)) continue; if (maximumWeight < entry.value.weight) maximumWeight = entry.value.weight; } } RangeDijkstra(Graph graph, Weighting weighting); double calcMaxWeight(int from, IntHashSet relevantNodes); void setCellNodes(IntHashSet cellNodes); int getFoundCellNodeSize(); @Override String getName(); }
@Test public void testPartitioningDataBuilder() { GraphHopperStorage ghStorage = ToyGraphCreationUtil.createMediumGraph(encodingManager); PartitioningData pData = new PartitioningData(); EdgeFilter edgeFilter = new EdgeFilterSequence(); PartitioningDataBuilder partitioningDataBuilder = new PartitioningDataBuilder(ghStorage.getBaseGraph(), pData); partitioningDataBuilder.run(); assertEquals(28, pData.flowEdgeBaseNode.length); assertEquals(28, pData.flow.length); assertEquals(0, pData.flowEdgeBaseNode[0]); assertEquals(1, pData.flowEdgeBaseNode[1]); assertEquals(0, pData.flowEdgeBaseNode[2]); assertEquals(2, pData.flowEdgeBaseNode[3]); assertEquals(10, pData.visited.length); assertEquals(0, pData.visited[0]); }
PartitioningDataBuilder(Graph graph, PartitioningData pData) { this.graph = graph; this.pData = pData; }
PartitioningDataBuilder { PartitioningDataBuilder(Graph graph, PartitioningData pData) { this.graph = graph; this.pData = pData; } }
PartitioningDataBuilder { PartitioningDataBuilder(Graph graph, PartitioningData pData) { this.graph = graph; this.pData = pData; } PartitioningDataBuilder(Graph graph, PartitioningData pData); }
PartitioningDataBuilder { PartitioningDataBuilder(Graph graph, PartitioningData pData) { this.graph = graph; this.pData = pData; } PartitioningDataBuilder(Graph graph, PartitioningData pData); void run(); }
PartitioningDataBuilder { PartitioningDataBuilder(Graph graph, PartitioningData pData) { this.graph = graph; this.pData = pData; } PartitioningDataBuilder(Graph graph, PartitioningData pData); void run(); }
@Test public void TestAttachingORSSidewalkSideTagForWayWithSingleSide() { ReaderWay way = new ReaderWay(1); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.LEFT); assertTrue(way.hasTag("ors-sidewalk-side")); String side = way.getTag("ors-sidewalk-side"); assertEquals("left", side); way = new ReaderWay(1); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.RIGHT); assertTrue(way.hasTag("ors-sidewalk-side")); side = way.getTag("ors-sidewalk-side"); assertEquals("right", side); }
public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; } }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; } }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; } ReaderWay attachSidewalkTag(ReaderWay way, Side side); Side getPreparedSide(ReaderWay way); }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; } ReaderWay attachSidewalkTag(ReaderWay way, Side side); Side getPreparedSide(ReaderWay way); static final String KEY_ORS_SIDEWALK_SIDE; static final String VAL_RIGHT; static final String VAL_LEFT; }
@Test public void testCalculateProjections() { Projector projector = new Projector(); projector.setGHStorage(ToyGraphCreationUtil.createMediumGraph2(encodingManager)); Map<Projector.Projection, IntArrayList> projections = projector.calculateProjections(); IntArrayList expected_m00 = new IntArrayList(); expected_m00.add(1, 2, 3, 0, 8, 4, 6, 5, 7); assertEquals(expected_m00, projections.get(Projector.Projection.LINE_M00)); IntArrayList expected_p90 = new IntArrayList(); expected_p90.add(1, 8, 0, 2, 6, 7, 3, 4, 5); assertEquals(expected_p90, projections.get(Projector.Projection.LINE_P90)); IntArrayList expected_p45 = new IntArrayList(); expected_p45.add(1, 2, 8, 0, 3, 6, 4, 7, 5); assertEquals(expected_p45, projections.get(Projector.Projection.LINE_P45)); }
protected Map<Projection, IntArrayList> calculateProjections() { EnumMap<Projection, IntArrayList> nodeListProjMap = new EnumMap<>(Projection.class); Integer[] ids = IntStream.rangeClosed(0, ghStorage.getNodes() - 1).boxed().toArray(Integer[]::new); Double[] values = new Double[ids.length]; Sort sort = new Sort(); for (Projection proj : Projection.values()) { for (int i = 0; i < ids.length; i++) { values[i] = proj.sortValue(ghStorage.getNodeAccess().getLatitude(ids[i]), ghStorage.getNodeAccess().getLongitude(ids[i])); } nodeListProjMap.put(proj, sort.sortByValueReturnList(ids, values)); } boolean valid = false; for (Projection proj : Projection.values()) { if (!nodeListProjMap.get(proj).equals(nodeListProjMap.get(LINE_M00))) valid = true; } if (!valid) throw new IllegalStateException("All projections of the graph are the same. Maybe NodeAccess is faulty or not initialized?"); return nodeListProjMap; }
Projector { protected Map<Projection, IntArrayList> calculateProjections() { EnumMap<Projection, IntArrayList> nodeListProjMap = new EnumMap<>(Projection.class); Integer[] ids = IntStream.rangeClosed(0, ghStorage.getNodes() - 1).boxed().toArray(Integer[]::new); Double[] values = new Double[ids.length]; Sort sort = new Sort(); for (Projection proj : Projection.values()) { for (int i = 0; i < ids.length; i++) { values[i] = proj.sortValue(ghStorage.getNodeAccess().getLatitude(ids[i]), ghStorage.getNodeAccess().getLongitude(ids[i])); } nodeListProjMap.put(proj, sort.sortByValueReturnList(ids, values)); } boolean valid = false; for (Projection proj : Projection.values()) { if (!nodeListProjMap.get(proj).equals(nodeListProjMap.get(LINE_M00))) valid = true; } if (!valid) throw new IllegalStateException("All projections of the graph are the same. Maybe NodeAccess is faulty or not initialized?"); return nodeListProjMap; } }
Projector { protected Map<Projection, IntArrayList> calculateProjections() { EnumMap<Projection, IntArrayList> nodeListProjMap = new EnumMap<>(Projection.class); Integer[] ids = IntStream.rangeClosed(0, ghStorage.getNodes() - 1).boxed().toArray(Integer[]::new); Double[] values = new Double[ids.length]; Sort sort = new Sort(); for (Projection proj : Projection.values()) { for (int i = 0; i < ids.length; i++) { values[i] = proj.sortValue(ghStorage.getNodeAccess().getLatitude(ids[i]), ghStorage.getNodeAccess().getLongitude(ids[i])); } nodeListProjMap.put(proj, sort.sortByValueReturnList(ids, values)); } boolean valid = false; for (Projection proj : Projection.values()) { if (!nodeListProjMap.get(proj).equals(nodeListProjMap.get(LINE_M00))) valid = true; } if (!valid) throw new IllegalStateException("All projections of the graph are the same. Maybe NodeAccess is faulty or not initialized?"); return nodeListProjMap; } Projector(); }
Projector { protected Map<Projection, IntArrayList> calculateProjections() { EnumMap<Projection, IntArrayList> nodeListProjMap = new EnumMap<>(Projection.class); Integer[] ids = IntStream.rangeClosed(0, ghStorage.getNodes() - 1).boxed().toArray(Integer[]::new); Double[] values = new Double[ids.length]; Sort sort = new Sort(); for (Projection proj : Projection.values()) { for (int i = 0; i < ids.length; i++) { values[i] = proj.sortValue(ghStorage.getNodeAccess().getLatitude(ids[i]), ghStorage.getNodeAccess().getLongitude(ids[i])); } nodeListProjMap.put(proj, sort.sortByValueReturnList(ids, values)); } boolean valid = false; for (Projection proj : Projection.values()) { if (!nodeListProjMap.get(proj).equals(nodeListProjMap.get(LINE_M00))) valid = true; } if (!valid) throw new IllegalStateException("All projections of the graph are the same. Maybe NodeAccess is faulty or not initialized?"); return nodeListProjMap; } Projector(); void setGHStorage(GraphHopperStorage ghStorage); }
Projector { protected Map<Projection, IntArrayList> calculateProjections() { EnumMap<Projection, IntArrayList> nodeListProjMap = new EnumMap<>(Projection.class); Integer[] ids = IntStream.rangeClosed(0, ghStorage.getNodes() - 1).boxed().toArray(Integer[]::new); Double[] values = new Double[ids.length]; Sort sort = new Sort(); for (Projection proj : Projection.values()) { for (int i = 0; i < ids.length; i++) { values[i] = proj.sortValue(ghStorage.getNodeAccess().getLatitude(ids[i]), ghStorage.getNodeAccess().getLongitude(ids[i])); } nodeListProjMap.put(proj, sort.sortByValueReturnList(ids, values)); } boolean valid = false; for (Projection proj : Projection.values()) { if (!nodeListProjMap.get(proj).equals(nodeListProjMap.get(LINE_M00))) valid = true; } if (!valid) throw new IllegalStateException("All projections of the graph are the same. Maybe NodeAccess is faulty or not initialized?"); return nodeListProjMap; } Projector(); void setGHStorage(GraphHopperStorage ghStorage); }
@Test public void testCalculateProjectionOrder() { double originalSplitValue = getSplitValue(); setSplitValue(0); Projector projector = new Projector(); projector.setGHStorage(ToyGraphCreationUtil.createMediumGraph2(encodingManager)); Map<Projector.Projection, IntArrayList> projections = projector.calculateProjections(); List<Projector.Projection> projectionOrder = projector.calculateProjectionOrder(projections); assertEquals(Projector.Projection.LINE_P675, projectionOrder.get(0)); assertEquals(Projector.Projection.LINE_P45, projectionOrder.get(1)); assertEquals(Projector.Projection.LINE_M225, projectionOrder.get(7)); setSplitValue(originalSplitValue); }
protected List<Projection> calculateProjectionOrder(Map<Projection, IntArrayList> projections) { List<Projection> order; EnumMap<Projection, Double> squareRangeProjMap = new EnumMap<>(Projection.class); EnumMap<Projection, Double> orthogonalDiffProjMap = new EnumMap<>(Projection.class); for (Map.Entry<Projection, IntArrayList> proj : projections.entrySet()) { int idx = (int) (proj.getValue().size() * getSplitValue()); squareRangeProjMap.put(proj.getKey(), projIndividualValue(projections, proj.getKey(), idx)); } for (Projection proj : projections.keySet()) { orthogonalDiffProjMap.put(proj, projCombinedValue(squareRangeProjMap, proj)); } Sort sort = new Sort(); order = sort.sortByValueReturnList(orthogonalDiffProjMap, false); return order; }
Projector { protected List<Projection> calculateProjectionOrder(Map<Projection, IntArrayList> projections) { List<Projection> order; EnumMap<Projection, Double> squareRangeProjMap = new EnumMap<>(Projection.class); EnumMap<Projection, Double> orthogonalDiffProjMap = new EnumMap<>(Projection.class); for (Map.Entry<Projection, IntArrayList> proj : projections.entrySet()) { int idx = (int) (proj.getValue().size() * getSplitValue()); squareRangeProjMap.put(proj.getKey(), projIndividualValue(projections, proj.getKey(), idx)); } for (Projection proj : projections.keySet()) { orthogonalDiffProjMap.put(proj, projCombinedValue(squareRangeProjMap, proj)); } Sort sort = new Sort(); order = sort.sortByValueReturnList(orthogonalDiffProjMap, false); return order; } }
Projector { protected List<Projection> calculateProjectionOrder(Map<Projection, IntArrayList> projections) { List<Projection> order; EnumMap<Projection, Double> squareRangeProjMap = new EnumMap<>(Projection.class); EnumMap<Projection, Double> orthogonalDiffProjMap = new EnumMap<>(Projection.class); for (Map.Entry<Projection, IntArrayList> proj : projections.entrySet()) { int idx = (int) (proj.getValue().size() * getSplitValue()); squareRangeProjMap.put(proj.getKey(), projIndividualValue(projections, proj.getKey(), idx)); } for (Projection proj : projections.keySet()) { orthogonalDiffProjMap.put(proj, projCombinedValue(squareRangeProjMap, proj)); } Sort sort = new Sort(); order = sort.sortByValueReturnList(orthogonalDiffProjMap, false); return order; } Projector(); }
Projector { protected List<Projection> calculateProjectionOrder(Map<Projection, IntArrayList> projections) { List<Projection> order; EnumMap<Projection, Double> squareRangeProjMap = new EnumMap<>(Projection.class); EnumMap<Projection, Double> orthogonalDiffProjMap = new EnumMap<>(Projection.class); for (Map.Entry<Projection, IntArrayList> proj : projections.entrySet()) { int idx = (int) (proj.getValue().size() * getSplitValue()); squareRangeProjMap.put(proj.getKey(), projIndividualValue(projections, proj.getKey(), idx)); } for (Projection proj : projections.keySet()) { orthogonalDiffProjMap.put(proj, projCombinedValue(squareRangeProjMap, proj)); } Sort sort = new Sort(); order = sort.sortByValueReturnList(orthogonalDiffProjMap, false); return order; } Projector(); void setGHStorage(GraphHopperStorage ghStorage); }
Projector { protected List<Projection> calculateProjectionOrder(Map<Projection, IntArrayList> projections) { List<Projection> order; EnumMap<Projection, Double> squareRangeProjMap = new EnumMap<>(Projection.class); EnumMap<Projection, Double> orthogonalDiffProjMap = new EnumMap<>(Projection.class); for (Map.Entry<Projection, IntArrayList> proj : projections.entrySet()) { int idx = (int) (proj.getValue().size() * getSplitValue()); squareRangeProjMap.put(proj.getKey(), projIndividualValue(projections, proj.getKey(), idx)); } for (Projection proj : projections.keySet()) { orthogonalDiffProjMap.put(proj, projCombinedValue(squareRangeProjMap, proj)); } Sort sort = new Sort(); order = sort.sortByValueReturnList(orthogonalDiffProjMap, false); return order; } Projector(); void setGHStorage(GraphHopperStorage ghStorage); }
@Test public void testReset() { GraphHopperStorage graphHopperStorage = ToyGraphCreationUtil.createMediumGraph(encodingManager); Graph graph = graphHopperStorage.getBaseGraph(); int[] flowEdgeBaseNode = new int[]{ 0, 1, 0, 2, 0, 3, 0, 8, 1, 2, 1, 8, 2, 3, 3, 4, 4, 5, 4, 6, 5, 7, 6, 7, 7, 8, -1, -1 }; boolean[] flow = new boolean[]{ false, true, false, true, false, true, false, false, true, false, true, false, true, false, false, true, false, true, false, true, false, false, true, false, true, false, false, false }; int[] visited = new int[]{ 0, 1, 0, 1, 0, 1, 0, 1, 0, 0 }; PartitioningData pData = new PartitioningData(flowEdgeBaseNode, flow, visited); IntArrayList projection_m00 = new IntArrayList(); projection_m00.add(1, 2, 3, 0, 4, 6, 8, 5, 7); MaxFlowMinCut maxFlowMinCut = new EdmondsKarpAStar(graph, pData, null); maxFlowMinCut.setOrderedNodes(projection_m00); maxFlowMinCut.setNodeOrder(); maxFlowMinCut.reset(); for (boolean f : pData.flow) assertEquals(false, f); for (int v : pData.visited) assertEquals(0, v); }
protected void reset() { resetAlgorithm(); resetData(); }
MaxFlowMinCut { protected void reset() { resetAlgorithm(); resetData(); } }
MaxFlowMinCut { protected void reset() { resetAlgorithm(); resetData(); } MaxFlowMinCut(Graph graph, PartitioningData pData, EdgeFilter edgeFilter); }
MaxFlowMinCut { protected void reset() { resetAlgorithm(); resetData(); } MaxFlowMinCut(Graph graph, PartitioningData pData, EdgeFilter edgeFilter); void setVisited(int node); boolean isVisited(int visited); void setUnvisitedAll(); abstract int getMaxFlow(); BiPartition calcNodePartition(); void setNodeOrder(); void setOrderedNodes(IntArrayList orderedNodes); void setAdditionalEdgeFilter(EdgeFilter edgeFilter); }
MaxFlowMinCut { protected void reset() { resetAlgorithm(); resetData(); } MaxFlowMinCut(Graph graph, PartitioningData pData, EdgeFilter edgeFilter); void setVisited(int node); boolean isVisited(int visited); void setUnvisitedAll(); abstract int getMaxFlow(); BiPartition calcNodePartition(); void setNodeOrder(); void setOrderedNodes(IntArrayList orderedNodes); void setAdditionalEdgeFilter(EdgeFilter edgeFilter); }
@Test public void testInit() { FastIsochroneFactory fastIsochroneFactory = intitFastIsochroneFactory(); assertTrue(fastIsochroneFactory.isEnabled()); assertTrue(fastIsochroneFactory.isDisablingAllowed()); assertEquals("fastest", fastIsochroneFactory.getFastisochroneProfileStrings().iterator().next()); }
public void init(CmdArgs args) { setMaxThreadCount(args.getInt(FastIsochrone.PREPARE + "threads", getMaxThreadCount())); setMaxCellNodesNumber(args.getInt(FastIsochrone.PREPARE + "maxcellnodes", getMaxCellNodesNumber())); String weightingsStr = args.get(FastIsochrone.PREPARE + "weightings", ""); if ("no".equals(weightingsStr)) { fastisochroneProfileStrings.clear(); } else if (!weightingsStr.isEmpty()) { setFastIsochroneProfilesAsStrings(Arrays.asList(weightingsStr.split(","))); } boolean enableThis = !fastisochroneProfileStrings.isEmpty(); setEnabled(enableThis); if (enableThis) { setDisablingAllowed(args.getBool(FastIsochrone.INIT_DISABLING_ALLOWED, isDisablingAllowed())); IsochronesServiceSettings.setFastIsochronesActive(args.get(FastIsochrone.PROFILE, "")); } }
FastIsochroneFactory { public void init(CmdArgs args) { setMaxThreadCount(args.getInt(FastIsochrone.PREPARE + "threads", getMaxThreadCount())); setMaxCellNodesNumber(args.getInt(FastIsochrone.PREPARE + "maxcellnodes", getMaxCellNodesNumber())); String weightingsStr = args.get(FastIsochrone.PREPARE + "weightings", ""); if ("no".equals(weightingsStr)) { fastisochroneProfileStrings.clear(); } else if (!weightingsStr.isEmpty()) { setFastIsochroneProfilesAsStrings(Arrays.asList(weightingsStr.split(","))); } boolean enableThis = !fastisochroneProfileStrings.isEmpty(); setEnabled(enableThis); if (enableThis) { setDisablingAllowed(args.getBool(FastIsochrone.INIT_DISABLING_ALLOWED, isDisablingAllowed())); IsochronesServiceSettings.setFastIsochronesActive(args.get(FastIsochrone.PROFILE, "")); } } }
FastIsochroneFactory { public void init(CmdArgs args) { setMaxThreadCount(args.getInt(FastIsochrone.PREPARE + "threads", getMaxThreadCount())); setMaxCellNodesNumber(args.getInt(FastIsochrone.PREPARE + "maxcellnodes", getMaxCellNodesNumber())); String weightingsStr = args.get(FastIsochrone.PREPARE + "weightings", ""); if ("no".equals(weightingsStr)) { fastisochroneProfileStrings.clear(); } else if (!weightingsStr.isEmpty()) { setFastIsochroneProfilesAsStrings(Arrays.asList(weightingsStr.split(","))); } boolean enableThis = !fastisochroneProfileStrings.isEmpty(); setEnabled(enableThis); if (enableThis) { setDisablingAllowed(args.getBool(FastIsochrone.INIT_DISABLING_ALLOWED, isDisablingAllowed())); IsochronesServiceSettings.setFastIsochronesActive(args.get(FastIsochrone.PROFILE, "")); } } }
FastIsochroneFactory { public void init(CmdArgs args) { setMaxThreadCount(args.getInt(FastIsochrone.PREPARE + "threads", getMaxThreadCount())); setMaxCellNodesNumber(args.getInt(FastIsochrone.PREPARE + "maxcellnodes", getMaxCellNodesNumber())); String weightingsStr = args.get(FastIsochrone.PREPARE + "weightings", ""); if ("no".equals(weightingsStr)) { fastisochroneProfileStrings.clear(); } else if (!weightingsStr.isEmpty()) { setFastIsochroneProfilesAsStrings(Arrays.asList(weightingsStr.split(","))); } boolean enableThis = !fastisochroneProfileStrings.isEmpty(); setEnabled(enableThis); if (enableThis) { setDisablingAllowed(args.getBool(FastIsochrone.INIT_DISABLING_ALLOWED, isDisablingAllowed())); IsochronesServiceSettings.setFastIsochronesActive(args.get(FastIsochrone.PROFILE, "")); } } void init(CmdArgs args); FastIsochroneFactory setFastIsochroneProfilesAsStrings(List<String> profileStrings); Set<String> getFastisochroneProfileStrings(); FastIsochroneFactory addFastIsochroneProfileAsString(String profileString); final boolean isEnabled(); final FastIsochroneFactory setEnabled(boolean enabled); final boolean isDisablingAllowed(); final FastIsochroneFactory setDisablingAllowed(boolean disablingAllowed); FastIsochroneFactory setPartition(PreparePartition pp); PreparePartition getPartition(); void prepare(final StorableProperties properties); void createPreparation(GraphHopperStorage ghStorage, EdgeFilterSequence edgeFilters); void setExistingStorages(); IsochroneNodeStorage getIsochroneNodeStorage(); void setIsochroneNodeStorage(IsochroneNodeStorage isochroneNodeStorage); CellStorage getCellStorage(); void setCellStorage(CellStorage cellStorage); }
FastIsochroneFactory { public void init(CmdArgs args) { setMaxThreadCount(args.getInt(FastIsochrone.PREPARE + "threads", getMaxThreadCount())); setMaxCellNodesNumber(args.getInt(FastIsochrone.PREPARE + "maxcellnodes", getMaxCellNodesNumber())); String weightingsStr = args.get(FastIsochrone.PREPARE + "weightings", ""); if ("no".equals(weightingsStr)) { fastisochroneProfileStrings.clear(); } else if (!weightingsStr.isEmpty()) { setFastIsochroneProfilesAsStrings(Arrays.asList(weightingsStr.split(","))); } boolean enableThis = !fastisochroneProfileStrings.isEmpty(); setEnabled(enableThis); if (enableThis) { setDisablingAllowed(args.getBool(FastIsochrone.INIT_DISABLING_ALLOWED, isDisablingAllowed())); IsochronesServiceSettings.setFastIsochronesActive(args.get(FastIsochrone.PROFILE, "")); } } void init(CmdArgs args); FastIsochroneFactory setFastIsochroneProfilesAsStrings(List<String> profileStrings); Set<String> getFastisochroneProfileStrings(); FastIsochroneFactory addFastIsochroneProfileAsString(String profileString); final boolean isEnabled(); final FastIsochroneFactory setEnabled(boolean enabled); final boolean isDisablingAllowed(); final FastIsochroneFactory setDisablingAllowed(boolean disablingAllowed); FastIsochroneFactory setPartition(PreparePartition pp); PreparePartition getPartition(); void prepare(final StorableProperties properties); void createPreparation(GraphHopperStorage ghStorage, EdgeFilterSequence edgeFilters); void setExistingStorages(); IsochroneNodeStorage getIsochroneNodeStorage(); void setIsochroneNodeStorage(IsochroneNodeStorage isochroneNodeStorage); CellStorage getCellStorage(); void setCellStorage(CellStorage cellStorage); }
@Test public void testPrepare() { GraphHopperStorage gs = ToyGraphCreationUtil.createMediumGraph(encodingManager); FastIsochroneFactory fastIsochroneFactory = intitFastIsochroneFactory(); fastIsochroneFactory.createPreparation(gs, null); fastIsochroneFactory.prepare(gs.getProperties()); assertNotNull(fastIsochroneFactory.getCellStorage()); assertNotNull(fastIsochroneFactory.getIsochroneNodeStorage()); }
public void prepare(final StorableProperties properties) { ExecutorService threadPool = Executors.newFixedThreadPool(1); ExecutorCompletionService<String> completionService = new ExecutorCompletionService<>(threadPool); final String name = "PreparePartition"; completionService.submit(() -> { Thread.currentThread().setName(name); getPartition().prepare(); setIsochroneNodeStorage(getPartition().getIsochroneNodeStorage()); setCellStorage(getPartition().getCellStorage()); properties.put(FastIsochrone.PREPARE + "date." + name, Helper.createFormatter().format(new Date())); }, name); threadPool.shutdown(); try { completionService.take().get(); } catch (Exception e) { threadPool.shutdownNow(); throw new IllegalStateException(e); } }
FastIsochroneFactory { public void prepare(final StorableProperties properties) { ExecutorService threadPool = Executors.newFixedThreadPool(1); ExecutorCompletionService<String> completionService = new ExecutorCompletionService<>(threadPool); final String name = "PreparePartition"; completionService.submit(() -> { Thread.currentThread().setName(name); getPartition().prepare(); setIsochroneNodeStorage(getPartition().getIsochroneNodeStorage()); setCellStorage(getPartition().getCellStorage()); properties.put(FastIsochrone.PREPARE + "date." + name, Helper.createFormatter().format(new Date())); }, name); threadPool.shutdown(); try { completionService.take().get(); } catch (Exception e) { threadPool.shutdownNow(); throw new IllegalStateException(e); } } }
FastIsochroneFactory { public void prepare(final StorableProperties properties) { ExecutorService threadPool = Executors.newFixedThreadPool(1); ExecutorCompletionService<String> completionService = new ExecutorCompletionService<>(threadPool); final String name = "PreparePartition"; completionService.submit(() -> { Thread.currentThread().setName(name); getPartition().prepare(); setIsochroneNodeStorage(getPartition().getIsochroneNodeStorage()); setCellStorage(getPartition().getCellStorage()); properties.put(FastIsochrone.PREPARE + "date." + name, Helper.createFormatter().format(new Date())); }, name); threadPool.shutdown(); try { completionService.take().get(); } catch (Exception e) { threadPool.shutdownNow(); throw new IllegalStateException(e); } } }
FastIsochroneFactory { public void prepare(final StorableProperties properties) { ExecutorService threadPool = Executors.newFixedThreadPool(1); ExecutorCompletionService<String> completionService = new ExecutorCompletionService<>(threadPool); final String name = "PreparePartition"; completionService.submit(() -> { Thread.currentThread().setName(name); getPartition().prepare(); setIsochroneNodeStorage(getPartition().getIsochroneNodeStorage()); setCellStorage(getPartition().getCellStorage()); properties.put(FastIsochrone.PREPARE + "date." + name, Helper.createFormatter().format(new Date())); }, name); threadPool.shutdown(); try { completionService.take().get(); } catch (Exception e) { threadPool.shutdownNow(); throw new IllegalStateException(e); } } void init(CmdArgs args); FastIsochroneFactory setFastIsochroneProfilesAsStrings(List<String> profileStrings); Set<String> getFastisochroneProfileStrings(); FastIsochroneFactory addFastIsochroneProfileAsString(String profileString); final boolean isEnabled(); final FastIsochroneFactory setEnabled(boolean enabled); final boolean isDisablingAllowed(); final FastIsochroneFactory setDisablingAllowed(boolean disablingAllowed); FastIsochroneFactory setPartition(PreparePartition pp); PreparePartition getPartition(); void prepare(final StorableProperties properties); void createPreparation(GraphHopperStorage ghStorage, EdgeFilterSequence edgeFilters); void setExistingStorages(); IsochroneNodeStorage getIsochroneNodeStorage(); void setIsochroneNodeStorage(IsochroneNodeStorage isochroneNodeStorage); CellStorage getCellStorage(); void setCellStorage(CellStorage cellStorage); }
FastIsochroneFactory { public void prepare(final StorableProperties properties) { ExecutorService threadPool = Executors.newFixedThreadPool(1); ExecutorCompletionService<String> completionService = new ExecutorCompletionService<>(threadPool); final String name = "PreparePartition"; completionService.submit(() -> { Thread.currentThread().setName(name); getPartition().prepare(); setIsochroneNodeStorage(getPartition().getIsochroneNodeStorage()); setCellStorage(getPartition().getCellStorage()); properties.put(FastIsochrone.PREPARE + "date." + name, Helper.createFormatter().format(new Date())); }, name); threadPool.shutdown(); try { completionService.take().get(); } catch (Exception e) { threadPool.shutdownNow(); throw new IllegalStateException(e); } } void init(CmdArgs args); FastIsochroneFactory setFastIsochroneProfilesAsStrings(List<String> profileStrings); Set<String> getFastisochroneProfileStrings(); FastIsochroneFactory addFastIsochroneProfileAsString(String profileString); final boolean isEnabled(); final FastIsochroneFactory setEnabled(boolean enabled); final boolean isDisablingAllowed(); final FastIsochroneFactory setDisablingAllowed(boolean disablingAllowed); FastIsochroneFactory setPartition(PreparePartition pp); PreparePartition getPartition(); void prepare(final StorableProperties properties); void createPreparation(GraphHopperStorage ghStorage, EdgeFilterSequence edgeFilters); void setExistingStorages(); IsochroneNodeStorage getIsochroneNodeStorage(); void setIsochroneNodeStorage(IsochroneNodeStorage isochroneNodeStorage); CellStorage getCellStorage(); void setCellStorage(CellStorage cellStorage); }
@Test public void testBuild() throws JAXBException { XMLBuilder xMLBuilder = new XMLBuilder(); String result = xMLBuilder.build(gpx); Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<gpx version=\"1.0\" xmlns=\"https: " <metadata>\n" + " <name></name>\n" + " <desc></desc>\n" + " <author>\n" + " <name></name>\n" + " <email id=\"id\" domain=\"@domain\"/>\n" + " <link href=\"\">\n" + " <text></text>\n" + " <type></type>\n" + " </link>\n" + " </author>\n" + " <copyright author=\"\">\n" + " <year></year>\n" + " <license></license>\n" + " </copyright>\n" + " <time></time>\n" + " <keywords></keywords>\n" + " <bounds/>\n" + " <extensions>\n" + " <system-message>System message string</system-message>\n" + " </extensions>\n" + " </metadata>\n" + " <wpt lat=\"0.0\" lon=\"0.0\">\n" + " <ele>0.0</ele>\n" + " <extensions>\n" + " <distance>0.0</distance>\n" + " <duration>0.0</duration>\n" + " <type>0</type>\n" + " <step>0</step>\n" + " </extensions>\n" + " </wpt>\n" + " <rte>\n" + " <rtept lat=\"0.0\" lon=\"0.0\">\n" + " <ele>0.0</ele>\n" + " <extensions>\n" + " <distance>0.0</distance>\n" + " <duration>0.0</duration>\n" + " <type>0</type>\n" + " <step>0</step>\n" + " </extensions>\n" + " </rtept>\n" + " <extensions>\n" + " <distance>0.0</distance>\n" + " <duration>0.0</duration>\n" + " <distanceActual>0.0</distanceActual>\n" + " <ascent>0.0</ascent>\n" + " <descent>0.0</descent>\n" + " <avgspeed>0.0</avgspeed>\n" + " <bounds minLat=\"0.0\" minLon=\"0.0\" maxLat=\"0.0\" maxLon=\"0.0\"/>\n" + " </extensions>\n" + " </rte>\n" + " <trk>\n" + " <extensions>\n" + " <example1>0.0</example1>\n" + " </extensions>\n" + " <trkseg>\n" + " <trkpt lat=\"0.0\" lon=\"0.0\">\n" + " <ele>0.0</ele>\n" + " <extensions>\n" + " <distance>0.0</distance>\n" + " <duration>0.0</duration>\n" + " <type>0</type>\n" + " <step>0</step>\n" + " </extensions>\n" + " </trkpt>\n" + " <extensions>\n" + " <example1>0.0</example1>\n" + " </extensions>\n" + " </trkseg>\n" + " </trk>\n" + " <extensions>\n" + " <attribution></attribution>\n" + " <engine></engine>\n" + " <build_date></build_date>\n" + " <profile></profile>\n" + " <preference></preference>\n" + " <language></language>\n" + " <distance-units></distance-units>\n" + " <duration-units></duration-units>\n" + " <instructions></instructions>\n" + " <elevation></elevation>\n" + " </extensions>\n" + "</gpx>\n", result); }
public String build(Gpx gpx) throws JAXBException { JAXBContext context = JAXBContext.newInstance(Gpx.class); Marshaller m = context.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); StringWriter sw = new StringWriter(); m.marshal(gpx, sw); return sw.toString(); }
XMLBuilder { public String build(Gpx gpx) throws JAXBException { JAXBContext context = JAXBContext.newInstance(Gpx.class); Marshaller m = context.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); StringWriter sw = new StringWriter(); m.marshal(gpx, sw); return sw.toString(); } }
XMLBuilder { public String build(Gpx gpx) throws JAXBException { JAXBContext context = JAXBContext.newInstance(Gpx.class); Marshaller m = context.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); StringWriter sw = new StringWriter(); m.marshal(gpx, sw); return sw.toString(); } }
XMLBuilder { public String build(Gpx gpx) throws JAXBException { JAXBContext context = JAXBContext.newInstance(Gpx.class); Marshaller m = context.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); StringWriter sw = new StringWriter(); m.marshal(gpx, sw); return sw.toString(); } String build(Gpx gpx); }
XMLBuilder { public String build(Gpx gpx) throws JAXBException { JAXBContext context = JAXBContext.newInstance(Gpx.class); Marshaller m = context.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); StringWriter sw = new StringWriter(); m.marshal(gpx, sw); return sw.toString(); } String build(Gpx gpx); }
@Test public void testAddProperties() throws Exception { JSONObject expectedJSON = new JSONObject("{\"geometry\":{\"coordinates\":[[1,1],[1,1],[1,1]],\"type\":\"LineString\"},\"id\":\"" + routingFeatureID + "\",\"type\":\"Feature\",\"properties\":{\"bbox\":[1,1,1,1],\"way_points\":[1,1],\"segments\":[1]}}"); JSONObject resultJSON = GeoJsonResponseWriter.addProperties(routingFeature, featurePropertiesMap); JSONAssert.assertEquals(expectedJSON, resultJSON, JSONCompareMode.NON_EXTENSIBLE); }
public static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap) throws IOException { StringWriter stringWriter = new StringWriter(); fjson.writeFeature(simpleFeature, stringWriter); JSONObject featureAsJSON = new JSONObject(stringWriter.toString()); stringWriter.close(); return featureProperties(featureAsJSON, featurePropertiesMap); }
GeoJsonResponseWriter { public static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap) throws IOException { StringWriter stringWriter = new StringWriter(); fjson.writeFeature(simpleFeature, stringWriter); JSONObject featureAsJSON = new JSONObject(stringWriter.toString()); stringWriter.close(); return featureProperties(featureAsJSON, featurePropertiesMap); } }
GeoJsonResponseWriter { public static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap) throws IOException { StringWriter stringWriter = new StringWriter(); fjson.writeFeature(simpleFeature, stringWriter); JSONObject featureAsJSON = new JSONObject(stringWriter.toString()); stringWriter.close(); return featureProperties(featureAsJSON, featurePropertiesMap); } }
GeoJsonResponseWriter { public static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap) throws IOException { StringWriter stringWriter = new StringWriter(); fjson.writeFeature(simpleFeature, stringWriter); JSONObject featureAsJSON = new JSONObject(stringWriter.toString()); stringWriter.close(); return featureProperties(featureAsJSON, featurePropertiesMap); } static JSONObject toGeoJson(RoutingRequest rreq, RouteResult[] routeResult); JSONObject toGeoJson(IsochroneRequest rreq, RouteResult[] routeResults); static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap); static JSONObject addProperties(DefaultFeatureCollection defaultFeatureCollection, Map<String, Map<String, Object>> featurePropertiesMap, Map<String, Object> defaultFeatureCollectionProperties); }
GeoJsonResponseWriter { public static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap) throws IOException { StringWriter stringWriter = new StringWriter(); fjson.writeFeature(simpleFeature, stringWriter); JSONObject featureAsJSON = new JSONObject(stringWriter.toString()); stringWriter.close(); return featureProperties(featureAsJSON, featurePropertiesMap); } static JSONObject toGeoJson(RoutingRequest rreq, RouteResult[] routeResult); JSONObject toGeoJson(IsochroneRequest rreq, RouteResult[] routeResults); static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap); static JSONObject addProperties(DefaultFeatureCollection defaultFeatureCollection, Map<String, Map<String, Object>> featurePropertiesMap, Map<String, Object> defaultFeatureCollectionProperties); static final String KEY_ROUTES; static final String KEY_FEATURES; static final String KEY_PROPERTIES; }
@Test public void testAddProperties1() throws Exception { JSONObject expectedJSON = new JSONObject("{\"features\":[{\"geometry\":{\"coordinates\":[[1,1],[1,1],[1,1]],\"type\":\"LineString\"},\"id\":\"" + routingFeatureID + "\",\"type\":\"Feature\",\"properties\":{\"bbox\":[1,1,1,1],\"way_points\":[1,1],\"segments\":[1]}}],\"bbox\":[1,1,1,1],\"type\":\"FeatureCollection\",\"info\":[1]}"); JSONObject resultJSON = GeoJsonResponseWriter.addProperties(defaultFeatureCollection, featurePropertiesMap, defaultFeatureCollectionProperties); JSONAssert.assertEquals(expectedJSON, resultJSON, JSONCompareMode.NON_EXTENSIBLE); }
public static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap) throws IOException { StringWriter stringWriter = new StringWriter(); fjson.writeFeature(simpleFeature, stringWriter); JSONObject featureAsJSON = new JSONObject(stringWriter.toString()); stringWriter.close(); return featureProperties(featureAsJSON, featurePropertiesMap); }
GeoJsonResponseWriter { public static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap) throws IOException { StringWriter stringWriter = new StringWriter(); fjson.writeFeature(simpleFeature, stringWriter); JSONObject featureAsJSON = new JSONObject(stringWriter.toString()); stringWriter.close(); return featureProperties(featureAsJSON, featurePropertiesMap); } }
GeoJsonResponseWriter { public static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap) throws IOException { StringWriter stringWriter = new StringWriter(); fjson.writeFeature(simpleFeature, stringWriter); JSONObject featureAsJSON = new JSONObject(stringWriter.toString()); stringWriter.close(); return featureProperties(featureAsJSON, featurePropertiesMap); } }
GeoJsonResponseWriter { public static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap) throws IOException { StringWriter stringWriter = new StringWriter(); fjson.writeFeature(simpleFeature, stringWriter); JSONObject featureAsJSON = new JSONObject(stringWriter.toString()); stringWriter.close(); return featureProperties(featureAsJSON, featurePropertiesMap); } static JSONObject toGeoJson(RoutingRequest rreq, RouteResult[] routeResult); JSONObject toGeoJson(IsochroneRequest rreq, RouteResult[] routeResults); static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap); static JSONObject addProperties(DefaultFeatureCollection defaultFeatureCollection, Map<String, Map<String, Object>> featurePropertiesMap, Map<String, Object> defaultFeatureCollectionProperties); }
GeoJsonResponseWriter { public static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap) throws IOException { StringWriter stringWriter = new StringWriter(); fjson.writeFeature(simpleFeature, stringWriter); JSONObject featureAsJSON = new JSONObject(stringWriter.toString()); stringWriter.close(); return featureProperties(featureAsJSON, featurePropertiesMap); } static JSONObject toGeoJson(RoutingRequest rreq, RouteResult[] routeResult); JSONObject toGeoJson(IsochroneRequest rreq, RouteResult[] routeResults); static JSONObject addProperties(SimpleFeature simpleFeature, Map<String, Map<String, Object>> featurePropertiesMap); static JSONObject addProperties(DefaultFeatureCollection defaultFeatureCollection, Map<String, Map<String, Object>> featurePropertiesMap, Map<String, Object> defaultFeatureCollectionProperties); static final String KEY_ROUTES; static final String KEY_FEATURES; static final String KEY_PROPERTIES; }
@Test public void TestAttchingNoSidewalkRemovesAnyAlreadyAttachedORSSidewalkTags() { ReaderWay way = new ReaderWay(1); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.NONE); assertFalse(way.hasTag("ors-sidewalk-side")); way = new ReaderWay(1); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.LEFT); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.NONE); assertFalse(way.hasTag("ors-sidewalk-side")); }
public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; } }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; } }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; } ReaderWay attachSidewalkTag(ReaderWay way, Side side); Side getPreparedSide(ReaderWay way); }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; } ReaderWay attachSidewalkTag(ReaderWay way, Side side); Side getPreparedSide(ReaderWay way); static final String KEY_ORS_SIDEWALK_SIDE; static final String VAL_RIGHT; static final String VAL_LEFT; }
@Test public void TestAttachingORSSidealkTagsWhenBothSidesHaveValues() { ReaderWay way = new ReaderWay(1); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.BOTH); assertTrue(way.hasTag("ors-sidewalk-side")); String side = way.getTag("ors-sidewalk-side"); assertEquals("left", side); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.BOTH); assertTrue(way.hasTag("ors-sidewalk-side")); side = way.getTag("ors-sidewalk-side"); assertEquals("right", side); }
public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; } }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; } }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; } ReaderWay attachSidewalkTag(ReaderWay way, Side side); Side getPreparedSide(ReaderWay way); }
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; } ReaderWay attachSidewalkTag(ReaderWay way, Side side); Side getPreparedSide(ReaderWay way); static final String KEY_ORS_SIDEWALK_SIDE; static final String VAL_RIGHT; static final String VAL_LEFT; }
@Test public void TestName() { assertEquals("name", cbp.getName()); }
public String getName() { return this.name; }
CountryBordersPolygon { public String getName() { return this.name; } }
CountryBordersPolygon { public String getName() { return this.name; } CountryBordersPolygon(String name, Geometry boundary); }
CountryBordersPolygon { public String getName() { return this.name; } CountryBordersPolygon(String name, Geometry boundary); double[] getBBox(); boolean shares(MultiPolygon other); boolean crossesBoundary(LineString line); String getName(); MultiPolygon getBoundary(); boolean inBbox(Coordinate c); boolean inArea(Coordinate c); double getArea(); }
CountryBordersPolygon { public String getName() { return this.name; } CountryBordersPolygon(String name, Geometry boundary); double[] getBBox(); boolean shares(MultiPolygon other); boolean crossesBoundary(LineString line); String getName(); MultiPolygon getBoundary(); boolean inBbox(Coordinate c); boolean inArea(Coordinate c); double getArea(); }
@Test public void TestBoundaryGeometry() { MultiPolygon boundary = cbp.getBoundary(); Coordinate[] cbpCoords = boundary.getCoordinates(); assertEquals(country1Geom.length, cbpCoords.length); assertEquals(country1Geom[0].x, cbpCoords[0].x, 0.0); assertEquals(country1Geom[3].y, cbpCoords[3].y,0.0); }
public MultiPolygon getBoundary() { return this.boundary; }
CountryBordersPolygon { public MultiPolygon getBoundary() { return this.boundary; } }
CountryBordersPolygon { public MultiPolygon getBoundary() { return this.boundary; } CountryBordersPolygon(String name, Geometry boundary); }
CountryBordersPolygon { public MultiPolygon getBoundary() { return this.boundary; } CountryBordersPolygon(String name, Geometry boundary); double[] getBBox(); boolean shares(MultiPolygon other); boolean crossesBoundary(LineString line); String getName(); MultiPolygon getBoundary(); boolean inBbox(Coordinate c); boolean inArea(Coordinate c); double getArea(); }
CountryBordersPolygon { public MultiPolygon getBoundary() { return this.boundary; } CountryBordersPolygon(String name, Geometry boundary); double[] getBBox(); boolean shares(MultiPolygon other); boolean crossesBoundary(LineString line); String getName(); MultiPolygon getBoundary(); boolean inBbox(Coordinate c); boolean inArea(Coordinate c); double getArea(); }
@Test public void TestBBox() { double[] bbox = cbp.getBBox(); assertEquals(-1.0, bbox[0], 0.0); assertEquals(1.0, bbox[1], 0.0); assertEquals(-1.0, bbox[2], 0.0); assertEquals(2.0, bbox[3], 0.0); }
public double[] getBBox() { return new double[] {minLon, maxLon, minLat, maxLat}; }
CountryBordersPolygon { public double[] getBBox() { return new double[] {minLon, maxLon, minLat, maxLat}; } }
CountryBordersPolygon { public double[] getBBox() { return new double[] {minLon, maxLon, minLat, maxLat}; } CountryBordersPolygon(String name, Geometry boundary); }
CountryBordersPolygon { public double[] getBBox() { return new double[] {minLon, maxLon, minLat, maxLat}; } CountryBordersPolygon(String name, Geometry boundary); double[] getBBox(); boolean shares(MultiPolygon other); boolean crossesBoundary(LineString line); String getName(); MultiPolygon getBoundary(); boolean inBbox(Coordinate c); boolean inArea(Coordinate c); double getArea(); }
CountryBordersPolygon { public double[] getBBox() { return new double[] {minLon, maxLon, minLat, maxLat}; } CountryBordersPolygon(String name, Geometry boundary); double[] getBBox(); boolean shares(MultiPolygon other); boolean crossesBoundary(LineString line); String getName(); MultiPolygon getBoundary(); boolean inBbox(Coordinate c); boolean inArea(Coordinate c); double getArea(); }
@Test public void TestIntersection() { LineString ls = gf.createLineString(new Coordinate[] { new Coordinate(0.5, 0.5), new Coordinate(-10.5, -10.5) }); assertTrue(cbp.crossesBoundary(ls)); ls = gf.createLineString(new Coordinate[] { new Coordinate(0.5, 0.5), new Coordinate(0.25, 0.25) }); assertFalse(cbp.crossesBoundary(ls)); }
public boolean crossesBoundary(LineString line) { return this.boundaryLine.intersects(line); }
CountryBordersPolygon { public boolean crossesBoundary(LineString line) { return this.boundaryLine.intersects(line); } }
CountryBordersPolygon { public boolean crossesBoundary(LineString line) { return this.boundaryLine.intersects(line); } CountryBordersPolygon(String name, Geometry boundary); }
CountryBordersPolygon { public boolean crossesBoundary(LineString line) { return this.boundaryLine.intersects(line); } CountryBordersPolygon(String name, Geometry boundary); double[] getBBox(); boolean shares(MultiPolygon other); boolean crossesBoundary(LineString line); String getName(); MultiPolygon getBoundary(); boolean inBbox(Coordinate c); boolean inArea(Coordinate c); double getArea(); }
CountryBordersPolygon { public boolean crossesBoundary(LineString line) { return this.boundaryLine.intersects(line); } CountryBordersPolygon(String name, Geometry boundary); double[] getBBox(); boolean shares(MultiPolygon other); boolean crossesBoundary(LineString line); String getName(); MultiPolygon getBoundary(); boolean inBbox(Coordinate c); boolean inArea(Coordinate c); double getArea(); }
@Test public void TestBBoxContains() { assertTrue(cbp.inBbox(new Coordinate(0.5, 0.5))); assertFalse(cbp.inBbox(new Coordinate(10.0, 0.5))); }
public boolean inBbox(Coordinate c) { return !(c.x < minLon || c.x > maxLon || c.y < minLat || c.y > maxLat); }
CountryBordersPolygon { public boolean inBbox(Coordinate c) { return !(c.x < minLon || c.x > maxLon || c.y < minLat || c.y > maxLat); } }
CountryBordersPolygon { public boolean inBbox(Coordinate c) { return !(c.x < minLon || c.x > maxLon || c.y < minLat || c.y > maxLat); } CountryBordersPolygon(String name, Geometry boundary); }
CountryBordersPolygon { public boolean inBbox(Coordinate c) { return !(c.x < minLon || c.x > maxLon || c.y < minLat || c.y > maxLat); } CountryBordersPolygon(String name, Geometry boundary); double[] getBBox(); boolean shares(MultiPolygon other); boolean crossesBoundary(LineString line); String getName(); MultiPolygon getBoundary(); boolean inBbox(Coordinate c); boolean inArea(Coordinate c); double getArea(); }
CountryBordersPolygon { public boolean inBbox(Coordinate c) { return !(c.x < minLon || c.x > maxLon || c.y < minLat || c.y > maxLat); } CountryBordersPolygon(String name, Geometry boundary); double[] getBBox(); boolean shares(MultiPolygon other); boolean crossesBoundary(LineString line); String getName(); MultiPolygon getBoundary(); boolean inBbox(Coordinate c); boolean inArea(Coordinate c); double getArea(); }
@Test public void TestDetectOpenBorder() { VirtualEdgeIteratorState ve1 = generateEdge(1); VirtualEdgeIteratorState ve2 = generateEdge(2); VirtualEdgeIteratorState ve3 = generateEdge(3); BordersExtractor be = new BordersExtractor(_graphstorage, new int[0]); assertEquals(false, be.isOpenBorder(1)); assertEquals(true, be.isOpenBorder(2)); assertEquals(false, be.isOpenBorder(3)); }
public boolean isOpenBorder(int edgeId) { return storage.getEdgeValue(edgeId, BordersGraphStorage.Property.TYPE) == BordersGraphStorage.OPEN_BORDER; }
BordersExtractor { public boolean isOpenBorder(int edgeId) { return storage.getEdgeValue(edgeId, BordersGraphStorage.Property.TYPE) == BordersGraphStorage.OPEN_BORDER; } }
BordersExtractor { public boolean isOpenBorder(int edgeId) { return storage.getEdgeValue(edgeId, BordersGraphStorage.Property.TYPE) == BordersGraphStorage.OPEN_BORDER; } BordersExtractor(BordersGraphStorage storage, int[] avoidCountries); }
BordersExtractor { public boolean isOpenBorder(int edgeId) { return storage.getEdgeValue(edgeId, BordersGraphStorage.Property.TYPE) == BordersGraphStorage.OPEN_BORDER; } BordersExtractor(BordersGraphStorage storage, int[] avoidCountries); int getValue(int edgeId); boolean isBorder(int edgeId); boolean isControlledBorder(int edgeId); boolean isOpenBorder(int edgeId); boolean restrictedCountry(int edgeId); boolean isSameCountry(List<Integer> edgeIds); }
BordersExtractor { public boolean isOpenBorder(int edgeId) { return storage.getEdgeValue(edgeId, BordersGraphStorage.Property.TYPE) == BordersGraphStorage.OPEN_BORDER; } BordersExtractor(BordersGraphStorage storage, int[] avoidCountries); int getValue(int edgeId); boolean isBorder(int edgeId); boolean isControlledBorder(int edgeId); boolean isOpenBorder(int edgeId); boolean restrictedCountry(int edgeId); boolean isSameCountry(List<Integer> edgeIds); }
@Test public void TestPolygonContains() { assertTrue(cbp.inArea(new Coordinate(0.5, 0.5))); assertFalse(cbp.inArea(new Coordinate(-0.5, -0.5))); }
public boolean inArea(Coordinate c) { if(!Double.isNaN(c.x) && !Double.isNaN(c.y) && inBbox(c)) { GeometryFactory gf = new GeometryFactory(); return boundary.contains(gf.createPoint(c)); } return false; }
CountryBordersPolygon { public boolean inArea(Coordinate c) { if(!Double.isNaN(c.x) && !Double.isNaN(c.y) && inBbox(c)) { GeometryFactory gf = new GeometryFactory(); return boundary.contains(gf.createPoint(c)); } return false; } }
CountryBordersPolygon { public boolean inArea(Coordinate c) { if(!Double.isNaN(c.x) && !Double.isNaN(c.y) && inBbox(c)) { GeometryFactory gf = new GeometryFactory(); return boundary.contains(gf.createPoint(c)); } return false; } CountryBordersPolygon(String name, Geometry boundary); }
CountryBordersPolygon { public boolean inArea(Coordinate c) { if(!Double.isNaN(c.x) && !Double.isNaN(c.y) && inBbox(c)) { GeometryFactory gf = new GeometryFactory(); return boundary.contains(gf.createPoint(c)); } return false; } CountryBordersPolygon(String name, Geometry boundary); double[] getBBox(); boolean shares(MultiPolygon other); boolean crossesBoundary(LineString line); String getName(); MultiPolygon getBoundary(); boolean inBbox(Coordinate c); boolean inArea(Coordinate c); double getArea(); }
CountryBordersPolygon { public boolean inArea(Coordinate c) { if(!Double.isNaN(c.x) && !Double.isNaN(c.y) && inBbox(c)) { GeometryFactory gf = new GeometryFactory(); return boundary.contains(gf.createPoint(c)); } return false; } CountryBordersPolygon(String name, Geometry boundary); double[] getBBox(); boolean shares(MultiPolygon other); boolean crossesBoundary(LineString line); String getName(); MultiPolygon getBoundary(); boolean inBbox(Coordinate c); boolean inArea(Coordinate c); double getArea(); }
@Test public void TestGetCountry() { Coordinate c = new Coordinate(0.5, 0.5); CountryBordersPolygon[] polys = _reader.getCountry(c); assertEquals(1, polys.length); assertEquals("country1", polys[0].getName()); }
public CountryBordersPolygon[] getCountry(Coordinate c) { ArrayList<CountryBordersPolygon> countries = new ArrayList<>(); Iterator it = hierarchies.entrySet().iterator(); while(it.hasNext()) { Map.Entry<Long, CountryBordersHierarchy> pair = (Map.Entry)it.next(); CountryBordersHierarchy h = pair.getValue(); if(h.inBbox(c)) { List<CountryBordersPolygon> ps = h.getPolygons(); for(CountryBordersPolygon cp : ps) { if(cp.inBbox(c) && cp.inArea(c)) { countries.add(cp); } } } } return countries.toArray(new CountryBordersPolygon[countries.size()]); }
CountryBordersReader { public CountryBordersPolygon[] getCountry(Coordinate c) { ArrayList<CountryBordersPolygon> countries = new ArrayList<>(); Iterator it = hierarchies.entrySet().iterator(); while(it.hasNext()) { Map.Entry<Long, CountryBordersHierarchy> pair = (Map.Entry)it.next(); CountryBordersHierarchy h = pair.getValue(); if(h.inBbox(c)) { List<CountryBordersPolygon> ps = h.getPolygons(); for(CountryBordersPolygon cp : ps) { if(cp.inBbox(c) && cp.inArea(c)) { countries.add(cp); } } } } return countries.toArray(new CountryBordersPolygon[countries.size()]); } }
CountryBordersReader { public CountryBordersPolygon[] getCountry(Coordinate c) { ArrayList<CountryBordersPolygon> countries = new ArrayList<>(); Iterator it = hierarchies.entrySet().iterator(); while(it.hasNext()) { Map.Entry<Long, CountryBordersHierarchy> pair = (Map.Entry)it.next(); CountryBordersHierarchy h = pair.getValue(); if(h.inBbox(c)) { List<CountryBordersPolygon> ps = h.getPolygons(); for(CountryBordersPolygon cp : ps) { if(cp.inBbox(c) && cp.inArea(c)) { countries.add(cp); } } } } return countries.toArray(new CountryBordersPolygon[countries.size()]); } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); }
CountryBordersReader { public CountryBordersPolygon[] getCountry(Coordinate c) { ArrayList<CountryBordersPolygon> countries = new ArrayList<>(); Iterator it = hierarchies.entrySet().iterator(); while(it.hasNext()) { Map.Entry<Long, CountryBordersHierarchy> pair = (Map.Entry)it.next(); CountryBordersHierarchy h = pair.getValue(); if(h.inBbox(c)) { List<CountryBordersPolygon> ps = h.getPolygons(); for(CountryBordersPolygon cp : ps) { if(cp.inBbox(c) && cp.inArea(c)) { countries.add(cp); } } } } return countries.toArray(new CountryBordersPolygon[countries.size()]); } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); void addHierarchy(Long id, CountryBordersHierarchy hierarchy); void addId(String id, String localName, String englishName, String cca2, String cca3); void addOpenBorder(String country1, String country2); CountryBordersPolygon[] getCountry(Coordinate c); CountryBordersPolygon[] getCandidateCountry(Coordinate c); String getId(String name); String getEngName(String name); boolean isOpen(String c1, String c2); static int getCountryIdByISOCode(String code); }
CountryBordersReader { public CountryBordersPolygon[] getCountry(Coordinate c) { ArrayList<CountryBordersPolygon> countries = new ArrayList<>(); Iterator it = hierarchies.entrySet().iterator(); while(it.hasNext()) { Map.Entry<Long, CountryBordersHierarchy> pair = (Map.Entry)it.next(); CountryBordersHierarchy h = pair.getValue(); if(h.inBbox(c)) { List<CountryBordersPolygon> ps = h.getPolygons(); for(CountryBordersPolygon cp : ps) { if(cp.inBbox(c) && cp.inArea(c)) { countries.add(cp); } } } } return countries.toArray(new CountryBordersPolygon[countries.size()]); } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); void addHierarchy(Long id, CountryBordersHierarchy hierarchy); void addId(String id, String localName, String englishName, String cca2, String cca3); void addOpenBorder(String country1, String country2); CountryBordersPolygon[] getCountry(Coordinate c); CountryBordersPolygon[] getCandidateCountry(Coordinate c); String getId(String name); String getEngName(String name); boolean isOpen(String c1, String c2); static int getCountryIdByISOCode(String code); static final String INTERNATIONAL_NAME; static final String INTERNATIONAL_ID; static final String KEY_PROPERTIES; }
@Test public void TestGetCandidateCountry() { Coordinate c = new Coordinate(-0.25, -0.25); CountryBordersPolygon[] polys = _reader.getCandidateCountry(c); assertEquals(1, polys.length); assertEquals("country3", polys[0].getName()); }
public CountryBordersPolygon[] getCandidateCountry(Coordinate c) { ArrayList<CountryBordersPolygon> countries = new ArrayList<>(); Iterator it = hierarchies.entrySet().iterator(); while(it.hasNext()) { Map.Entry<Long, CountryBordersHierarchy> pair = (Map.Entry)it.next(); CountryBordersHierarchy h = pair.getValue(); if(h.inBbox(c)) { List<CountryBordersPolygon> ps = h.getPolygons(); for(CountryBordersPolygon cp : ps) { if(cp.inBbox(c)) { countries.add(cp); } } } } return countries.toArray(new CountryBordersPolygon[countries.size()]); }
CountryBordersReader { public CountryBordersPolygon[] getCandidateCountry(Coordinate c) { ArrayList<CountryBordersPolygon> countries = new ArrayList<>(); Iterator it = hierarchies.entrySet().iterator(); while(it.hasNext()) { Map.Entry<Long, CountryBordersHierarchy> pair = (Map.Entry)it.next(); CountryBordersHierarchy h = pair.getValue(); if(h.inBbox(c)) { List<CountryBordersPolygon> ps = h.getPolygons(); for(CountryBordersPolygon cp : ps) { if(cp.inBbox(c)) { countries.add(cp); } } } } return countries.toArray(new CountryBordersPolygon[countries.size()]); } }
CountryBordersReader { public CountryBordersPolygon[] getCandidateCountry(Coordinate c) { ArrayList<CountryBordersPolygon> countries = new ArrayList<>(); Iterator it = hierarchies.entrySet().iterator(); while(it.hasNext()) { Map.Entry<Long, CountryBordersHierarchy> pair = (Map.Entry)it.next(); CountryBordersHierarchy h = pair.getValue(); if(h.inBbox(c)) { List<CountryBordersPolygon> ps = h.getPolygons(); for(CountryBordersPolygon cp : ps) { if(cp.inBbox(c)) { countries.add(cp); } } } } return countries.toArray(new CountryBordersPolygon[countries.size()]); } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); }
CountryBordersReader { public CountryBordersPolygon[] getCandidateCountry(Coordinate c) { ArrayList<CountryBordersPolygon> countries = new ArrayList<>(); Iterator it = hierarchies.entrySet().iterator(); while(it.hasNext()) { Map.Entry<Long, CountryBordersHierarchy> pair = (Map.Entry)it.next(); CountryBordersHierarchy h = pair.getValue(); if(h.inBbox(c)) { List<CountryBordersPolygon> ps = h.getPolygons(); for(CountryBordersPolygon cp : ps) { if(cp.inBbox(c)) { countries.add(cp); } } } } return countries.toArray(new CountryBordersPolygon[countries.size()]); } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); void addHierarchy(Long id, CountryBordersHierarchy hierarchy); void addId(String id, String localName, String englishName, String cca2, String cca3); void addOpenBorder(String country1, String country2); CountryBordersPolygon[] getCountry(Coordinate c); CountryBordersPolygon[] getCandidateCountry(Coordinate c); String getId(String name); String getEngName(String name); boolean isOpen(String c1, String c2); static int getCountryIdByISOCode(String code); }
CountryBordersReader { public CountryBordersPolygon[] getCandidateCountry(Coordinate c) { ArrayList<CountryBordersPolygon> countries = new ArrayList<>(); Iterator it = hierarchies.entrySet().iterator(); while(it.hasNext()) { Map.Entry<Long, CountryBordersHierarchy> pair = (Map.Entry)it.next(); CountryBordersHierarchy h = pair.getValue(); if(h.inBbox(c)) { List<CountryBordersPolygon> ps = h.getPolygons(); for(CountryBordersPolygon cp : ps) { if(cp.inBbox(c)) { countries.add(cp); } } } } return countries.toArray(new CountryBordersPolygon[countries.size()]); } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); void addHierarchy(Long id, CountryBordersHierarchy hierarchy); void addId(String id, String localName, String englishName, String cca2, String cca3); void addOpenBorder(String country1, String country2); CountryBordersPolygon[] getCountry(Coordinate c); CountryBordersPolygon[] getCandidateCountry(Coordinate c); String getId(String name); String getEngName(String name); boolean isOpen(String c1, String c2); static int getCountryIdByISOCode(String code); static final String INTERNATIONAL_NAME; static final String INTERNATIONAL_ID; static final String KEY_PROPERTIES; }
@Test public void TestGetCountryId() { assertEquals("1", _reader.getId("country1")); }
public String getId(String name) { if(name.equals(INTERNATIONAL_NAME)) return INTERNATIONAL_ID; if(ids.containsKey(name)) return ids.get(name).id; else return ""; }
CountryBordersReader { public String getId(String name) { if(name.equals(INTERNATIONAL_NAME)) return INTERNATIONAL_ID; if(ids.containsKey(name)) return ids.get(name).id; else return ""; } }
CountryBordersReader { public String getId(String name) { if(name.equals(INTERNATIONAL_NAME)) return INTERNATIONAL_ID; if(ids.containsKey(name)) return ids.get(name).id; else return ""; } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); }
CountryBordersReader { public String getId(String name) { if(name.equals(INTERNATIONAL_NAME)) return INTERNATIONAL_ID; if(ids.containsKey(name)) return ids.get(name).id; else return ""; } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); void addHierarchy(Long id, CountryBordersHierarchy hierarchy); void addId(String id, String localName, String englishName, String cca2, String cca3); void addOpenBorder(String country1, String country2); CountryBordersPolygon[] getCountry(Coordinate c); CountryBordersPolygon[] getCandidateCountry(Coordinate c); String getId(String name); String getEngName(String name); boolean isOpen(String c1, String c2); static int getCountryIdByISOCode(String code); }
CountryBordersReader { public String getId(String name) { if(name.equals(INTERNATIONAL_NAME)) return INTERNATIONAL_ID; if(ids.containsKey(name)) return ids.get(name).id; else return ""; } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); void addHierarchy(Long id, CountryBordersHierarchy hierarchy); void addId(String id, String localName, String englishName, String cca2, String cca3); void addOpenBorder(String country1, String country2); CountryBordersPolygon[] getCountry(Coordinate c); CountryBordersPolygon[] getCandidateCountry(Coordinate c); String getId(String name); String getEngName(String name); boolean isOpen(String c1, String c2); static int getCountryIdByISOCode(String code); static final String INTERNATIONAL_NAME; static final String INTERNATIONAL_ID; static final String KEY_PROPERTIES; }
@Test public void TestGetCountryEnglishName() { assertEquals("country1 English", _reader.getEngName("country1")); }
public String getEngName(String name) { if(name.equals(INTERNATIONAL_NAME)) return INTERNATIONAL_NAME; if(ids.containsKey(name)) return ids.get(name).nameEng; else return ""; }
CountryBordersReader { public String getEngName(String name) { if(name.equals(INTERNATIONAL_NAME)) return INTERNATIONAL_NAME; if(ids.containsKey(name)) return ids.get(name).nameEng; else return ""; } }
CountryBordersReader { public String getEngName(String name) { if(name.equals(INTERNATIONAL_NAME)) return INTERNATIONAL_NAME; if(ids.containsKey(name)) return ids.get(name).nameEng; else return ""; } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); }
CountryBordersReader { public String getEngName(String name) { if(name.equals(INTERNATIONAL_NAME)) return INTERNATIONAL_NAME; if(ids.containsKey(name)) return ids.get(name).nameEng; else return ""; } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); void addHierarchy(Long id, CountryBordersHierarchy hierarchy); void addId(String id, String localName, String englishName, String cca2, String cca3); void addOpenBorder(String country1, String country2); CountryBordersPolygon[] getCountry(Coordinate c); CountryBordersPolygon[] getCandidateCountry(Coordinate c); String getId(String name); String getEngName(String name); boolean isOpen(String c1, String c2); static int getCountryIdByISOCode(String code); }
CountryBordersReader { public String getEngName(String name) { if(name.equals(INTERNATIONAL_NAME)) return INTERNATIONAL_NAME; if(ids.containsKey(name)) return ids.get(name).nameEng; else return ""; } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); void addHierarchy(Long id, CountryBordersHierarchy hierarchy); void addId(String id, String localName, String englishName, String cca2, String cca3); void addOpenBorder(String country1, String country2); CountryBordersPolygon[] getCountry(Coordinate c); CountryBordersPolygon[] getCandidateCountry(Coordinate c); String getId(String name); String getEngName(String name); boolean isOpen(String c1, String c2); static int getCountryIdByISOCode(String code); static final String INTERNATIONAL_NAME; static final String INTERNATIONAL_ID; static final String KEY_PROPERTIES; }
@Test public void TestGetOpenBorder() { assertTrue(_reader.isOpen("country1", "country2")); assertFalse(_reader.isOpen("country1", "country3")); }
public boolean isOpen(String c1, String c2) { if(openBorders.containsKey(c1)) { return openBorders.get(c1).contains(c2); } else if(openBorders.containsKey(c2)) return openBorders.get(c2).contains(c1); return false; }
CountryBordersReader { public boolean isOpen(String c1, String c2) { if(openBorders.containsKey(c1)) { return openBorders.get(c1).contains(c2); } else if(openBorders.containsKey(c2)) return openBorders.get(c2).contains(c1); return false; } }
CountryBordersReader { public boolean isOpen(String c1, String c2) { if(openBorders.containsKey(c1)) { return openBorders.get(c1).contains(c2); } else if(openBorders.containsKey(c2)) return openBorders.get(c2).contains(c1); return false; } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); }
CountryBordersReader { public boolean isOpen(String c1, String c2) { if(openBorders.containsKey(c1)) { return openBorders.get(c1).contains(c2); } else if(openBorders.containsKey(c2)) return openBorders.get(c2).contains(c1); return false; } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); void addHierarchy(Long id, CountryBordersHierarchy hierarchy); void addId(String id, String localName, String englishName, String cca2, String cca3); void addOpenBorder(String country1, String country2); CountryBordersPolygon[] getCountry(Coordinate c); CountryBordersPolygon[] getCandidateCountry(Coordinate c); String getId(String name); String getEngName(String name); boolean isOpen(String c1, String c2); static int getCountryIdByISOCode(String code); }
CountryBordersReader { public boolean isOpen(String c1, String c2) { if(openBorders.containsKey(c1)) { return openBorders.get(c1).contains(c2); } else if(openBorders.containsKey(c2)) return openBorders.get(c2).contains(c1); return false; } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); void addHierarchy(Long id, CountryBordersHierarchy hierarchy); void addId(String id, String localName, String englishName, String cca2, String cca3); void addOpenBorder(String country1, String country2); CountryBordersPolygon[] getCountry(Coordinate c); CountryBordersPolygon[] getCandidateCountry(Coordinate c); String getId(String name); String getEngName(String name); boolean isOpen(String c1, String c2); static int getCountryIdByISOCode(String code); static final String INTERNATIONAL_NAME; static final String INTERNATIONAL_ID; static final String KEY_PROPERTIES; }
@Test public void TestGetCountryIdByISOCode() { assertEquals(1, CountryBordersReader.getCountryIdByISOCode("CT")); assertEquals(1, CountryBordersReader.getCountryIdByISOCode("CTR")); assertEquals(0, CountryBordersReader.getCountryIdByISOCode("FOO")); }
public static int getCountryIdByISOCode(String code) { return currentInstance != null ? currentInstance.isoCodes.getOrDefault(code.toUpperCase(), 0) : 0; }
CountryBordersReader { public static int getCountryIdByISOCode(String code) { return currentInstance != null ? currentInstance.isoCodes.getOrDefault(code.toUpperCase(), 0) : 0; } }
CountryBordersReader { public static int getCountryIdByISOCode(String code) { return currentInstance != null ? currentInstance.isoCodes.getOrDefault(code.toUpperCase(), 0) : 0; } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); }
CountryBordersReader { public static int getCountryIdByISOCode(String code) { return currentInstance != null ? currentInstance.isoCodes.getOrDefault(code.toUpperCase(), 0) : 0; } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); void addHierarchy(Long id, CountryBordersHierarchy hierarchy); void addId(String id, String localName, String englishName, String cca2, String cca3); void addOpenBorder(String country1, String country2); CountryBordersPolygon[] getCountry(Coordinate c); CountryBordersPolygon[] getCandidateCountry(Coordinate c); String getId(String name); String getEngName(String name); boolean isOpen(String c1, String c2); static int getCountryIdByISOCode(String code); }
CountryBordersReader { public static int getCountryIdByISOCode(String code) { return currentInstance != null ? currentInstance.isoCodes.getOrDefault(code.toUpperCase(), 0) : 0; } CountryBordersReader(); CountryBordersReader(String filepath, String idsPath, String openPath); void addHierarchy(Long id, CountryBordersHierarchy hierarchy); void addId(String id, String localName, String englishName, String cca2, String cca3); void addOpenBorder(String country1, String country2); CountryBordersPolygon[] getCountry(Coordinate c); CountryBordersPolygon[] getCandidateCountry(Coordinate c); String getId(String name); String getEngName(String name); boolean isOpen(String c1, String c2); static int getCountryIdByISOCode(String code); static final String INTERNATIONAL_NAME; static final String INTERNATIONAL_ID; static final String KEY_PROPERTIES; }
@Test public void GetBBoxTest() { double[] bbox = cbh1.getBBox(); assertEquals(-1.0, bbox[0], 0.0); assertEquals(1.0, bbox[1], 0.0); assertEquals(-1.0, bbox[2], 0.0); assertEquals(1.0, bbox[3], 0.0); bbox = cbh2.getBBox(); assertEquals(5.0, bbox[0], 0.0); assertEquals(10.0, bbox[1], 0.0); assertEquals(5.0, bbox[2], 0.0); assertEquals(10.0, bbox[3], 0.0); }
public double[] getBBox() { return new double[] {minLon, maxLon, minLat, maxLat}; }
CountryBordersHierarchy { public double[] getBBox() { return new double[] {minLon, maxLon, minLat, maxLat}; } }
CountryBordersHierarchy { public double[] getBBox() { return new double[] {minLon, maxLon, minLat, maxLat}; } }
CountryBordersHierarchy { public double[] getBBox() { return new double[] {minLon, maxLon, minLat, maxLat}; } void add(CountryBordersPolygon cp); boolean inBbox(Coordinate c); double[] getBBox(); List<CountryBordersPolygon> getPolygons(); List<CountryBordersPolygon> getContainingPolygons(Coordinate c); }
CountryBordersHierarchy { public double[] getBBox() { return new double[] {minLon, maxLon, minLat, maxLat}; } void add(CountryBordersPolygon cp); boolean inBbox(Coordinate c); double[] getBBox(); List<CountryBordersPolygon> getPolygons(); List<CountryBordersPolygon> getContainingPolygons(Coordinate c); }
@Test public void InBBoxTest() { assertTrue(cbh1.inBbox(new Coordinate(0.5, 0.5))); assertTrue(cbh1.inBbox(new Coordinate(-0.5, 0.5))); assertFalse(cbh1.inBbox(new Coordinate(7.5, 7.5))); assertFalse(cbh1.inBbox(new Coordinate(100, 100))); }
public boolean inBbox(Coordinate c) { return !(c.x <= minLon || c.x >= maxLon || c.y <= minLat || c.y >= maxLat); }
CountryBordersHierarchy { public boolean inBbox(Coordinate c) { return !(c.x <= minLon || c.x >= maxLon || c.y <= minLat || c.y >= maxLat); } }
CountryBordersHierarchy { public boolean inBbox(Coordinate c) { return !(c.x <= minLon || c.x >= maxLon || c.y <= minLat || c.y >= maxLat); } }
CountryBordersHierarchy { public boolean inBbox(Coordinate c) { return !(c.x <= minLon || c.x >= maxLon || c.y <= minLat || c.y >= maxLat); } void add(CountryBordersPolygon cp); boolean inBbox(Coordinate c); double[] getBBox(); List<CountryBordersPolygon> getPolygons(); List<CountryBordersPolygon> getContainingPolygons(Coordinate c); }
CountryBordersHierarchy { public boolean inBbox(Coordinate c) { return !(c.x <= minLon || c.x >= maxLon || c.y <= minLat || c.y >= maxLat); } void add(CountryBordersPolygon cp); boolean inBbox(Coordinate c); double[] getBBox(); List<CountryBordersPolygon> getPolygons(); List<CountryBordersPolygon> getContainingPolygons(Coordinate c); }
@Test public void GetCountryTest() { List<CountryBordersPolygon> containing = cbh1.getContainingPolygons(new Coordinate(0.9, 0.9)); assertEquals(1, containing.size()); assertEquals("name1", containing.get(0).getName()); containing = cbh1.getContainingPolygons(new Coordinate(0.0, 0.0)); assertEquals(2, containing.size()); containing = cbh1.getContainingPolygons(new Coordinate(10, 10)); assertEquals(0, containing.size()); }
public List<CountryBordersPolygon> getContainingPolygons(Coordinate c) { ArrayList<CountryBordersPolygon> containing = new ArrayList<>(); if(!Double.isNaN(c.x) && !Double.isNaN(c.y) && inBbox(c)) { for (CountryBordersPolygon cbp : polygons) { if (cbp.inBbox(c)) { containing.add(cbp); } } } return containing; }
CountryBordersHierarchy { public List<CountryBordersPolygon> getContainingPolygons(Coordinate c) { ArrayList<CountryBordersPolygon> containing = new ArrayList<>(); if(!Double.isNaN(c.x) && !Double.isNaN(c.y) && inBbox(c)) { for (CountryBordersPolygon cbp : polygons) { if (cbp.inBbox(c)) { containing.add(cbp); } } } return containing; } }
CountryBordersHierarchy { public List<CountryBordersPolygon> getContainingPolygons(Coordinate c) { ArrayList<CountryBordersPolygon> containing = new ArrayList<>(); if(!Double.isNaN(c.x) && !Double.isNaN(c.y) && inBbox(c)) { for (CountryBordersPolygon cbp : polygons) { if (cbp.inBbox(c)) { containing.add(cbp); } } } return containing; } }
CountryBordersHierarchy { public List<CountryBordersPolygon> getContainingPolygons(Coordinate c) { ArrayList<CountryBordersPolygon> containing = new ArrayList<>(); if(!Double.isNaN(c.x) && !Double.isNaN(c.y) && inBbox(c)) { for (CountryBordersPolygon cbp : polygons) { if (cbp.inBbox(c)) { containing.add(cbp); } } } return containing; } void add(CountryBordersPolygon cp); boolean inBbox(Coordinate c); double[] getBBox(); List<CountryBordersPolygon> getPolygons(); List<CountryBordersPolygon> getContainingPolygons(Coordinate c); }
CountryBordersHierarchy { public List<CountryBordersPolygon> getContainingPolygons(Coordinate c) { ArrayList<CountryBordersPolygon> containing = new ArrayList<>(); if(!Double.isNaN(c.x) && !Double.isNaN(c.y) && inBbox(c)) { for (CountryBordersPolygon cbp : polygons) { if (cbp.inBbox(c)) { containing.add(cbp); } } } return containing; } void add(CountryBordersPolygon cp); boolean inBbox(Coordinate c); double[] getBBox(); List<CountryBordersPolygon> getPolygons(); List<CountryBordersPolygon> getContainingPolygons(Coordinate c); }
@Test public void TestAvoidCountry() { VirtualEdgeIteratorState ve1 = generateEdge(1); VirtualEdgeIteratorState ve2 = generateEdge(2); VirtualEdgeIteratorState ve3 = generateEdge(3); BordersExtractor be = new BordersExtractor(_graphstorage, new int[] {2, 4}); assertEquals(true, be.restrictedCountry(1)); assertEquals(true, be.restrictedCountry(2)); assertEquals(false, be.restrictedCountry(3)); }
public boolean restrictedCountry(int edgeId) { int startCountry = storage.getEdgeValue(edgeId, BordersGraphStorage.Property.START); int endCountry = storage.getEdgeValue(edgeId, BordersGraphStorage.Property.END); for(int i = 0; i< avoidCountries.length; i++) { if(startCountry == avoidCountries[i] || endCountry == avoidCountries[i] ) { return true; } } return false; }
BordersExtractor { public boolean restrictedCountry(int edgeId) { int startCountry = storage.getEdgeValue(edgeId, BordersGraphStorage.Property.START); int endCountry = storage.getEdgeValue(edgeId, BordersGraphStorage.Property.END); for(int i = 0; i< avoidCountries.length; i++) { if(startCountry == avoidCountries[i] || endCountry == avoidCountries[i] ) { return true; } } return false; } }
BordersExtractor { public boolean restrictedCountry(int edgeId) { int startCountry = storage.getEdgeValue(edgeId, BordersGraphStorage.Property.START); int endCountry = storage.getEdgeValue(edgeId, BordersGraphStorage.Property.END); for(int i = 0; i< avoidCountries.length; i++) { if(startCountry == avoidCountries[i] || endCountry == avoidCountries[i] ) { return true; } } return false; } BordersExtractor(BordersGraphStorage storage, int[] avoidCountries); }
BordersExtractor { public boolean restrictedCountry(int edgeId) { int startCountry = storage.getEdgeValue(edgeId, BordersGraphStorage.Property.START); int endCountry = storage.getEdgeValue(edgeId, BordersGraphStorage.Property.END); for(int i = 0; i< avoidCountries.length; i++) { if(startCountry == avoidCountries[i] || endCountry == avoidCountries[i] ) { return true; } } return false; } BordersExtractor(BordersGraphStorage storage, int[] avoidCountries); int getValue(int edgeId); boolean isBorder(int edgeId); boolean isControlledBorder(int edgeId); boolean isOpenBorder(int edgeId); boolean restrictedCountry(int edgeId); boolean isSameCountry(List<Integer> edgeIds); }
BordersExtractor { public boolean restrictedCountry(int edgeId) { int startCountry = storage.getEdgeValue(edgeId, BordersGraphStorage.Property.START); int endCountry = storage.getEdgeValue(edgeId, BordersGraphStorage.Property.END); for(int i = 0; i< avoidCountries.length; i++) { if(startCountry == avoidCountries[i] || endCountry == avoidCountries[i] ) { return true; } } return false; } BordersExtractor(BordersGraphStorage storage, int[] avoidCountries); int getValue(int edgeId); boolean isBorder(int edgeId); boolean isControlledBorder(int edgeId); boolean isOpenBorder(int edgeId); boolean restrictedCountry(int edgeId); boolean isSameCountry(List<Integer> edgeIds); }
@Test public void TestCreateMergedRouteResultFromBestPaths() throws Exception { List<GHResponse> responseList = new ArrayList<>(); RoutingRequest routingRequest = new RouteRequestHandler().convertRouteRequest(request1); List<RouteExtraInfo> extrasList = new ArrayList<>(); RouteResultBuilder builder = new RouteResultBuilder(); RouteResult result = builder.createMergedRouteResultFromBestPaths(responseList, routingRequest, new List[]{extrasList}); Assert.assertEquals("Empty response list should return empty RouteResult (summary.distance = 0.0)", 0.0, result.getSummary().getDistance(), 0.0); Assert.assertEquals("Empty response list should return empty RouteResult (no segments)", 0, result.getSegments().size()); Assert.assertEquals("Empty response list should return empty RouteResult (no extra info)", 0, result.getExtraInfo().size()); Assert.assertNull("Empty response list should return empty RouteResult (no geometry)", result.getGeometry()); extrasList.add(new RouteExtraInfo(APIEnums.ExtraInfo.OSM_ID.toString())); responseList.add(constructResponse(request1)); result = builder.createMergedRouteResultFromBestPaths(responseList, routingRequest, new List[]{extrasList}); Assert.assertEquals("Single response should return valid RouteResult (summary.duration = 1452977.2)", 1452977.2, result.getSummary().getDistance(), 0.0); Assert.assertEquals("Single response should return valid RouteResult (summary.bbox = 45.6,56.7,12.3,23.4)", "45.6,56.7,12.3,23.4", result.getSummary().getBBox().toString()); Assert.assertEquals("Single response should return valid RouteResult (geometry.length = 2)", 2, result.getGeometry().length); Assert.assertEquals("Single response should return valid RouteResult (geometry[0] = 45.6,12.3,NaN)", "(45.6, 12.3, NaN)", result.getGeometry()[0].toString()); Assert.assertEquals("Single response should return valid RouteResult (geometry[1] = 56.7,23.4,NaN)", "(56.7, 23.4, NaN)", result.getGeometry()[1].toString()); Assert.assertEquals("Single response should return valid RouteResult (segments.size = 1)", 1, result.getSegments().size()); Assert.assertEquals("Single response should return valid RouteResult (segments[0].distance = 1452977.2)", 1452977.2, result.getSegments().get(0).getDistance(), 0.0); Assert.assertEquals("Single response should return valid RouteResult (segments[0].detourFactor = 2)", 0.85, result.getSegments().get(0).getDetourFactor(), 0.0); Assert.assertEquals("Single response should return valid RouteResult (segments[0].steps.size = 2)", 2, result.getSegments().get(0).getSteps().size()); Assert.assertEquals("Single response should return valid RouteResult (segments[0].steps[0].name = 'Instruction 1')", "Instruction 1", result.getSegments().get(0).getSteps().get(0).getName()); Assert.assertEquals("Single response should return valid RouteResult (segments[0].steps[0].type = 11)", 11, result.getSegments().get(0).getSteps().get(0).getType()); Assert.assertEquals("Single response should return valid RouteResult (segments[0].steps[0].maneuver.bearingAfter = 44)", 44, result.getSegments().get(0).getSteps().get(0).getManeuver().getBearingAfter()); Assert.assertEquals("Single response should return valid RouteResult (segments[0].steps[1].name = 'Instruction 2')", "Instruction 2", result.getSegments().get(0).getSteps().get(1).getName()); Assert.assertEquals("Single response should return valid RouteResult (segments[0].steps[1].type = 10)", 10, result.getSegments().get(0).getSteps().get(1).getType()); Assert.assertEquals("Single response should return valid RouteResult (segments[0].steps[1].maneuver.bearingAfter = 0)", 0, result.getSegments().get(0).getSteps().get(1).getManeuver().getBearingAfter()); Assert.assertEquals("Single response should return valid RouteResult (extrainfo.size = 1)", 1, result.getExtraInfo().size()); Assert.assertEquals("Single response should return valid RouteResult (extrainfo[0].name = 'osmid)", APIEnums.ExtraInfo.OSM_ID.toString(), result.getExtraInfo().get(0).getName()); Assert.assertEquals("Single response should return valid RouteResult (waypointindices.size = 2)", 2, result.getWayPointsIndices().size()); responseList.add(constructResponse(request2)); result = builder.createMergedRouteResultFromBestPaths(responseList, routingRequest, new List[]{extrasList}); Assert.assertEquals("Two responses should return merged RouteResult (summary.duration = 2809674.1)", 2809674.1, result.getSummary().getDistance(), 0.0); Assert.assertEquals("Two responses should return merged RouteResult (summary.bbox = 45.6,67.8,12.3,34.5)", "45.6,67.8,12.3,34.5", result.getSummary().getBBox().toString()); Assert.assertEquals("Two responses should return merged RouteResult (geometry.length = 3)", 3, result.getGeometry().length); Assert.assertEquals("Two responses should return merged RouteResult (geometry[0] = 45.6,12.3,NaN)", "(45.6, 12.3, NaN)", result.getGeometry()[0].toString()); Assert.assertEquals("Two responses should return merged RouteResult (geometry[1] = 56.7,23.4,NaN)", "(56.7, 23.4, NaN)", result.getGeometry()[1].toString()); Assert.assertEquals("Two responses should return merged RouteResult (geometry[2] = 67.8,34.5,NaN)", "(67.8, 34.5, NaN)", result.getGeometry()[2].toString()); Assert.assertEquals("Two responses should return merged RouteResult (segments.size = 2)", 2, result.getSegments().size()); Assert.assertEquals("Two responses should return merged RouteResult (segments[0].distance = 1452977.2)", 1452977.2, result.getSegments().get(0).getDistance(), 0.0); Assert.assertEquals("Two responses should return merged RouteResult (segments[0].detourFactor = 0.85)", 0.85, result.getSegments().get(0).getDetourFactor(), 0.0); Assert.assertEquals("Two responses should return merged RouteResult (segments[0].steps.size = 2)", 2, result.getSegments().get(0).getSteps().size()); Assert.assertEquals("Two responses should return merged RouteResult (segments[0].steps[0].name = 'Instruction 1')", "Instruction 1", result.getSegments().get(0).getSteps().get(0).getName()); Assert.assertEquals("Two responses should return merged RouteResult (segments[0].steps[0].type = 11)", 11, result.getSegments().get(0).getSteps().get(0).getType()); Assert.assertEquals("Two responses should return merged RouteResult (segments[0].steps[0].maneuver.bearingAfter = 44)", 44, result.getSegments().get(0).getSteps().get(0).getManeuver().getBearingAfter()); Assert.assertEquals("Two responses should return merged RouteResult (segments[0].steps[1].name = 'Instruction 2')", "Instruction 2", result.getSegments().get(0).getSteps().get(1).getName()); Assert.assertEquals("Two responses should return merged RouteResult (segments[0].steps[1].type = 10)", 10, result.getSegments().get(0).getSteps().get(1).getType()); Assert.assertEquals("Two responses should return merged RouteResult (segments[0].steps[1].maneuver.bearingAfter = 0)", 0, result.getSegments().get(0).getSteps().get(1).getManeuver().getBearingAfter()); Assert.assertEquals("Two responses should return merged RouteResult (segments[1].distance = 1356696.9)", 1356696.9, result.getSegments().get(1).getDistance(), 0.0); Assert.assertEquals("Two responses should return merged RouteResult (segments[1].detourFactor = 0.83)", 0.83, result.getSegments().get(1).getDetourFactor(), 0.0); Assert.assertEquals("Two responses should return merged RouteResult (segments[1].steps.size = 2)", 2, result.getSegments().get(1).getSteps().size()); Assert.assertEquals("Two responses should return merged RouteResult (segments[1].steps[0].name = 'Instruction 1')", "Instruction 1", result.getSegments().get(1).getSteps().get(0).getName()); Assert.assertEquals("Two responses should return merged RouteResult (segments[1].steps[0].type = 11)", 11, result.getSegments().get(1).getSteps().get(0).getType()); Assert.assertEquals("Two responses should return merged RouteResult (segments[1].steps[0].maneuver.bearingAfter = 41)", 41, result.getSegments().get(1).getSteps().get(0).getManeuver().getBearingAfter()); Assert.assertEquals("Two responses should return merged RouteResult (segments[1].steps[1].name = 'Instruction 2')", "Instruction 2", result.getSegments().get(1).getSteps().get(1).getName()); Assert.assertEquals("Two responses should return merged RouteResult (segments[1].steps[1].type = 10)", 10, result.getSegments().get(1).getSteps().get(1).getType()); Assert.assertEquals("Two responses should return merged RouteResult (segments[1].steps[1].maneuver.bearingAfter = 0)", 0, result.getSegments().get(1).getSteps().get(1).getManeuver().getBearingAfter()); Assert.assertEquals("Two responses should return merged RouteResult (extrainfo.size = 1)", 1, result.getExtraInfo().size()); Assert.assertEquals("Two responses should return merged RouteResult (extrainfo[0].name = 'osmid)", APIEnums.ExtraInfo.OSM_ID.toString(), result.getExtraInfo().get(0).getName()); Assert.assertEquals("Two responses should return merged RouteResult (waypointindices.size = 3)", 3, result.getWayPointsIndices().size()); RouteRequest modRequest = request1; List<Integer> skipSegments = new ArrayList<>(); skipSegments.add(1); modRequest.setSkipSegments(skipSegments); routingRequest = new RouteRequestHandler().convertRouteRequest(modRequest); responseList = new ArrayList<>(); responseList.add(constructResponse(modRequest)); result = builder.createMergedRouteResultFromBestPaths(responseList, routingRequest, new List[]{extrasList}); Assert.assertEquals("Response with SkipSegments should return RouteResult with warning", 1, result.getWarnings().size()); Assert.assertEquals("Response with SkipSegments should return RouteResult with warning (code 3)", 3, result.getWarnings().get(0).getWarningCode()); }
RouteResult createMergedRouteResultFromBestPaths(List<GHResponse> responses, RoutingRequest request, List<RouteExtraInfo>[] extras) throws Exception { RouteResult result = createInitialRouteResult(request, extras[0]); for (int ri = 0; ri < responses.size(); ++ri) { GHResponse response = responses.get(ri); if (response.hasErrors()) throw new InternalServerException(RoutingErrorCodes.UNKNOWN, String.format("Unable to find a route between points %d (%s) and %d (%s)", ri, FormatUtility.formatCoordinate(request.getCoordinates()[ri]), ri + 1, FormatUtility.formatCoordinate(request.getCoordinates()[ri + 1]))); handleResponseWarnings(result, response); PathWrapper path = response.getBest(); result.addPointlist(path.getPoints()); if (request.getIncludeGeometry()) { result.addPointsToGeometry(path.getPoints(), ri > 0, request.getIncludeElevation()); result.addWayPointIndex(result.getGeometry().length - 1); } result.addSegment(createRouteSegment(path, request, getNextResponseFirstStepPoints(responses, ri))); result.setGraphDate(response.getHints().get("data.date", "0000-00-00T00:00:00Z")); } result.calculateRouteSummary(request); if (!request.getIncludeInstructions()) { result.resetSegments(); } return result; }
RouteResultBuilder { RouteResult createMergedRouteResultFromBestPaths(List<GHResponse> responses, RoutingRequest request, List<RouteExtraInfo>[] extras) throws Exception { RouteResult result = createInitialRouteResult(request, extras[0]); for (int ri = 0; ri < responses.size(); ++ri) { GHResponse response = responses.get(ri); if (response.hasErrors()) throw new InternalServerException(RoutingErrorCodes.UNKNOWN, String.format("Unable to find a route between points %d (%s) and %d (%s)", ri, FormatUtility.formatCoordinate(request.getCoordinates()[ri]), ri + 1, FormatUtility.formatCoordinate(request.getCoordinates()[ri + 1]))); handleResponseWarnings(result, response); PathWrapper path = response.getBest(); result.addPointlist(path.getPoints()); if (request.getIncludeGeometry()) { result.addPointsToGeometry(path.getPoints(), ri > 0, request.getIncludeElevation()); result.addWayPointIndex(result.getGeometry().length - 1); } result.addSegment(createRouteSegment(path, request, getNextResponseFirstStepPoints(responses, ri))); result.setGraphDate(response.getHints().get("data.date", "0000-00-00T00:00:00Z")); } result.calculateRouteSummary(request); if (!request.getIncludeInstructions()) { result.resetSegments(); } return result; } }
RouteResultBuilder { RouteResult createMergedRouteResultFromBestPaths(List<GHResponse> responses, RoutingRequest request, List<RouteExtraInfo>[] extras) throws Exception { RouteResult result = createInitialRouteResult(request, extras[0]); for (int ri = 0; ri < responses.size(); ++ri) { GHResponse response = responses.get(ri); if (response.hasErrors()) throw new InternalServerException(RoutingErrorCodes.UNKNOWN, String.format("Unable to find a route between points %d (%s) and %d (%s)", ri, FormatUtility.formatCoordinate(request.getCoordinates()[ri]), ri + 1, FormatUtility.formatCoordinate(request.getCoordinates()[ri + 1]))); handleResponseWarnings(result, response); PathWrapper path = response.getBest(); result.addPointlist(path.getPoints()); if (request.getIncludeGeometry()) { result.addPointsToGeometry(path.getPoints(), ri > 0, request.getIncludeElevation()); result.addWayPointIndex(result.getGeometry().length - 1); } result.addSegment(createRouteSegment(path, request, getNextResponseFirstStepPoints(responses, ri))); result.setGraphDate(response.getHints().get("data.date", "0000-00-00T00:00:00Z")); } result.calculateRouteSummary(request); if (!request.getIncludeInstructions()) { result.resetSegments(); } return result; } RouteResultBuilder(); }
RouteResultBuilder { RouteResult createMergedRouteResultFromBestPaths(List<GHResponse> responses, RoutingRequest request, List<RouteExtraInfo>[] extras) throws Exception { RouteResult result = createInitialRouteResult(request, extras[0]); for (int ri = 0; ri < responses.size(); ++ri) { GHResponse response = responses.get(ri); if (response.hasErrors()) throw new InternalServerException(RoutingErrorCodes.UNKNOWN, String.format("Unable to find a route between points %d (%s) and %d (%s)", ri, FormatUtility.formatCoordinate(request.getCoordinates()[ri]), ri + 1, FormatUtility.formatCoordinate(request.getCoordinates()[ri + 1]))); handleResponseWarnings(result, response); PathWrapper path = response.getBest(); result.addPointlist(path.getPoints()); if (request.getIncludeGeometry()) { result.addPointsToGeometry(path.getPoints(), ri > 0, request.getIncludeElevation()); result.addWayPointIndex(result.getGeometry().length - 1); } result.addSegment(createRouteSegment(path, request, getNextResponseFirstStepPoints(responses, ri))); result.setGraphDate(response.getHints().get("data.date", "0000-00-00T00:00:00Z")); } result.calculateRouteSummary(request); if (!request.getIncludeInstructions()) { result.resetSegments(); } return result; } RouteResultBuilder(); }
RouteResultBuilder { RouteResult createMergedRouteResultFromBestPaths(List<GHResponse> responses, RoutingRequest request, List<RouteExtraInfo>[] extras) throws Exception { RouteResult result = createInitialRouteResult(request, extras[0]); for (int ri = 0; ri < responses.size(); ++ri) { GHResponse response = responses.get(ri); if (response.hasErrors()) throw new InternalServerException(RoutingErrorCodes.UNKNOWN, String.format("Unable to find a route between points %d (%s) and %d (%s)", ri, FormatUtility.formatCoordinate(request.getCoordinates()[ri]), ri + 1, FormatUtility.formatCoordinate(request.getCoordinates()[ri + 1]))); handleResponseWarnings(result, response); PathWrapper path = response.getBest(); result.addPointlist(path.getPoints()); if (request.getIncludeGeometry()) { result.addPointsToGeometry(path.getPoints(), ri > 0, request.getIncludeElevation()); result.addWayPointIndex(result.getGeometry().length - 1); } result.addSegment(createRouteSegment(path, request, getNextResponseFirstStepPoints(responses, ri))); result.setGraphDate(response.getHints().get("data.date", "0000-00-00T00:00:00Z")); } result.calculateRouteSummary(request); if (!request.getIncludeInstructions()) { result.resetSegments(); } return result; } RouteResultBuilder(); }
@Test public void getProfileType() { RouteSearchParameters routeSearchParameters = new RouteSearchParameters(); Assert.assertEquals(0, routeSearchParameters.getProfileType()); }
public int getProfileType() { return profileType; }
RouteSearchParameters { public int getProfileType() { return profileType; } }
RouteSearchParameters { public int getProfileType() { return profileType; } }
RouteSearchParameters { public int getProfileType() { return profileType; } int getProfileType(); void setProfileType(int profileType); int getWeightingMethod(); void setWeightingMethod(int weightingMethod); Polygon[] getAvoidAreas(); void setAvoidAreas(Polygon[] avoidAreas); boolean hasAvoidAreas(); int getAvoidFeatureTypes(); void setAvoidFeatureTypes(int avoidFeatures); boolean hasAvoidFeatures(); int[] getAvoidCountries(); void setAvoidCountries(int[] avoidCountries); boolean hasAvoidCountries(); boolean hasAvoidBorders(); void setAvoidBorders(BordersExtractor.Avoid avoidBorders); BordersExtractor.Avoid getAvoidBorders(); Boolean getConsiderTurnRestrictions(); void setConsiderTurnRestrictions(Boolean considerTurnRestrictions); int getVehicleType(); void setVehicleType(int vehicleType); int getAlternativeRoutesCount(); void setAlternativeRoutesCount(int alternativeRoutesCount); double getAlternativeRoutesWeightFactor(); void setAlternativeRoutesWeightFactor(double alternativeRoutesWeightFactor); double getAlternativeRoutesShareFactor(); void setAlternativeRoutesShareFactor(double alternativeRoutesShareFactor); int getExtraInfo(); void setExtraInfo(int extraInfo); boolean getSuppressWarnings(); void setSuppressWarnings(boolean suppressWarnings); String getOptions(); void setOptions(String options); boolean hasParameters(Class<?> value); ProfileParameters getProfileParameters(); void setProfileParams(ProfileParameters profileParams); boolean getFlexibleMode(); void setFlexibleMode(boolean flexibleMode); boolean getOptimized(); void setOptimized(boolean optimized); double[] getMaximumRadiuses(); void setMaximumRadiuses(double[] maxRadiuses); WayPointBearing[] getBearings(); void setBearings(WayPointBearing[] bearings); boolean hasBearings(); void setRoundTripLength(float length); float getRoundTripLength(); void setRoundTripPoints(int points); int getRoundTripPoints(); void setRoundTripSeed(long seed); long getRoundTripSeed(); double getMaximumSpeed(); void setMaximumSpeed(double maximumSpeed); boolean hasMaximumSpeed(); boolean isProfileTypeDriving(); boolean isProfileTypeHeavyVehicle(); boolean requiresDynamicPreprocessedWeights(); boolean requiresFullyDynamicWeights(); }
RouteSearchParameters { public int getProfileType() { return profileType; } int getProfileType(); void setProfileType(int profileType); int getWeightingMethod(); void setWeightingMethod(int weightingMethod); Polygon[] getAvoidAreas(); void setAvoidAreas(Polygon[] avoidAreas); boolean hasAvoidAreas(); int getAvoidFeatureTypes(); void setAvoidFeatureTypes(int avoidFeatures); boolean hasAvoidFeatures(); int[] getAvoidCountries(); void setAvoidCountries(int[] avoidCountries); boolean hasAvoidCountries(); boolean hasAvoidBorders(); void setAvoidBorders(BordersExtractor.Avoid avoidBorders); BordersExtractor.Avoid getAvoidBorders(); Boolean getConsiderTurnRestrictions(); void setConsiderTurnRestrictions(Boolean considerTurnRestrictions); int getVehicleType(); void setVehicleType(int vehicleType); int getAlternativeRoutesCount(); void setAlternativeRoutesCount(int alternativeRoutesCount); double getAlternativeRoutesWeightFactor(); void setAlternativeRoutesWeightFactor(double alternativeRoutesWeightFactor); double getAlternativeRoutesShareFactor(); void setAlternativeRoutesShareFactor(double alternativeRoutesShareFactor); int getExtraInfo(); void setExtraInfo(int extraInfo); boolean getSuppressWarnings(); void setSuppressWarnings(boolean suppressWarnings); String getOptions(); void setOptions(String options); boolean hasParameters(Class<?> value); ProfileParameters getProfileParameters(); void setProfileParams(ProfileParameters profileParams); boolean getFlexibleMode(); void setFlexibleMode(boolean flexibleMode); boolean getOptimized(); void setOptimized(boolean optimized); double[] getMaximumRadiuses(); void setMaximumRadiuses(double[] maxRadiuses); WayPointBearing[] getBearings(); void setBearings(WayPointBearing[] bearings); boolean hasBearings(); void setRoundTripLength(float length); float getRoundTripLength(); void setRoundTripPoints(int points); int getRoundTripPoints(); void setRoundTripSeed(long seed); long getRoundTripSeed(); double getMaximumSpeed(); void setMaximumSpeed(double maximumSpeed); boolean hasMaximumSpeed(); boolean isProfileTypeDriving(); boolean isProfileTypeHeavyVehicle(); boolean requiresDynamicPreprocessedWeights(); boolean requiresFullyDynamicWeights(); static final String KEY_AVOID_COUNTRIES; static final String KEY_AVOID_BORDERS; static final String KEY_PROFILE_PARAMS; static final String KEY_AVOID_FEATURES; static final String KEY_AVOID_POLYGONS; static final String KEY_ALTERNATIVE_ROUTES_WEIGHT_FACTOR; static final String KEY_ALTERNATIVE_ROUTES_SHARE_FACTOR; }
@Test public void setProfileType() throws Exception { RouteSearchParameters routeSearchParameters = new RouteSearchParameters(); routeSearchParameters.setProfileType(2); Assert.assertEquals(2, routeSearchParameters.getProfileType()); }
public void setProfileType(int profileType) throws Exception { if (profileType == RoutingProfileType.UNKNOWN) throw new Exception("Routing profile is unknown."); this.profileType = profileType; }
RouteSearchParameters { public void setProfileType(int profileType) throws Exception { if (profileType == RoutingProfileType.UNKNOWN) throw new Exception("Routing profile is unknown."); this.profileType = profileType; } }
RouteSearchParameters { public void setProfileType(int profileType) throws Exception { if (profileType == RoutingProfileType.UNKNOWN) throw new Exception("Routing profile is unknown."); this.profileType = profileType; } }
RouteSearchParameters { public void setProfileType(int profileType) throws Exception { if (profileType == RoutingProfileType.UNKNOWN) throw new Exception("Routing profile is unknown."); this.profileType = profileType; } int getProfileType(); void setProfileType(int profileType); int getWeightingMethod(); void setWeightingMethod(int weightingMethod); Polygon[] getAvoidAreas(); void setAvoidAreas(Polygon[] avoidAreas); boolean hasAvoidAreas(); int getAvoidFeatureTypes(); void setAvoidFeatureTypes(int avoidFeatures); boolean hasAvoidFeatures(); int[] getAvoidCountries(); void setAvoidCountries(int[] avoidCountries); boolean hasAvoidCountries(); boolean hasAvoidBorders(); void setAvoidBorders(BordersExtractor.Avoid avoidBorders); BordersExtractor.Avoid getAvoidBorders(); Boolean getConsiderTurnRestrictions(); void setConsiderTurnRestrictions(Boolean considerTurnRestrictions); int getVehicleType(); void setVehicleType(int vehicleType); int getAlternativeRoutesCount(); void setAlternativeRoutesCount(int alternativeRoutesCount); double getAlternativeRoutesWeightFactor(); void setAlternativeRoutesWeightFactor(double alternativeRoutesWeightFactor); double getAlternativeRoutesShareFactor(); void setAlternativeRoutesShareFactor(double alternativeRoutesShareFactor); int getExtraInfo(); void setExtraInfo(int extraInfo); boolean getSuppressWarnings(); void setSuppressWarnings(boolean suppressWarnings); String getOptions(); void setOptions(String options); boolean hasParameters(Class<?> value); ProfileParameters getProfileParameters(); void setProfileParams(ProfileParameters profileParams); boolean getFlexibleMode(); void setFlexibleMode(boolean flexibleMode); boolean getOptimized(); void setOptimized(boolean optimized); double[] getMaximumRadiuses(); void setMaximumRadiuses(double[] maxRadiuses); WayPointBearing[] getBearings(); void setBearings(WayPointBearing[] bearings); boolean hasBearings(); void setRoundTripLength(float length); float getRoundTripLength(); void setRoundTripPoints(int points); int getRoundTripPoints(); void setRoundTripSeed(long seed); long getRoundTripSeed(); double getMaximumSpeed(); void setMaximumSpeed(double maximumSpeed); boolean hasMaximumSpeed(); boolean isProfileTypeDriving(); boolean isProfileTypeHeavyVehicle(); boolean requiresDynamicPreprocessedWeights(); boolean requiresFullyDynamicWeights(); }
RouteSearchParameters { public void setProfileType(int profileType) throws Exception { if (profileType == RoutingProfileType.UNKNOWN) throw new Exception("Routing profile is unknown."); this.profileType = profileType; } int getProfileType(); void setProfileType(int profileType); int getWeightingMethod(); void setWeightingMethod(int weightingMethod); Polygon[] getAvoidAreas(); void setAvoidAreas(Polygon[] avoidAreas); boolean hasAvoidAreas(); int getAvoidFeatureTypes(); void setAvoidFeatureTypes(int avoidFeatures); boolean hasAvoidFeatures(); int[] getAvoidCountries(); void setAvoidCountries(int[] avoidCountries); boolean hasAvoidCountries(); boolean hasAvoidBorders(); void setAvoidBorders(BordersExtractor.Avoid avoidBorders); BordersExtractor.Avoid getAvoidBorders(); Boolean getConsiderTurnRestrictions(); void setConsiderTurnRestrictions(Boolean considerTurnRestrictions); int getVehicleType(); void setVehicleType(int vehicleType); int getAlternativeRoutesCount(); void setAlternativeRoutesCount(int alternativeRoutesCount); double getAlternativeRoutesWeightFactor(); void setAlternativeRoutesWeightFactor(double alternativeRoutesWeightFactor); double getAlternativeRoutesShareFactor(); void setAlternativeRoutesShareFactor(double alternativeRoutesShareFactor); int getExtraInfo(); void setExtraInfo(int extraInfo); boolean getSuppressWarnings(); void setSuppressWarnings(boolean suppressWarnings); String getOptions(); void setOptions(String options); boolean hasParameters(Class<?> value); ProfileParameters getProfileParameters(); void setProfileParams(ProfileParameters profileParams); boolean getFlexibleMode(); void setFlexibleMode(boolean flexibleMode); boolean getOptimized(); void setOptimized(boolean optimized); double[] getMaximumRadiuses(); void setMaximumRadiuses(double[] maxRadiuses); WayPointBearing[] getBearings(); void setBearings(WayPointBearing[] bearings); boolean hasBearings(); void setRoundTripLength(float length); float getRoundTripLength(); void setRoundTripPoints(int points); int getRoundTripPoints(); void setRoundTripSeed(long seed); long getRoundTripSeed(); double getMaximumSpeed(); void setMaximumSpeed(double maximumSpeed); boolean hasMaximumSpeed(); boolean isProfileTypeDriving(); boolean isProfileTypeHeavyVehicle(); boolean requiresDynamicPreprocessedWeights(); boolean requiresFullyDynamicWeights(); static final String KEY_AVOID_COUNTRIES; static final String KEY_AVOID_BORDERS; static final String KEY_PROFILE_PARAMS; static final String KEY_AVOID_FEATURES; static final String KEY_AVOID_POLYGONS; static final String KEY_ALTERNATIVE_ROUTES_WEIGHT_FACTOR; static final String KEY_ALTERNATIVE_ROUTES_SHARE_FACTOR; }
@Test public void getWeightingMethod() { RouteSearchParameters routeSearchParameters = new RouteSearchParameters(); Assert.assertEquals(WeightingMethod.FASTEST, routeSearchParameters.getWeightingMethod(), 0.0); }
public int getWeightingMethod() { return weightingMethod; }
RouteSearchParameters { public int getWeightingMethod() { return weightingMethod; } }
RouteSearchParameters { public int getWeightingMethod() { return weightingMethod; } }
RouteSearchParameters { public int getWeightingMethod() { return weightingMethod; } int getProfileType(); void setProfileType(int profileType); int getWeightingMethod(); void setWeightingMethod(int weightingMethod); Polygon[] getAvoidAreas(); void setAvoidAreas(Polygon[] avoidAreas); boolean hasAvoidAreas(); int getAvoidFeatureTypes(); void setAvoidFeatureTypes(int avoidFeatures); boolean hasAvoidFeatures(); int[] getAvoidCountries(); void setAvoidCountries(int[] avoidCountries); boolean hasAvoidCountries(); boolean hasAvoidBorders(); void setAvoidBorders(BordersExtractor.Avoid avoidBorders); BordersExtractor.Avoid getAvoidBorders(); Boolean getConsiderTurnRestrictions(); void setConsiderTurnRestrictions(Boolean considerTurnRestrictions); int getVehicleType(); void setVehicleType(int vehicleType); int getAlternativeRoutesCount(); void setAlternativeRoutesCount(int alternativeRoutesCount); double getAlternativeRoutesWeightFactor(); void setAlternativeRoutesWeightFactor(double alternativeRoutesWeightFactor); double getAlternativeRoutesShareFactor(); void setAlternativeRoutesShareFactor(double alternativeRoutesShareFactor); int getExtraInfo(); void setExtraInfo(int extraInfo); boolean getSuppressWarnings(); void setSuppressWarnings(boolean suppressWarnings); String getOptions(); void setOptions(String options); boolean hasParameters(Class<?> value); ProfileParameters getProfileParameters(); void setProfileParams(ProfileParameters profileParams); boolean getFlexibleMode(); void setFlexibleMode(boolean flexibleMode); boolean getOptimized(); void setOptimized(boolean optimized); double[] getMaximumRadiuses(); void setMaximumRadiuses(double[] maxRadiuses); WayPointBearing[] getBearings(); void setBearings(WayPointBearing[] bearings); boolean hasBearings(); void setRoundTripLength(float length); float getRoundTripLength(); void setRoundTripPoints(int points); int getRoundTripPoints(); void setRoundTripSeed(long seed); long getRoundTripSeed(); double getMaximumSpeed(); void setMaximumSpeed(double maximumSpeed); boolean hasMaximumSpeed(); boolean isProfileTypeDriving(); boolean isProfileTypeHeavyVehicle(); boolean requiresDynamicPreprocessedWeights(); boolean requiresFullyDynamicWeights(); }
RouteSearchParameters { public int getWeightingMethod() { return weightingMethod; } int getProfileType(); void setProfileType(int profileType); int getWeightingMethod(); void setWeightingMethod(int weightingMethod); Polygon[] getAvoidAreas(); void setAvoidAreas(Polygon[] avoidAreas); boolean hasAvoidAreas(); int getAvoidFeatureTypes(); void setAvoidFeatureTypes(int avoidFeatures); boolean hasAvoidFeatures(); int[] getAvoidCountries(); void setAvoidCountries(int[] avoidCountries); boolean hasAvoidCountries(); boolean hasAvoidBorders(); void setAvoidBorders(BordersExtractor.Avoid avoidBorders); BordersExtractor.Avoid getAvoidBorders(); Boolean getConsiderTurnRestrictions(); void setConsiderTurnRestrictions(Boolean considerTurnRestrictions); int getVehicleType(); void setVehicleType(int vehicleType); int getAlternativeRoutesCount(); void setAlternativeRoutesCount(int alternativeRoutesCount); double getAlternativeRoutesWeightFactor(); void setAlternativeRoutesWeightFactor(double alternativeRoutesWeightFactor); double getAlternativeRoutesShareFactor(); void setAlternativeRoutesShareFactor(double alternativeRoutesShareFactor); int getExtraInfo(); void setExtraInfo(int extraInfo); boolean getSuppressWarnings(); void setSuppressWarnings(boolean suppressWarnings); String getOptions(); void setOptions(String options); boolean hasParameters(Class<?> value); ProfileParameters getProfileParameters(); void setProfileParams(ProfileParameters profileParams); boolean getFlexibleMode(); void setFlexibleMode(boolean flexibleMode); boolean getOptimized(); void setOptimized(boolean optimized); double[] getMaximumRadiuses(); void setMaximumRadiuses(double[] maxRadiuses); WayPointBearing[] getBearings(); void setBearings(WayPointBearing[] bearings); boolean hasBearings(); void setRoundTripLength(float length); float getRoundTripLength(); void setRoundTripPoints(int points); int getRoundTripPoints(); void setRoundTripSeed(long seed); long getRoundTripSeed(); double getMaximumSpeed(); void setMaximumSpeed(double maximumSpeed); boolean hasMaximumSpeed(); boolean isProfileTypeDriving(); boolean isProfileTypeHeavyVehicle(); boolean requiresDynamicPreprocessedWeights(); boolean requiresFullyDynamicWeights(); static final String KEY_AVOID_COUNTRIES; static final String KEY_AVOID_BORDERS; static final String KEY_PROFILE_PARAMS; static final String KEY_AVOID_FEATURES; static final String KEY_AVOID_POLYGONS; static final String KEY_ALTERNATIVE_ROUTES_WEIGHT_FACTOR; static final String KEY_ALTERNATIVE_ROUTES_SHARE_FACTOR; }