Examples of OSMCoordinateSequence


Examples of org.locationtech.geogig.osm.internal.OSMCoordinateSequence

    }

    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;
    }
View Full Code Here

Examples of org.locationtech.geogig.osm.internal.OSMCoordinateSequence

    @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;
    }
View Full Code Here

Examples of org.locationtech.geogig.osm.internal.OSMCoordinateSequence

    @Override
    public OSMCoordinateSequence get(List<Long> ids) {
        Preconditions.checkNotNull(ids, "ids is null");

        OSMCoordinateSequence sequence = index.build(ids);
        return sequence;
    }
View Full Code Here

Examples of org.locationtech.geogig.osm.internal.OSMCoordinateSequence

        });
        return sizeContainer.get();
    }

    private OSMCoordinateSequence coord(double x, double y) {
        return new OSMCoordinateSequence(new Coordinate[] { new Coordinate(x, y) });
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.