use of org.locationtech.geogig.osm.internal.OSMCoordinateSequence in project GeoGig by boundlessgeo.
the class BDBJEPointCache method get.
@Override
public CoordinateSequence get(List<Long> ids) {
Preconditions.checkNotNull(ids, "ids is null");
OSMCoordinateSequence cs = CSFAC.create(ids.size());
DatabaseEntry key = new DatabaseEntry();
DatabaseEntry data = new DatabaseEntry();
for (int index = 0; index < ids.size(); index++) {
Long nodeID = ids.get(index);
LongBinding.longToEntry(nodeID.longValue(), key);
OperationStatus status = database.get(null, key, data, LockMode.DEFAULT);
if (!OperationStatus.SUCCESS.equals(status)) {
String msg = String.format("node id %s not found", nodeID);
throw new IllegalArgumentException(msg);
}
int[] c = CoordinateBinding.entryToCoord(data);
cs.setOrdinate(index, 0, c[0]);
cs.setOrdinate(index, 1, c[1]);
}
return cs;
}
use of org.locationtech.geogig.osm.internal.OSMCoordinateSequence in project GeoGig by boundlessgeo.
the class MappedPointCache method get.
@Override
public OSMCoordinateSequence get(List<Long> ids) {
Preconditions.checkNotNull(ids, "ids is null");
OSMCoordinateSequence sequence = index.build(ids);
return sequence;
}
use of org.locationtech.geogig.osm.internal.OSMCoordinateSequence in project GeoGig by boundlessgeo.
the class MappedIndex method build.
public OSMCoordinateSequence build(List<Long> ids) {
// sort();
OSMCoordinateSequence sequence = CSFAC.create(ids.size());
int[] coordinateBuff = new int[2];
for (int index = 0; index < ids.size(); index++) {
Long nodeId = ids.get(index);
getCoordinate(nodeId, coordinateBuff);
sequence.setOrdinate(index, 0, coordinateBuff[0]);
sequence.setOrdinate(index, 1, coordinateBuff[1]);
}
return sequence;
}
Aggregations