本文整理汇总了Java中gov.nasa.worldwind.geom.Angle.fromDegreesLatitude方法的典型用法代码示例。如果您正苦于以下问题:Java Angle.fromDegreesLatitude方法的具体用法?Java Angle.fromDegreesLatitude怎么用?Java Angle.fromDegreesLatitude使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nasa.worldwind.geom.Angle
的用法示例。
在下文中一共展示了Angle.fromDegreesLatitude方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: add
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
/**
*
* @param layer
*/
public void add(ImageLayer layer) {
try{
if(layer==null) return;
initGlobe();
GeoImageReader reader=layer.getImageReader();
List<double[]> imageframe = layer.getImageReader().getFrameLatLon(reader.getWidth(),reader.getHeight());
if (imageframe != null) {
List<LatLon> ll = new ArrayList<LatLon>();
for (double[] c : imageframe) {
ll.add(new LatLon(Angle.fromDegreesLatitude(c[1]), Angle.fromDegreesLongitude(c[0])));
}
GlobeAnnotation ga=new GlobeAnnotation(layer.getName() + " opened",
new Position(new LatLon(Angle.fromDegreesLatitude(imageframe.get(0)[1]),
Angle.fromDegreesLongitude(imageframe.get(0)[0])),
0));
WWGeoImage gi = new WWGeoImage(new Polyline(ll,0),ga ,
layer.isActive() ? Color.CYAN : Color.BLUE, layer.isActive() ? Color.CYAN : Color.BLUE);
gi.setAnnotationVisible(layer.isActive());
gi.setDelegateOwner(layer);
imageLayer.addRenderable(gi);
}
}catch(Exception e){
logger.error(e.getMessage(),e);
}
}
示例2: addOutline
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
private void addOutline(final Product product) {
final int step = Math.max(16, (product.getSceneRasterWidth() + product.getSceneRasterHeight()) / 250);
final GeneralPath[] boundaryPaths = ProductUtils.createGeoBoundaryPaths(product, null, step);
final Polyline[] polyLineList = new Polyline[boundaryPaths.length];
int i = 0;
int numPoints = 0;
float centreLat = 0;
float centreLon = 0;
for (GeneralPath boundaryPath : boundaryPaths) {
final PathIterator it = boundaryPath.getPathIterator(null);
final float[] floats = new float[2];
final List<Position> positions = new ArrayList<>(4);
it.currentSegment(floats);
final Position firstPosition = new Position(Angle.fromDegreesLatitude(floats[1]),
Angle.fromDegreesLongitude(floats[0]), 0.0);
positions.add(firstPosition);
centreLat += floats[1];
centreLon += floats[0];
it.next();
numPoints++;
while (!it.isDone()) {
it.currentSegment(floats);
positions.add(new Position(Angle.fromDegreesLatitude(floats[1]),
Angle.fromDegreesLongitude(floats[0]), 0.0));
centreLat += floats[1];
centreLon += floats[0];
it.next();
numPoints++;
}
// close the loop
positions.add(firstPosition);
centreLat = centreLat / numPoints;
centreLon = centreLon / numPoints;
polyLineList[i] = new Polyline();
polyLineList[i].setFollowTerrain(true);
polyLineList[i].setPositions(positions);
// ADDED
//polyLineList[i].setColor(new Color(1f, 0f, 0f, 0.99f));
//polyLineList[i].setLineWidth(10);
addRenderable(polyLineList[i]);
++i;
}
Position centrePos = new Position(Angle.fromDegreesLatitude(centreLat), Angle.fromDegreesLongitude(centreLon), 0.0);
PointPlacemark ppm = getLabelPlacemark(centrePos, String.valueOf(product.getRefNo()));
ppm.setAltitudeMode(WorldWind.CLAMP_TO_GROUND);
ppm.setEnableDecluttering(true);
addRenderable(ppm);
outlineTable.put(getUniqueName(product), polyLineList);
labelTable.put(getUniqueName(product), ppm);
}
示例3: addWaveProduct
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
private void addWaveProduct(final Product product) {
final MetadataElement root = AbstractMetadata.getOriginalProductMetadata(product);
final MetadataElement ggADS = root.getElement("GEOLOCATION_GRID_ADS");
if (ggADS == null) return;
final MetadataElement[] geoElemList = ggADS.getElements();
final Polyline[] lineList = new Polyline[geoElemList.length];
int cnt = 0;
int numPoints = 0;
float centreLat = 0;
float centreLon = 0;
for (MetadataElement geoElem : geoElemList) {
final double lat = geoElem.getAttributeDouble("center_lat", 0.0) / Constants.oneMillion;
final double lon = geoElem.getAttributeDouble("center_long", 0.0) / Constants.oneMillion;
final double heading = geoElem.getAttributeDouble("heading", 0.0);
final GeoUtils.LatLonHeading r1 = GeoUtils.vincenty_direct(new GeoPos(lat, lon), 5000, heading);
final GeoUtils.LatLonHeading corner1 = GeoUtils.vincenty_direct(new GeoPos(r1.lat, r1.lon), 2500, heading - 90.0);
final GeoUtils.LatLonHeading corner2 = GeoUtils.vincenty_direct(new GeoPos(r1.lat, r1.lon), 2500, heading + 90.0);
final GeoUtils.LatLonHeading r2 = GeoUtils.vincenty_direct(new GeoPos(lat, lon), 5000, heading + 180.0);
final GeoUtils.LatLonHeading corner3 = GeoUtils.vincenty_direct(new GeoPos(r2.lat, r2.lon), 2500, heading - 90.0);
final GeoUtils.LatLonHeading corner4 = GeoUtils.vincenty_direct(new GeoPos(r2.lat, r2.lon), 2500, heading + 90.0);
final List<Position> positions = new ArrayList<>(4);
positions.add(new Position(Angle.fromDegreesLatitude(corner1.lat), Angle.fromDegreesLongitude(corner1.lon), 0.0));
positions.add(new Position(Angle.fromDegreesLatitude(corner2.lat), Angle.fromDegreesLongitude(corner2.lon), 0.0));
positions.add(new Position(Angle.fromDegreesLatitude(corner4.lat), Angle.fromDegreesLongitude(corner4.lon), 0.0));
positions.add(new Position(Angle.fromDegreesLatitude(corner3.lat), Angle.fromDegreesLongitude(corner3.lon), 0.0));
positions.add(new Position(Angle.fromDegreesLatitude(corner1.lat), Angle.fromDegreesLongitude(corner1.lon), 0.0));
centreLat += corner1.lat;
centreLon += corner1.lon;
centreLat += corner2.lat;
centreLon += corner2.lon;
centreLat += corner3.lat;
centreLon += corner3.lon;
centreLat += corner4.lat;
centreLon += corner4.lon;
numPoints += 4;
final Polyline line = new Polyline();
line.setFollowTerrain(true);
line.setPositions(positions);
addRenderable(line);
lineList[cnt++] = line;
}
centreLat = centreLat / numPoints;
centreLon = centreLon / numPoints;
Position centrePos = new Position(Angle.fromDegreesLatitude(centreLat), Angle.fromDegreesLongitude(centreLon), 0.0);
PointPlacemark ppm = getLabelPlacemark(centrePos, String.valueOf(product.getRefNo()));
ppm.setAltitudeMode(WorldWind.CLAMP_TO_GROUND);
ppm.setEnableDecluttering(true);
addRenderable(ppm);
outlineTable.put(getUniqueName(product), lineList);
labelTable.put(getUniqueName(product), ppm);
}