public static int calcIndexSize(BBox graphBounds) { if (!graphBounds.isValid()) throw new IllegalArgumentException("Bounding box is not valid to calculate index size: " + graphBounds); double dist = DIST_EARTH.calcDist(graphBounds.maxLat, graphBounds.minLon, graphBounds.minLat, graphBounds.maxLon); // convert to km and maximum is 50000km => 1GB dist = Math.min(dist / 1000, 50000); return Math.max(2000, (int) (dist * dist)); }
@Override protected Result check() { boolean valid = graphHopperStorage.getBounds().isValid(); if (valid) { return Result.healthy(); } else { return Result.unhealthy("GraphHopperStorage has invalid bounds."); } } }
if (!bounds.isValid()) throw new IllegalStateException("Bounds are not valid: " + bounds);
@Override protected Result check() { boolean valid = graphHopper.getGraphHopperStorage().getBounds().isValid(); if (valid) { return Result.healthy(); } else { return Result.unhealthy("GraphHopperStorage has invalid bounds."); } } }
throw new IllegalStateException("Cannot create location index of empty graph!"); if (!bounds.isValid()) throw new IllegalStateException("Cannot create location index when graph has invalid bounds: " + bounds);
if (!polygonBounds.isValid()) { return SpatialRuleLookup.EMPTY;
protected void checkGraph(Graph g) { NodeAccess na = g.getNodeAccess(); assertTrue(na.is3D()); assertTrue(g.getBounds().isValid());
public static int calcIndexSize(BBox graphBounds) { if (!graphBounds.isValid()) throw new IllegalArgumentException("Bounding box is not valid to calculate index size: " + graphBounds); double dist = DIST_EARTH.calcDist(graphBounds.maxLat, graphBounds.minLon, graphBounds.minLat, graphBounds.maxLon); // convert to km and maximum is 50000km => 1GB dist = Math.min(dist / 1000, 50000); return Math.max(2000, (int) (dist * dist)); }
public static int calcIndexSize( BBox graphBounds ) { if (!graphBounds.isValid()) throw new IllegalArgumentException("Bounding box is not valid to calculate index size: " + graphBounds); double dist = DIST_EARTH.calcDist(graphBounds.maxLat, graphBounds.minLon, graphBounds.minLat, graphBounds.maxLon); // convert to km and maximum is 50000km => 1GB dist = Math.min(dist / 1000, 50000); return Math.max(2000, (int) (dist * dist)); }
public static int calcIndexSize(BBox graphBounds) { if (!graphBounds.isValid()) throw new IllegalArgumentException("Bounding box is not valid to calculate index size: " + graphBounds); double dist = DIST_EARTH.calcDist(graphBounds.maxLat, graphBounds.minLon, graphBounds.minLat, graphBounds.maxLon); // convert to km and maximum is 50000km => 1GB dist = Math.min(dist / 1000, 50000); return Math.max(2000, (int) (dist * dist)); }
if (!bounds.isValid()) throw new IllegalStateException("Bounds are not valid: " + bounds);
throw new IllegalStateException("Cannot create location index of empty graph!"); if (!bounds.isValid()) throw new IllegalStateException("Cannot create location index when graph has invalid bounds: " + bounds);
throw new IllegalStateException("Cannot create location index of empty graph!"); if (!bounds.isValid()) throw new IllegalStateException("Cannot create location index when graph has invalid bounds: " + bounds);
throw new IllegalStateException("Cannot create location index of empty graph!"); if (!bounds.isValid()) throw new IllegalStateException("Cannot create location index when graph has invalid bounds: " + bounds);
if (!polygonBounds.isValid()) { return SpatialRuleLookup.EMPTY;
return null; if (!polygonBounds.isValid()) { throw new IllegalStateException("No associated polygons found in JsonFeatureCollection for rules " + rules);