List<String> lines = Helper.readFile(file); List<Integer> landmarkNodeIds = new ArrayList<>(); BBox bbox = BBox.createInverse(false); int lmSuggestionIdx = 0; String errors = "";
/** * Calculates the 2D bounding box of this route */ public BBox calcBBox2D() { check("calcRouteBBox"); BBox bounds = BBox.createInverse(false); for (int i = 0; i < pointList.getSize(); i++) { bounds.update(pointList.getLatitude(i), pointList.getLongitude(i)); } return bounds; }
BBox polygonBounds = BBox.createInverse(false); List<SpatialRule> spatialRules = new ArrayList<>();
this.bounds = BBox.createInverse(withElevation); this.nodeAccess = new GHNodeAccess(this, withElevation); this.extStorage = extendedStorage;
@Test public void testBounds() { graph = createGHStorage(); BBox b = graph.getBounds(); assertEquals(BBox.createInverse(false).maxLat, b.maxLat, 1e-6); NodeAccess na = graph.getNodeAccess(); na.setNode(0, 10, 20); assertEquals(10, b.maxLat, 1e-6); assertEquals(20, b.maxLon, 1e-6); na.setNode(0, 15, -15); assertEquals(15, b.maxLat, 1e-6); assertEquals(20, b.maxLon, 1e-6); assertEquals(10, b.minLat, 1e-6); assertEquals(-15, b.minLon, 1e-6); }
@Test public void testCannotBeLoadedWithNormalGraphHopperStorageClass() { graph = newGHStorage(new RAMDirectory(defaultGraphLoc, true), false).create(defaultSize); graph.flush(); graph.close(); graph = new GraphBuilder(encodingManager).setLocation(defaultGraphLoc).setMmap(false).setStore(true).create(); try { graph.loadExisting(); fail(); } catch (Exception ex) { } graph = newGHStorage(new RAMDirectory(defaultGraphLoc, true), false); assertTrue(graph.loadExisting()); // empty graph still has invalid bounds assertEquals(graph.getBounds(), BBox.createInverse(false)); }
List<String> lines = Helper.readFile(file); List<Integer> landmarkNodeIds = new ArrayList<>(); BBox bbox = BBox.createInverse(false); int lmSuggestionIdx = 0; String errors = "";
List<String> lines = Helper.readFile(file); List<Integer> landmarkNodeIds = new ArrayList<>(); BBox bbox = BBox.createInverse(false); int lmSuggestionIdx = 0; String errors = "";
@Override public void run(Bootstrap bootstrap, Namespace args) { XmlMapper xmlMapper = new XmlMapper(); BBox bbox = BBox.createInverse(false); for (File gpxFile : args.<File>getList("gpx")) { try { Gpx gpx = xmlMapper.readValue(gpxFile, Gpx.class); for (Trk trk : gpx.trk) { List<GPXEntry> inputGPXEntries = trk.getEntries(); for (GPXEntry entry : inputGPXEntries) { bbox.update(entry.getLat(), entry.getLon()); } } } catch (IOException e) { throw new RuntimeException(e); } } System.out.println("bounds: " + bbox); // show download only for small areas if (bbox.maxLat - bbox.minLat < 0.1 && bbox.maxLon - bbox.minLon < 0.1) { double delta = 0.01; System.out.println("Get small areas via\n" + "wget -O extract.osm 'http://overpass-api.de/api/map?bbox=" + (bbox.minLon - delta) + "," + (bbox.minLat - delta) + "," + (bbox.maxLon + delta) + "," + (bbox.maxLat + delta) + "'"); } } }
/** * Calculates the 2D bounding box of this route */ public BBox calcBBox2D() { check("calcRouteBBox"); BBox bounds = BBox.createInverse(false); for (int i = 0; i < pointList.getSize(); i++) { bounds.update(pointList.getLatitude(i), pointList.getLongitude(i)); } return bounds; }
BBox polygonBounds = BBox.createInverse(false); List<SpatialRule> spatialRules = new ArrayList<>();
BBox polygonBounds = BBox.createInverse(false); List<SpatialRule> rules = new ArrayList<>(); Set<String> ids = new HashSet<>();
/** * Calculates the bounding box of this route response */ public BBox calcRouteBBox(BBox _fallback) { check("calcRouteBBox"); BBox bounds = BBox.createInverse(_fallback.hasElevation()); int len = pointList.getSize(); if (len == 0) return _fallback; for (int i = 0; i < len; i++) { double lat = pointList.getLatitude(i); double lon = pointList.getLongitude(i); if (bounds.hasElevation()) { double ele = pointList.getEle(i); bounds.update(lat, lon, ele); } else { bounds.update(lat, lon); } } return bounds; }
/** * Calculates the bounding box of this route response */ public BBox calcRouteBBox( BBox _fallback ) { check("calcRouteBBox"); BBox bounds = BBox.createInverse(_fallback.hasElevation()); int len = pointList.getSize(); if (len == 0) return _fallback; for (int i = 0; i < len; i++) { double lat = pointList.getLatitude(i); double lon = pointList.getLongitude(i); if (bounds.hasElevation()) { double ele = pointList.getEle(i); bounds.update(lat, lon, ele); } else { bounds.update(lat, lon); } } return bounds; }
String gpxLocation = args.get("gpx", ""); File[] files = getFiles(gpxLocation); BBox bbox = BBox.createInverse(false); for (File gpxFile : files) { List<GPXEntry> inputGPXEntries = new GPXFile().doImport(gpxFile.getAbsolutePath()).getEntries();
this.bounds = BBox.createInverse(withElevation); this.nodeAccess = new GHNodeAccess(this, withElevation); this.extStorage = extendedStorage;
this.bounds = BBox.createInverse(withElevation); this.nodeAccess = new GHNodeAccess(this, withElevation); this.extStorage = extendedStorage;
this.bounds = BBox.createInverse(withElevation); this.nodeAccess = new GHNodeAccess(this, withElevation); this.extStorage = extendedStorage;