當前位置: 首頁>>代碼示例>>Java>>正文


Java Geo.getLatitude方法代碼示例

本文整理匯總了Java中com.bbn.openmap.geo.Geo.getLatitude方法的典型用法代碼示例。如果您正苦於以下問題:Java Geo.getLatitude方法的具體用法?Java Geo.getLatitude怎麽用?Java Geo.getLatitude使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.bbn.openmap.geo.Geo的用法示例。


在下文中一共展示了Geo.getLatitude方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getDist

import com.bbn.openmap.geo.Geo; //導入方法依賴的package包/類
/**
 * Return the distance between that lat/lons defined in radians. The
 * returned value is in radians.
 */
public float getDist(Geo g1, Geo g2) {
	switch (getLineType()) {
	case LINETYPE_STRAIGHT:
		float lonDist = ProjMath.lonDistance((float) g2.getLongitude(),
				(float) g1.getLongitude());
		float latDist = (float) g2.getLatitude() - (float) g1.getLatitude();
		return (float) Math.sqrt(lonDist * lonDist + latDist * latDist);
	case LINETYPE_RHUMB:
		Debug.error("Rhumb distance calculation not implemented.");
	case LINETYPE_GREATCIRCLE:
	case LINETYPE_UNKNOWN:
	default:
		return (float) g1.distance(g2);
	}
}
 
開發者ID:debrief,項目名稱:deelite,代碼行數:20,代碼來源:DebriefDistance.java

示例2: getDist

import com.bbn.openmap.geo.Geo; //導入方法依賴的package包/類
/**
 * Return the distance between that lat/lons defined in radians. The returned
 * value is in radians.
 */
public float getDist(Geo g1, Geo g2) {
   switch (getLineType()) {
      case LINETYPE_STRAIGHT:
         float lonDist = ProjMath.lonDistance((float) g2.getLongitude(), (float) g1.getLongitude());
         float latDist = (float) g2.getLatitude() - (float) g1.getLatitude();
         return (float) Math.sqrt(lonDist * lonDist + latDist * latDist);
      case LINETYPE_RHUMB:
         Debug.error("Rhumb distance calculation not implemented.");
      case LINETYPE_GREATCIRCLE:
      case LINETYPE_UNKNOWN:
      default:
         return (float) g1.distance(g2);
   }
}
 
開發者ID:d2fn,項目名稱:passage,代碼行數:19,代碼來源:OMDistance.java

示例3: calculateIntersectionsWithDrawnList

import com.bbn.openmap.geo.Geo; //導入方法依賴的package包/類
public void calculateIntersectionsWithDrawnList() {
    intersectionResultList.clear();
    ExtentIndex rIndex = getRegionIndex(true);

    for (OMGraphic omg : drawnList) {

        if (omg instanceof OMLine || (omg instanceof OMPoly && !((OMPoly) omg).isPolygon())) {

            if (DEBUG) {
                Debug.output("GeoIntersectLayer(" + getName()
                        + "): Checking line against RegionIndex");
            }

            GeoPath path = getPathFromOMGraphic(omg);

            Iterator intrsctns = null;
            Iterator crssngs = null;

            if (showCrossingPoints) {
                BoundaryCrossing.Collector results = BoundaryCrossing.getCrossings(path, rIndex);
                intrsctns = results.iterator();
                crssngs = results.getCrossings();
            } else {
                intrsctns = Intersection.intersect(path, rIndex);
            }

            while (intrsctns.hasNext()) {

                OMPolyRegion ompr = (OMPolyRegion) intrsctns.next();
                setRegionAsSelected(ompr);

                if (DEBUG) {
                    Debug.output("GeoIntersectLayer(" + getName() + "): Set Poly for hit");
                }
            }

            int num = 0;

            while (crssngs != null && crssngs.hasNext()) {
                BoundaryCrossing bc = (BoundaryCrossing) crssngs.next();
                Geo geo = bc.getGeo();

                OMPoint pgeo = new OMPoint((float) geo.getLatitude(), (float) geo.getLongitude());
                pgeo.setFillPaint(Color.WHITE);
                pgeo.putAttribute(OMGraphic.LABEL, new OMTextLabeler(Integer.toString(num++)));
                intersectionResultList.add(pgeo);
            }

        } else if (omg instanceof OMPoly) {
            for (Iterator hits = Intersection.intersect(new OMPolyRegion((OMPoly) omg), rIndex); hits.hasNext();) {
                setRegionAsSelected((OMPolyRegion) hits.next());

                if (DEBUG) {
                    Debug.output("GeoIntersectLayer(" + getName() + "): Set Poly for hit");
                }
            }
        } else if (omg instanceof OMPoint) {
            OMPoint omp = (OMPoint) omg;
            for (Iterator hits = Intersection.intersect(new GeoPoint.Impl(omp.getLat(), omp.getLon()), rIndex); hits.hasNext();) {
                setRegionAsSelected((OMPolyRegion) hits.next());

                if (DEBUG) {
                    Debug.output("GeoIntersectLayer(" + getName() + "): Set Poly for hit");
                }
            }
        }
    }
}
 
開發者ID:d2fn,項目名稱:passage,代碼行數:69,代碼來源:GeoIntersectionLayer.java


注:本文中的com.bbn.openmap.geo.Geo.getLatitude方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。