当前位置: 首页>>代码示例>>Java>>正文


Java Angle.fromDegreesLatitude方法代码示例

本文整理汇总了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);
	}  
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:32,代码来源:WWJPanel.java

示例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);
    }
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:66,代码来源:DefaultProductLayer.java

示例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);
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:68,代码来源:DefaultProductLayer.java


注:本文中的gov.nasa.worldwind.geom.Angle.fromDegreesLatitude方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。