/** Constructor. *@param planetModel is the planet model. */ public GeoWorld(final PlanetModel planetModel) { super(planetModel); originPoint = new GeoPoint(planetModel.ab, 1.0, 0.0, 0.0); }
if (!last_center_pos.equals(getMapCenter()) || !is_touched) { pan_event_delay_timer.cancel(); pan_event_delay_timer = new Timer();
@Override public Point pointXYZ(double x, double y, double z) { GeoPoint point = new GeoPoint(x, y, z); GeoPointShape pointShape = GeoPointShapeFactory.makeGeoPointShape(planetModel, point.getLatitude(), point.getLongitude()); return new Geo3dPointShape(pointShape, context); //throw new UnsupportedOperationException(); }
public static boolean isInMap(final GeoPoint topLeftGeo, final GeoPoint bottmRightGeo, final GeoPoint point) { Log.d(TAG, ""+topLeftGeo.toString()); Log.d(TAG, ""+point.toString()); Log.d(TAG, ""+bottmRightGeo.toString()); if((point.getLatitudeE6() >= topLeftGeo.getLatitudeE6() && point.getLatitudeE6() <= bottmRightGeo.getLatitudeE6()) && (point.getLongitudeE6() >= topLeftGeo.getLongitudeE6() && point.getLongitudeE6() <= bottmRightGeo.getLongitudeE6())) { return true; } else { return false; } }
@Override public void write(final OutputStream outputStream) throws IOException { SerializableObject.writeDouble(outputStream, getLatitude()); SerializableObject.writeDouble(outputStream, getLongitude()); }
double maxArcDistance = points.get(0).arcDistance(points.get(1)); double trialArcDistance = points.get(0).arcDistance(points.get(2)); if (trialArcDistance > maxArcDistance) { maxArcDistance = trialArcDistance; final double z = Math.sin(angle) * sinArcDistance; final double sinLatitude = Math.sin(closePoint.getLatitude()); final double cosLatitude = Math.cos(closePoint.getLatitude()); final double sinLongitude = Math.sin(closePoint.getLongitude()); final double cosLongitude = Math.cos(closePoint.getLongitude());
@Override public String toString() { return point.toString(); } }
@Override public double computeDistance(final GeoPoint point1, final GeoPoint point2) { return point1.arcDistance(point2); }
@Override public Bounds addYValue(final GeoPoint point) { if (!noLongitudeBound) { // Get a longitude value addLongitudeBound(point.getLongitude()); } return this; }
@Override public double getY() { return shape.getCenter().getLatitude() * DistanceUtils.RADIANS_TO_DEGREES; }
/** Compute an arc distance between two points. * Note: this is an angular distance, and not a surface distance, and is therefore independent of planet model. * For surface distance, see {@link PlanetModel#surfaceDistance(GeoPoint, GeoPoint)} * @param v is the second point. * @return the angle, in radians, between the two points. */ public double arcDistance(final Vector v) { return Tools.safeAcos(dotProduct(v)/(magnitude() * v.magnitude())); }
/** Construct a GeoPoint from the trig functions of a lat and lon pair. * @param planetModel is the planetModel to put the point on. * @param sinLat is the sin of the latitude. * @param sinLon is the sin of the longitude. * @param cosLat is the cos of the latitude. * @param cosLon is the cos of the longitude. */ public GeoPoint(final PlanetModel planetModel, final double sinLat, final double sinLon, final double cosLat, final double cosLon) { this(computeDesiredEllipsoidMagnitude(planetModel, cosLat * cosLon, cosLat * sinLon, sinLat), cosLat * cosLon, cosLat * sinLon, sinLat); }
@Override public String toString() { if (this.longitude == Double.NEGATIVE_INFINITY) { return super.toString(); } return "[lat="+getLatitude()+", lon="+getLongitude()+"("+super.toString()+")]"; }
@Override public String toString() { return point.toString(); } }
@Override public double computeDistance(final GeoPoint point1, final double x2, final double y2, final double z2) { return point1.arcDistance(x2,y2,z2); }
@Override public double getX() { return shape.getCenter().getLongitude() * DistanceUtils.RADIANS_TO_DEGREES; }
@Override public Bounds addZValue(final GeoPoint point) { if (!noTopLatitudeBound || !noBottomLatitudeBound) { // Compute a latitude value double latitude = point.getLatitude(); addLatitudeBound(latitude); } return this; }
/** Compute an arc distance between two points. * @param x is the x part of the second point. * @param y is the y part of the second point. * @param z is the z part of the second point. * @return the angle, in radians, between the two points. */ public double arcDistance(final double x, final double y, final double z) { return Tools.safeAcos(dotProduct(x,y,z)/(magnitude() * Vector.magnitude(x,y,z))); }
/** Construct a GeoPoint from the trig functions of a lat and lon pair. * @param planetModel is the planetModel to put the point on. * @param sinLat is the sin of the latitude. * @param sinLon is the sin of the longitude. * @param cosLat is the cos of the latitude. * @param cosLon is the cos of the longitude. * @param lat is the latitude. * @param lon is the longitude. */ public GeoPoint(final PlanetModel planetModel, final double sinLat, final double sinLon, final double cosLat, final double cosLon, final double lat, final double lon) { this(computeDesiredEllipsoidMagnitude(planetModel, cosLat * cosLon, cosLat * sinLon, sinLat), cosLat * cosLon, cosLat * sinLon, sinLat, lat, lon); }
@Override public Bounds addPoint(GeoPoint point) { if (!noLongitudeBound) { // Get a longitude value addLongitudeBound(point.getLongitude()); } if (!noTopLatitudeBound || !noBottomLatitudeBound) { // Compute a latitude value addLatitudeBound(point.getLatitude()); } return this; }