• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GeodeticCalculator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.gavaghan.geodesy.GeodeticCalculator的典型用法代码示例。如果您正苦于以下问题:Java GeodeticCalculator类的具体用法?Java GeodeticCalculator怎么用?Java GeodeticCalculator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GeodeticCalculator类属于org.gavaghan.geodesy包,在下文中一共展示了GeodeticCalculator类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: updateTrackDistances

import org.gavaghan.geodesy.GeodeticCalculator; //导入依赖的package包/类
/**
 * updates the distance information in the trackpoints of the track object.
 *
 * @param track
 *         Track object to update
 * @throws java.lang.NullPointerException
 *         if track is empty
 */
public static void updateTrackDistances(Track track) {
    Optional.ofNullable(Objects.requireNonNull(track).getTrackPoints()).ifPresent(trackPoints -> {
        GeodeticCalculator geoCalc = new GeodeticCalculator();
        Double distance = 0.0;
        GlobalCoordinates lastCoordinate = null;
        for (TrackPoint trackPoint : trackPoints) {
            trackPoint.setDistance(distance);
            GlobalCoordinates thisCoordinate =
                    new GlobalCoordinates(trackPoint.getLatitude(), trackPoint.getLongitude());
            if (null != lastCoordinate) {
                distance += geoCalc.calculateGeodeticCurve(Ellipsoid.WGS84, lastCoordinate, thisCoordinate)
                        .getEllipsoidalDistance();
            }
            lastCoordinate = thisCoordinate;
        }
    });
}
 
开发者ID:sothawo,项目名称:trakxmap,代码行数:26,代码来源:Geo.java


示例2: GeoEllipse

import org.gavaghan.geodesy.GeodeticCalculator; //导入依赖的package包/类
public GeoEllipse(GeoPoint pivot, double widthMeters, double heightMeters, double maxDistanceMeters,
          double flatnessDistanceMeters, int limit) {
//super(maxDistanceMeters, flatnessDistanceMeters, limit);
      //path = new Path2D.Double();
      path = new GeneralPath();
      toPoints = new ArrayList<GeoPoint>();
      geoCalc = new GeodeticCalculator();
      this.maxDistanceMeters = maxDistanceMeters;
      this.flatnessDistanceMeters = flatnessDistanceMeters;
      this.limit = limit;

      arcTo(pivot, widthMeters, heightMeters, 0, 180);
      arcTo(pivot, widthMeters, heightMeters, 180, 0);
  }
 
开发者ID:missioncommand,项目名称:mil-sym-android,代码行数:15,代码来源:GeoEllipse.java


示例3: GeoBlock2

import org.gavaghan.geodesy.GeodeticCalculator; //导入依赖的package包/类
public GeoBlock2(GeoPoint p1, GeoPoint p2, double leftWidthMeters, double rightWidthMeters, double maxDistanceMeters,
	double flatnessDistanceMeters, int limit) {
//super(maxDistanceMeters, flatnessDistanceMeters, limit);
path = new GeneralPath();
toPoints = new ArrayList<GeoPoint>();
geoCalc = new GeodeticCalculator();
this.maxDistanceMeters = maxDistanceMeters;
//this.flatnessDistanceMeters = flatnessDistanceMeters;
//this.limit = limit;

              GlobalCoordinates c1 = toGlobalCoord(p1);
GlobalCoordinates c2 = toGlobalCoord(p2);                                
GeodeticCurve curve = geoCalc.calculateGeodeticCurve(REFERENCE_ELLIPSOID, c1, c2);                
double a1 = curve.getAzimuth();
double a2 = curve.getReverseAzimuth();             
double leftRadius = leftWidthMeters;                
              double rightRadius = rightWidthMeters;                
              //diagnostic to prevent error in calculate global coords if points are identical
              if(p1.x==p2.x && p1.y==p2.y)
                  return;
              //end section
GlobalCoordinates c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c1, a1 - 90, leftRadius);                
              c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c1, a1 - 90, leftRadius);
              moveToLatLong(c.getLongitude(), c.getLatitude());
              c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c2, a2 + 90, leftRadius);                
              lineToLatLong(c.getLongitude(), c.getLatitude());
              c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c2, a2 - 90, rightRadius);                
              lineToLatLong(c.getLongitude(), c.getLatitude());
              c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c1, a1 + 90, rightRadius);                
              lineToLatLong(c.getLongitude(), c.getLatitude());
              closePath();  
}
 
