/** * Returns the latitude value in microdegrees of this coordinate. * * @return the latitude value in microdegrees of this coordinate. */ public int getLatitudeE6() { return LatLongUtils.degreesToMicrodegrees(this.latitude); }
/** * Returns the longitude value in microdegrees of this coordinate. * * @return the longitude value in microdegrees of this coordinate. */ public int getLongitudeE6() { return LatLongUtils.degreesToMicrodegrees(this.longitude); }
public MockTDNode(double lat, double lon) { super(0, LatLongUtils.degreesToMicrodegrees(lat), LatLongUtils.degreesToMicrodegrees(lon), (short) 0, (byte) 0, null, null); } }
private static List<Integer> toCoordinateList(Geometry jtsGeometry) { Coordinate[] jtsCoords = jtsGeometry.getCoordinates(); ArrayList<Integer> result = new ArrayList<>(); for (int j = 0; j < jtsCoords.length; j++) { LatLong latLong = new LatLong(jtsCoords[j].y, jtsCoords[j].x); result.add(Integer.valueOf(LatLongUtils.degreesToMicrodegrees(latLong.latitude))); result.add(Integer.valueOf(LatLongUtils.degreesToMicrodegrees(latLong.longitude))); } return result; }
@Test public void destinationPointTest() { LatLong start = new LatLong(45, 45); LatLong expected = new LatLong(45.006352, 45.008984); LatLong actual = start.destinationPoint(1000, 45); Assert.assertEquals(LatLongUtils.degreesToMicrodegrees(expected.latitude), LatLongUtils.degreesToMicrodegrees(actual.latitude), 0); Assert.assertEquals(LatLongUtils.degreesToMicrodegrees(expected.longitude), LatLongUtils.degreesToMicrodegrees(actual.longitude), 0); }
@Test public void doubleToIntTest() { int microdegrees = LatLongUtils.degreesToMicrodegrees(DEGREES); Assert.assertEquals(MICRO_DEGREES, microdegrees); }
containerHeaderBuffer.putInt(LatLongUtils.degreesToMicrodegrees(dataProcessor.getBoundingBox().minLatitude)); containerHeaderBuffer.putInt(LatLongUtils.degreesToMicrodegrees(dataProcessor.getBoundingBox().minLongitude)); containerHeaderBuffer.putInt(LatLongUtils.degreesToMicrodegrees(dataProcessor.getBoundingBox().maxLatitude)); containerHeaderBuffer.putInt(LatLongUtils.degreesToMicrodegrees(dataProcessor.getBoundingBox().maxLongitude)); containerHeaderBuffer.putInt(LatLongUtils.degreesToMicrodegrees(mapStartPosition.latitude)); containerHeaderBuffer.putInt(LatLongUtils.degreesToMicrodegrees(mapStartPosition.longitude));
/** * Constructs a new TDNode from a given osmosis node entity. Checks the validity of the entity. * * @param node the osmosis entity * @param preferredLanguages the preferred language(s) or null if no preference * @return a new TDNode */ public static TDNode fromNode(Node node, List<String> preferredLanguages) { SpecialTagExtractionResult ster = OSMUtils.extractSpecialFields(node, preferredLanguages); Map<Short, Object> knownWayTags = OSMUtils.extractKnownPOITags(node); return new TDNode(node.getId(), LatLongUtils.degreesToMicrodegrees(node.getLatitude()), LatLongUtils.degreesToMicrodegrees(node.getLongitude()), ster.getElevation(), ster.getLayer(), ster.getHousenumber(), ster.getName(), knownWayTags); }
tileCoordinate.getY()); final int currentTileLat = LatLongUtils.degreesToMicrodegrees(MercatorProjection.tileYToLatitude( tileCoordinate.getY(), tileCoordinate.getZoomlevel())); final int currentTileLon = LatLongUtils.degreesToMicrodegrees(MercatorProjection.tileXToLongitude( tileCoordinate.getX(), tileCoordinate.getZoomlevel()));
int firstWayStartLon = wpr.getWayDataBlocks().get(0).getOuterWay().get(1).intValue(); wayBuffer.put(Serializer.getVariableByteSigned(LatLongUtils.degreesToMicrodegrees(wpr.getLabelPosition().latitude) - firstWayStartLat)); wayBuffer.put(Serializer.getVariableByteSigned(LatLongUtils.degreesToMicrodegrees(wpr.getLabelPosition().longitude) - firstWayStartLon));
/** * Returns the latitude value in microdegrees of this coordinate. * * @return the latitude value in microdegrees of this coordinate. */ public int getLatitudeE6() { return LatLongUtils.degreesToMicrodegrees(this.latitude); }
/** * Returns the longitude value in microdegrees of this coordinate. * * @return the longitude value in microdegrees of this coordinate. */ public int getLongitudeE6() { return LatLongUtils.degreesToMicrodegrees(this.longitude); }