@Override public int size() { return list.size(); }
public static boolean isClockwiseWay(TLongList c) { if (c.size() == 0) { return true; for (int i = 0; i < c.size(); i++) { middleY = middleY + (long)(c.get(i) & mask); middleY = middleY /(long) c.size(); int prevY = (int) (c.get(0) & mask); for (int i = 1; i < c.size(); i++) { int x = (int) (c.get(i) >> 32); int y = (int) (c.get(i) & mask);
private Collection<Long> toList(TLongList values) { List<Long> result = Lists.newArrayListWithExpectedSize(values.size()); values.forEach(result::add); return result; }
@Override public List<CandidateCellForSweeping> next() { Preconditions.checkState(hasNext()); List<CellTsPairInfo> cellTsBatch = cellTsIterator.next(); List<CandidateCellForSweeping> candidates = new ArrayList<>(); for (CellTsPairInfo cellTs : cellTsBatch) { checkCurrentCellAndUpdateIfNecessary(cellTs).ifPresent(candidates::add); if (currentCellTimestamps.size() > 0) { // We expect the timestamps in ascending order. This check costs us a few CPU cycles // but it's worth it for paranoia reasons - mistaking a cell with data for an empty one // can cause data corruption. Preconditions.checkArgument(cellTs.ts > currentCellTimestamps.get(currentCellTimestamps.size() - 1), "Timestamps for each cell must be fed in strictly increasing order"); } updateStateAfterSingleCellTsPairProcessed(cellTs); } if (!cellTsIterator.hasNext()) { getCurrentCandidate().ifPresent(candidates::add); } return candidates; }
@Override public int size() { return list.size(); }
@Override public int size() { return list.size(); }
public int size() { return timestamps.size(); }
@Override public int size() { return list.size(); }
@Override public int size() { return list.size(); }
private Collection<Long> toList(TLongList values) { List<Long> result = Lists.newArrayListWithExpectedSize(values.size()); values.forEach(result::add); return result; }
public long get(int idx) { return timestamps.get(timestamps.size() - 1 - idx); }
@Override public String toString() { return "Way id:" + getId() + ", nodes:" + nodes.size() + ", tags:" + super.toString(); } }
@Override public void endDocument() { // After the entire diff has been applied, re-index all the ways that were added or modified. if (!waysModified.isEmpty()) { LOG.debug("Indexing modified ways..."); for (int w = 0; w < waysModified.size(); w++) { // TODO unless we are doing snapshots and transactions, we should unindex after indexing the new one? osm.unIndexWay(id); osm.indexWay(waysModified.get(w), null); } } }
/** * Filter ways but do not analyze properties wayNodes will be filled with participating node * ids. * <p> * @return true the current xml entry is a way entry and has nodes */ boolean filterWay( OSMWay item ) { // ignore broken geometry if (item.getNodes().size() < 2) return false; // ignore multipolygon geometry if (!item.hasTags()) return false; return encodingManager.acceptWay(item) > 0; }