开发者ID:missioncommand,项目名称:mil-sym-android,代码行数:33,代码来源:GeoBlock2.java


示例4: GeoPath

import org.gavaghan.geodesy.GeodeticCalculator; //导入依赖的package包/类
public GeoPath(double maxDistanceMeters, double flatnessDistanceMeters, int limit) {
	path = new GeneralPath();
	toPoints = new ArrayList<GeoPoint>();
	geoCalc = new GeodeticCalculator();
	this.maxDistanceMeters = maxDistanceMeters;
	this.flatnessDistanceMeters = flatnessDistanceMeters;
	this.limit = limit;
}
 
开发者ID:missioncommand,项目名称:mil-sym-android,代码行数:9,代码来源:GeoPath.java


示例5: GeoBlock

import org.gavaghan.geodesy.GeodeticCalculator; //导入依赖的package包/类
public GeoBlock(GeoPoint p1, GeoPoint p2, double widthMeters, double maxDistanceMeters,
		double flatnessDistanceMeters, int limit) {
	//super(maxDistanceMeters, flatnessDistanceMeters, limit);
	path = new GeneralPath();
	toPoints = new ArrayList<GeoPoint>();
	geoCalc = new GeodeticCalculator();
	this.maxDistanceMeters = maxDistanceMeters;
	//this.flatnessDistanceMeters = flatnessDistanceMeters;
	//this.limit = limit;
	
               GlobalCoordinates c1 = toGlobalCoord(p1);
	GlobalCoordinates c2 = toGlobalCoord(p2);                                
	GeodeticCurve curve = geoCalc.calculateGeodeticCurve(REFERENCE_ELLIPSOID, c1, c2);                
	double a1 = curve.getAzimuth();
	double a2 = curve.getReverseAzimuth();             
	double radius = widthMeters / 2;                
                //diagnostic to prevent error in calculate global coords if points are identical
               if(p1.x==p2.x && p1.y==p2.y)
                   return;
               //end section
	GlobalCoordinates c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c1, a1 - 90, radius);                
	moveToLatLong(c.getLongitude(), c.getLatitude());
	c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c2, a2 + 90, radius);                
	lineToLatLong(c.getLongitude(), c.getLatitude());
	c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c2, a2 - 90, radius);                
	lineToLatLong(c.getLongitude(), c.getLatitude());
	c = geoCalc.calculateEndingGlobalCoordinates(REFERENCE_ELLIPSOID, c1, a1 + 90, radius);                
	lineToLatLong(c.getLongitude(), c.getLatitude());
	closePath();
}
 
开发者ID:missioncommand,项目名称:mil-sym-android,代码行数:31,代码来源:GeoBlock.java


示例6: GeoArc

import org.gavaghan.geodesy.GeodeticCalculator; //导入依赖的package包/类
public GeoArc(GeoPoint pivot, double widthMeters, double heightMeters, double leftAzimuth, double rightAzimuth,
        double maxDistanceMeters, double flatnessDistanceMeters, int limit) {
    //super(maxDistanceMeters, flatnessDistanceMeters, limit);
    path = new GeneralPath();
    toPoints = new ArrayList<GeoPoint>();
    geoCalc = new GeodeticCalculator();
    this.maxDistanceMeters = maxDistanceMeters;
    this.flatnessDistanceMeters = flatnessDistanceMeters;
    this.limit = limit;

    moveTo(pivot);
    arcTo(pivot, widthMeters, heightMeters, leftAzimuth, rightAzimuth);
    closePath();
}
 
开发者ID:missioncommand,项目名称:mil-sym-android,代码行数:15,代码来源:GeoArc.java


示例7: GeoPath

import org.gavaghan.geodesy.GeodeticCalculator; //导入依赖的package包/类
public GeoPath(double maxDistanceMeters, double flatnessDistanceMeters, int limit) {
	path = new Path2D.Double();
	toPoints = new ArrayList<GeoPoint>();
	geoCalc = new GeodeticCalculator();
	this.maxDistanceMeters = maxDistanceMeters;
	this.flatnessDistanceMeters = flatnessDistanceMeters;
	this.limit = limit;
}
 
开发者ID:missioncommand,项目名称:mil-sym-java,代码行数:9,代码来源:GeoPath.java



注:本文中的org.gavaghan.geodesy.GeodeticCalculator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java InputDeclarer类代码示例发布时间:2022-05-22
下一篇:
Java EntityThrownExpBottle类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap