/** * {@inheritDoc} */ @Override public void close() { locationStore.close(); } }
/** * Get NodeLocation from internal store. * * @param nodeId * Id of the node we want the location for. * @return Location of node */ public NodeLocation getNodeLocation(long nodeId) { return locationStore.getNodeLocation(nodeId); }
store.addLocation(i * 2, new NodeLocation(longitude, latitude)); latitude = FixedPrecisionCoordinateConvertor.convertToDouble(1 << ((i + 1) % 32)); location = store.getNodeLocation(i * 2); Assert.assertTrue("The node location should be valid.", location.isValid()); Assert.assertEquals("The longitude is incorrect.", longitude, location.getLongitude(), 0); Assert.assertEquals("The latitude is incorrect.", latitude, location.getLatitude(), 0); location = store.getNodeLocation((i * 2) + 1); Assert.assertFalse("The node location should be invalid.", location.isValid()); store.close();
/** * Adds the location of the node to the internal store. * * @param node * The node to add. */ public void addNodeLocation(Node node) { locationStore.addLocation(node.getId(), new NodeLocation(node.getLongitude(), node.getLatitude())); }
/** * @param nodeId * Id of the node. * @return Point object */ public Point createPoint(long nodeId) { NodeLocation nodeLocation = locationStore.getNodeLocation(nodeId); Point point = new Point(nodeLocation.getLongitude(), nodeLocation.getLatitude()); point.srid = 4326; return point; }
NodeLocation nodeLocation; nodeLocation = locationStore.getNodeLocation(wayNode.getNodeId());
double latitude; nodeLocation = locationStore.getNodeLocation(wayNode.getNodeId()); longitude = nodeLocation.getLongitude(); latitude = nodeLocation.getLatitude();