@Test public void testGetEstimatedIdCount() { OSHDBBoundingBox data = new OSHDBBoundingBox(0, 0, 89, 89); long expResult = 1L; long result = two.getEstimatedIdCount(data); assertEquals(expResult, result); data = new OSHDBBoundingBox(-89.0, -90.0, 89.0, 90.0); expResult = 2L; result = two.getEstimatedIdCount(data); assertEquals(expResult, result); data = new OSHDBBoundingBox(0.0, 0.0, 0.0000053, 0.0000053); expResult = 16L; result = thirty.getEstimatedIdCount(data); assertEquals(expResult, result); data = new OSHDBBoundingBox(-0.1, 0, 90.1, 89); expResult = 3L; result = two.getEstimatedIdCount(data); assertEquals(expResult, result); }
public long getEstimatedIdCount(final OSHDBBoundingBox data) { return Math.max( (long) Math.ceil(data.getMaxLonLong() / cellWidth) - (long) Math.floor(data.getMinLonLong() / cellWidth), (long) Math.ceil(data.getMaxLatLong() / cellWidth) - (long) Math.floor(data.getMinLatLong() / cellWidth) ); }
XYGrid implements Serializable { public long getEstimatedIdCount(final OSHDBBoundingBox data) { return Math.max( (long) Math.ceil(data.getMaxLonLong() / cellWidth) - (long) Math.floor(data.getMinLonLong() / cellWidth), (long) Math.ceil(data.getMaxLatLong() / cellWidth) - (long) Math.floor(data.getMinLatLong() / cellWidth) ); } }
XYGrid implements Serializable { public long getEstimatedIdCount(final OSHDBBoundingBox data) { return Math.max( (long) Math.ceil(data.getMaxLonLong() / cellWidth) - (long) Math.floor(data.getMinLonLong() / cellWidth), (long) Math.ceil(data.getMaxLatLong() / cellWidth) - (long) Math.floor(data.getMinLatLong() / cellWidth) ); } XYGrid(final int zoom); }
XYGrid implements Serializable { public long getEstimatedIdCount(final OSHDBBoundingBox data) { return Math.max( (long) Math.ceil(data.getMaxLonLong() / cellWidth) - (long) Math.floor(data.getMinLonLong() / cellWidth), (long) Math.ceil(data.getMaxLatLong() / cellWidth) - (long) Math.floor(data.getMinLatLong() / cellWidth) ); } XYGrid(final int zoom); static OSHDBBoundingBox getBoundingBox(final CellId cellID); static OSHDBBoundingBox getBoundingBox(final CellId cellID, boolean enlarge); long getId(double longitude, double latitude); long getId(long longitude, long latitude); long getId(OSHDBBoundingBox bbx); double getCellWidth(); OSHDBBoundingBox getCellDimensions(final long cellId); long getEstimatedIdCount(final OSHDBBoundingBox data); int getLevel(); Set<IdRange> bbox2CellIdRanges(OSHDBBoundingBox bbox, boolean enlarge); Set<IdRange> getNeighbours(CellId center); }
XYGrid implements Serializable { public long getEstimatedIdCount(final OSHDBBoundingBox data) { return Math.max( (long) Math.ceil(data.getMaxLonLong() / cellWidth) - (long) Math.floor(data.getMinLonLong() / cellWidth), (long) Math.ceil(data.getMaxLatLong() / cellWidth) - (long) Math.floor(data.getMinLatLong() / cellWidth) ); } XYGrid(final int zoom); static OSHDBBoundingBox getBoundingBox(final CellId cellID); static OSHDBBoundingBox getBoundingBox(final CellId cellID, boolean enlarge); long getId(double longitude, double latitude); long getId(long longitude, long latitude); long getId(OSHDBBoundingBox bbx); double getCellWidth(); OSHDBBoundingBox getCellDimensions(final long cellId); long getEstimatedIdCount(final OSHDBBoundingBox data); int getLevel(); Set<IdRange> bbox2CellIdRanges(OSHDBBoundingBox bbox, boolean enlarge); Set<IdRange> getNeighbours(CellId center);  }