@Override public LatLonGeo unproject( double x, double y ) { return LatLonGeo.fromDeg( y, x ); }
public LatLonGeo getSwCorner( ) { return LatLonGeo.fromDeg( swCorner.lat, swCorner.lon ); }
public LatLonGeo getNeCorner( ) { return LatLonGeo.fromDeg( neCorner.lat, neCorner.lon ); }
@Override public LatLonGeo unproject( double x, double y ) { double lon = x / zoomFac * 360.0 - 180; double n = PI - ( 2.0 * PI * y ) / zoomFac; double lat = Math.toDegrees( Math.atan( Math.sinh( n ) ) ); return LatLonGeo.fromDeg( lat, lon ); }
public static List<LatLonGeo> readFlatLineVertices( DoubleBuffer verticesBuf, int vertexFirst, int vertexCount ) { List<LatLonGeo> vertices = new ArrayList<>( ); poslim( verticesBuf, vertexFirst, vertexCount, doublesPerFlatVertex ); for ( int v = 0; v < vertexCount; v++ ) { double lat_DEG = verticesBuf.get( ); double lon_DEG = verticesBuf.get( ); vertices.add( LatLonGeo.fromDeg( lat_DEG, lon_DEG ) ); } return vertices; }
public static LatLonGeo readFlatPointVertex( DoubleBuffer verticesBuf, int vertexIndex ) { poslim( verticesBuf, vertexIndex, 1, doublesPerFlatVertex ); double lat_DEG = verticesBuf.get( ); double lon_DEG = verticesBuf.get( ); return LatLonGeo.fromDeg( lat_DEG, lon_DEG ); }
public double getMinX( ) { Vector2d swCorner = projection.project( LatLonGeo.fromDeg( startLat, startLon ) ); Vector2d neCorner = projection.project( LatLonGeo.fromDeg( startLat + heightStep * imageHeight, startLon + widthStep * imageWidth ) ); return Math.min( swCorner.getX( ), neCorner.getX( ) ); }
public double getMinY( ) { Vector2d swCorner = projection.project( LatLonGeo.fromDeg( startLat, startLon ) ); Vector2d neCorner = projection.project( LatLonGeo.fromDeg( startLat + heightStep * imageHeight, startLon + widthStep * imageWidth ) ); return Math.min( swCorner.getY( ), neCorner.getY( ) ); }
public double getMaxX( ) { Vector2d swCorner = projection.project( LatLonGeo.fromDeg( startLat, startLon ) ); Vector2d neCorner = projection.project( LatLonGeo.fromDeg( startLat + heightStep * imageHeight, startLon + widthStep * imageWidth ) ); return Math.max( swCorner.getX( ), neCorner.getX( ) ); }
public double getMaxY( ) { Vector2d swCorner = projection.project( LatLonGeo.fromDeg( startLat, startLon ) ); Vector2d neCorner = projection.project( LatLonGeo.fromDeg( startLat + heightStep * imageHeight, startLon + widthStep * imageWidth ) ); return Math.max( swCorner.getY( ), neCorner.getY( ) ); }
@Override public void drawContour( double startX, double startY, double endX, double endY, double contourLevel ) { Vector2d startVertex = this.projection.project( LatLonGeo.fromDeg( startY, startX ) ); Vector2d endVertex = this.projection.project( LatLonGeo.fromDeg( endY, endX ) ); coordsX.add( ( float ) startVertex.getX( ) ); coordsY.add( ( float ) startVertex.getY( ) ); coordsX.add( ( float ) endVertex.getX( ) ); coordsY.add( ( float ) endVertex.getY( ) ); }
public static LatLonGeo fromLatLon( LatLon latlon ) { return LatLonGeo.fromDeg( latlon.latitude.getDegrees( ), latlon.longitude.getDegrees( ) ); }
public static LatLonGeo fromLatLon( LatLon latlon ) { return LatLonGeo.fromDeg( latlon.latitude.getDegrees( ), latlon.longitude.getDegrees( ) ); }
@Override public void toXY( double lat, double lon, Double xy ) { Vector2d vector = geoProjection.project( LatLonGeo.fromDeg( lat, lon ) ); xy.x = vector.getX( ); xy.y = vector.getY( ); } } );
protected void setAxes( Axis2D axes, LatLonBounds bounds, GeoProjection projection ) { Vector2d c1 = projection.project( LatLonGeo.fromDeg( bounds.minLat, bounds.minLon ) ); Vector2d c2 = projection.project( LatLonGeo.fromDeg( bounds.maxLat, bounds.minLon ) ); Vector2d c3 = projection.project( LatLonGeo.fromDeg( bounds.maxLat, bounds.maxLon ) ); Vector2d c4 = projection.project( LatLonGeo.fromDeg( bounds.minLat, bounds.maxLon ) ); double minX = minX( c1, c2, c3, c4 ); double maxX = maxX( c1, c2, c3, c4 ); double minY = minY( c1, c2, c3, c4 ); double maxY = maxY( c1, c2, c3, c4 ); axes.set( minX, maxX, minY, maxY ); axes.getAxisX( ).validate( ); axes.getAxisY( ).validate( ); }
public static LatLonGeo fromPosition( Position position ) { return LatLonGeo.fromDeg( position.getLatitude( ).getDegrees( ), position.getLongitude( ).getDegrees( ) ); }
public static LatLonGeo fromPosition( Position position ) { return LatLonGeo.fromDeg( position.getLatitude( ).getDegrees( ), position.getLongitude( ).getDegrees( ) ); }
LatLonGeo centerLatLon = LatLonGeo.fromDeg( centerPosition.latitude.getDegrees( ), centerPosition.longitude.getDegrees( ) ); LatLonGeo swLatLon = centerLatLon.displacedBy( Length.fromMeters( viewportSizeMeters ), Azimuth.southwest ); LatLonGeo seLatLon = centerLatLon.displacedBy( Length.fromMeters( viewportSizeMeters ), Azimuth.southeast );
protected GlimpsePosition getGlimpsePosition( MouseEvent mouseEvent ) { GlimpseTargetStack stack = tile.getTargetStack( ); if ( stack == null ) return null; Position worldwindPosition = this.wwd.getCurrentPosition( ); if ( worldwindPosition == null ) return null; // get the lat/lon of the mouse from the WorldWind double lat = worldwindPosition.getLatitude( ).getDegrees( ); double lon = worldwindPosition.getLongitude( ).getDegrees( ); LatLonGeo latlon = LatLonGeo.fromDeg( lat, lon ); // convert the lat/lon into Glimpse coordinate space using the GeoProjection Vector2d glimpsePosition = this.projection.project( latlon ); // calculate the x/y position in pixels of the mouse click relative to the GlimpseLayout Axis2D axis = this.layout.getAxis( stack ); int posX = axis.getAxisX( ).valueToScreenPixel( glimpsePosition.getX( ) ); int posY = axis.getAxisY( ).getSizePixels( ) - axis.getAxisY( ).valueToScreenPixel( glimpsePosition.getY( ) ); return new GlimpsePosition( posX, posY ); }