/** * Builds a linestring geometry object from the node references in the * specified way. Unknown nodes will be ignored. * * @param way * The way to create the linestring for. * @return The linestring representing the way. */ public LineString createWayLinestring(Way way) { List<Point> linePoints; linePoints = new ArrayList<Point>(); for (WayNode wayNode : way.getWayNodes()) { NodeLocation nodeLocation; nodeLocation = locationStore.getNodeLocation(wayNode.getNodeId()); if (nodeLocation.isValid()) { linePoints.add(new Point(nodeLocation.getLongitude(), nodeLocation.getLatitude())); } else { return null; } } return createLinestring(linePoints); }
latitude = nodeLocation.getLatitude(); if (nodeLocation.isValid()) { if (nodesFound) { if (longitude < left) {
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); Assert.assertFalse("The node location should be invalid.", location.isValid());