亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? extentindeximpl.java

?? openmap java寫的開源數(shù)字地圖程序. 用applet實現(xiàn),可以像google map 那樣放大縮小地圖.
?? JAVA
字號:
//**********************************************************************////<copyright>////BBN Technologies, a Verizon Company//10 Moulton Street//Cambridge, MA 02138//(617) 873-8000////Copyright (C) BBNT Solutions LLC. All rights reserved.////</copyright>//**********************************************************************////$Source:///cvs/darwars/ambush/aar/src/com/bbn/ambush/mission/MissionHandler.java,v//$//$RCSfile: ExtentIndexImpl.java,v $//$Revision: 1.1.2.4 $//$Date: 2005/08/29 22:19:24 $//$Author: dietrick $////**********************************************************************package com.bbn.openmap.geo;import java.util.ArrayList;import java.util.HashSet;import java.util.Iterator;import java.util.List;import java.util.Set;/** * Separable indexed database for Regional BoundingCircles. This is * currently a simple longitude coverage map of the world, broken into * buckets covering 1 degrees. A given BoundingCircle will show up in * every bucket that it touches or comes within the margin. */public class ExtentIndexImpl extends java.util.AbstractCollection implements        ExtentIndex {    /**     * Default value for #nbuckets if not specified in the call to the     * constructor.     */    public static final int D_NBUCKETS = 360;    /**     * Default value for #margin if not specified in the call to the     * constructor.     */    public static final double D_MARGIN = 0.0;    /**     * how many buckets in the longitudinal index - 360 means 1 bucket     * per degree of longitude. More than 360 doesn't seem to add much     * search speed, less than 180 makes it slower. The sweet spot on     * current datasets is somewhere in between.     *      * If unspecifed, defaults to #D_NBUCKETS     */    public final int nbuckets;    /**     * how much of a margin to put around regions for indexing     * purposes, in nautical miles. This must be at least the largest     * margin searched for by route (currently 50nmiles) - the larger     * this value, the larger the average entries/bucket and so, the     * slower the search.     *      * If unspecfied, defaults to #D_MARGIN     */    public final double margin;    protected final List buckets[];    /** all is a collection of everything successfully indexed. */    protected final List all = new ArrayList(2000);    /**     * polar is a bucket for anything that is near enough to either     * pole to cover more than 1/2 the buckets.     */    protected final List polar = new ArrayList();    protected final List discarded = new ArrayList();    public ExtentIndexImpl() {        nbuckets = D_NBUCKETS;        margin = D_MARGIN;        buckets = new List[nbuckets];    }    public ExtentIndexImpl(int nb) {        nbuckets = nb;        margin = D_MARGIN;        buckets = new List[nbuckets];    }    public ExtentIndexImpl(int nb, double m) {        nbuckets = nb;        margin = m;        buckets = new List[nbuckets];    }    public ExtentIndexImpl(double m) {        nbuckets = D_NBUCKETS;        margin = m;        buckets = new List[nbuckets];    }    /**     * Add an object to the index.     *      * @return true if object is a GeoExtent and was added.     */    public boolean add(Object o) {        if (o instanceof GeoExtent) {            return addExtent((GeoExtent) o);        } else {            return false;        }    }    /**     * Method to call to add Region object with BoundingCircle to     * Collection and organize it for later retrieval.     *      * @param extent Region to index     * @return true if object added, false if it's been discarded.     */    public boolean addExtent(GeoExtent extent) {        boolean ret = false;        try {            BoundingCircle bc = extent.getBoundingCircle();            if (bc == null) {                discarded.add(extent);                return false;            }            Geo center = bc.getCenter();            double clon = center.getLongitude();            double clat = center.getLatitude();            double rnm = Geo.nm(bc.getRadius());            if ((clat == 90.0 && clon == -180.0) || rnm >= 90 * 60) {                discarded.add(extent);            } else {                all.add(extent); // add to the everything list                // we need to project the radius away from the                // center at the latitude, NOT at the equator!                double latfactor = Geo.npdAtLat(clat);                if (latfactor == 0) {                    polar.add(extent);                    ret = true;                } else {                    double xd = (rnm + margin) / latfactor;                    /*                     * margin = xd "extra degrees" at the center's                     * latitude                     */                    if (xd >= 45) {                        polar.add(extent);                        ret = true;                    } else {                        double[] lons = normalizeLons(new double[] { clon - xd,                                clon + xd });                        int lb = bucketFor(lons[0]);                        int rb = bucketFor(lons[1]);                        if (rb < lb)                            rb = rb + nbuckets;                        for (int i = lb; i <= rb; i++) {                            int x = i % nbuckets;                            List b = buckets[x];                            if (b == null) {                                b = new ArrayList(5);                                buckets[x] = b;                            }                            b.add(extent);                            ret = true;                        }                    }                }            }        } catch (Exception e) {        }        return ret;    }    /** normalize longitude to be at least 0.0 and less than 360 * */    protected static final double normalizeLon(double lon) {        // put it into the range of [-360.0, +360.0]        double n = lon % 360;        return (n < 0.0) ? n + 360.0 : n;        // now n is (0.0,+360]    }    /**     * figure out what bucket a particular longitude goes in.     */    protected final int bucketFor(double lon) {        return (int) Math.floor(normalizeLon(lon)/360.0 * (double) nbuckets);    }    /*     * Normalize and sort the argument two element array so that on a     * north-up globe, a great-circle arc between the points is headed     * eastward and is less than half-way around the world. @param     * lons two-element array on longitudes @return the mutated     * argument.     */    protected final static double[] normalizeLons(double[] lons) {        double a = normalizeLon(lons[0]);        double b = normalizeLon(lons[1]);        // if wide and east or narrow and west, swap        if ((Math.abs(b - a) > 180.0) == (b > a)) {            lons[0] = b;            lons[1] = a;        } else {            lons[0] = a;            lons[1] = b;        }        return lons;    }    /**     * Called when you want everything in each bucket between the     * coordinates.     *      * @param left left-most (west) bucket value.     * @param right right-most (east) bucket value.     * @return Iterator over regions in buckets that cover range     *         provided.     */    protected Iterator lookup(double left, double right) {        return lookup(left, right, null);    }    /**     * Called when you want to get the regions in the buckets, but you     * want to further filter on objects that can intersect based on     * the bounding circle provided.     *      * @param left left-most (west) bucket value.     * @param right right-most (east) bucket value.     * @param bc Bounding circle to do another filter check, if null,     *        everything in a bucket will be returned.     * @return Iterator over regions in buckets that cover range     *         provided that intersect with the BoundingCircle (if one     *         is provided).     */    protected Iterator lookup(double left, double right, BoundingCircle bc) {        Set s = new HashSet();        int lb = bucketFor(left);        int rb = bucketFor(right);        if (rb < lb)            rb = rb + nbuckets;        for (int i = lb; i <= rb; i++) {            List b = buckets[i % nbuckets];            if (b != null) {                if (bc == null) {                    s.addAll(b);                } else {                    for (Iterator it = b.iterator(); it.hasNext();) {                        GeoRegion region = (GeoRegion) it.next();                        if (bc.intersects(region.getBoundingCircle())) {                            s.add(region);                        }                    }                }            }        }        s.addAll(polar); // add all the polar regions, just in case        return s.iterator();    }    /**     * Method to call to remove a region from the index.     *      * @return true if the region was found and removed.     */    public boolean removeExtent(GeoExtent region) {        boolean ret = false;        try {            BoundingCircle bc = region.getBoundingCircle();            if (bc == null) {                discarded.add(region);                return false;            }            Geo center = bc.getCenter();            double clon = center.getLongitude();            double clat = center.getLatitude();            double rnm = Geo.nm(bc.getRadius());            if ((clat == 90.0 && clon == -180.0) || rnm >= 90 * 60) {                discarded.remove(region);            } else {                all.remove(region); // remove from the everything list                // we need to project the radius away from the                // center at the latitude, NOT at the equator!                double latfactor = Geo.npdAtLat(clat);                if (latfactor == 0) {                    polar.remove(region);                    ret = true;                } else {                    double xd = (rnm + margin) / latfactor;                    /*                     * margin = xd "extra degrees" at the center's                     * latitude                     */                    if (xd >= 45) {                        polar.remove(region);                        ret = true;                    } else {                        double[] lons = normalizeLons(new double[] { clon - xd,                                clon + xd });                        int lb = bucketFor(lons[0]);                        int rb = bucketFor(lons[1]);                        if (rb < lb)                            rb = rb + nbuckets;                        for (int i = lb; i <= rb; i++) {                            int x = i % nbuckets;                            List b = buckets[x];                            if (b == null) {                                b = new ArrayList(5);                                buckets[x] = b;                            }                            b.remove(region);                            ret = true;                        }                    }                }            }        } catch (Exception e) {        }        return ret;    }    /**     * Method to call to clear out the index.     */    public void clear() {        all.clear();        polar.clear();        discarded.clear();        for (int i = 0; i < buckets.length; i++) {            if (buckets[i] != null) {                buckets[i].clear();            }        }    }    /**     * RegionIndex parameter method.     *      * @return horizontal range in nautical miles for matches.     */    public double indexHorizontalRange() {        return margin;    }    public Iterator lookupBySegment(GeoSegment segment) {        Geo[] pts = segment.getSeg();        double[] lons = normalizeLons(new double[] { pts[0].getLongitude(),                pts[1].getLongitude() });        return lookup(lons[0], lons[1], segment.getBoundingCircle());    }    public Iterator lookupByPath(GeoPath path) {        Set results = new HashSet();        GeoPath.SegmentIterator pit = path.segmentIterator();        while (pit.hasNext()) {            GeoSegment seg = pit.nextSegment();            for (Iterator it = lookupBySegment(seg); it.hasNext();) {                results.add(it.next());            }        }        return results.iterator();    }    public Iterator lookupByBoundingCircle(BoundingCircle bc) {        double cLon = bc.getCenter().getLongitude();        double rNM = Geo.nm(bc.getRadius()); // radius in nm at        // equator        double npd = Geo.npdAtLat(bc.getCenter().getLatitude());        if (npd == 0) { // avoid divide by zero - polar region            return iterator();        } else {            double rdeg = rNM / npd;            if (rdeg >= 180) {                return iterator(); // radius covers the whole world            } else {                return lookup(cLon - rdeg, cLon + rdeg, bc);            }        }    }    /**     * @return an Iterator over BoundingCircle objects in the     *         Collection where the GExtent may be related to them.     */    public Iterator iterator(GeoExtent o) {        if (o instanceof GeoSegment) {            return lookupBySegment((GeoSegment) o);        } else if (o instanceof GeoPath) {            return lookupByPath((GeoPath) o);        } else if (o instanceof GeoPoint) {            return lookupByBoundingCircle(new BoundingCircle.Impl(((GeoPoint) o).getPoint(), 0));        } else {            return lookupByBoundingCircle(o.getBoundingCircle());        }    }    /**     * @return Iterator over all entries in Collection.     */    public Iterator iterator() {        return all.iterator();    }    /**     * @return number of all entries in Collection.     */    public int size() {        return all.size();    }    //    // metrics    //    public String toString() {        int entc = 0;        int empties = 0;        for (int i = 0; i < nbuckets; i++) {            List l = buckets[i];            if (l != null) {                entc += l.size();            } else {                empties++;            }        }        return "RegionIndexImpl[" + size() + " -" + discarded.size() + " E"                + (entc / ((float) nbuckets)) + "]";    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
26uuu亚洲综合色| 美女诱惑一区二区| 五月婷婷另类国产| 国产精品资源在线| 欧美日韩久久久久久| 久久精品一区二区三区不卡| 伊人一区二区三区| 懂色av一区二区夜夜嗨| 欧美一区二视频| 亚洲国产视频一区二区| 成人美女视频在线观看18| 精品国精品国产| 日韩国产精品久久| 欧美日韩国产电影| 亚洲最新视频在线播放| a4yy欧美一区二区三区| 国产丝袜欧美中文另类| 美女在线视频一区| 欧美一区二区高清| 亚洲不卡一区二区三区| 色久综合一二码| 国产精品成人在线观看| 成人av午夜影院| 久久久久九九视频| 国产在线精品一区在线观看麻豆| 91麻豆精品国产| 日韩av电影免费观看高清完整版在线观看 | 在线精品视频免费观看| 国产精品丝袜久久久久久app| 国产伦精品一区二区三区视频青涩| 91麻豆精品91久久久久同性| 午夜视频一区二区| 欧美日韩国产综合视频在线观看 | 一区二区成人在线| 色综合 综合色| 亚洲欧美福利一区二区| 色综合久久综合网| 伊人婷婷欧美激情| 9191国产精品| 青青草成人在线观看| 精品国产一区二区三区不卡 | 亚洲国产精品久久久久婷婷884 | 亚洲国产精品久久人人爱蜜臀| 91成人免费网站| 天天免费综合色| 日韩视频中午一区| 国产精品中文字幕一区二区三区| 久久一日本道色综合| eeuss影院一区二区三区| 亚洲精品视频观看| 欧美精品精品一区| 久久精品国产久精国产| 久久免费的精品国产v∧| 国产91露脸合集magnet| 亚洲乱码国产乱码精品精小说 | 亚洲综合av网| 欧美一区二区视频在线观看2022| 九色|91porny| 国产精品乱子久久久久| 美国一区二区三区在线播放| 91精品国产乱| 国产福利精品导航| 一区二区三区在线视频观看| 欧美欧美欧美欧美首页| 国产一区二区伦理| 亚洲日本在线天堂| 欧美一级高清片| 国产高清成人在线| 一区二区三区美女视频| 日韩美一区二区三区| 成人激情小说乱人伦| 亚洲午夜私人影院| 久久蜜桃一区二区| 日本韩国欧美三级| 另类综合日韩欧美亚洲| 国产欧美精品一区二区三区四区| 欧美无乱码久久久免费午夜一区| 国产一区二区三区在线观看免费视频 | 中文字幕av一区二区三区高| 在线精品亚洲一区二区不卡| 国产高清精品网站| 蜜桃久久久久久| 一区二区在线看| 欧美国产精品v| 日韩精品一区二区三区四区视频| 91免费版pro下载短视频| 蜜臀精品久久久久久蜜臀| 亚洲欧美视频在线观看视频| 久久影院视频免费| 欧美一个色资源| 欧美日韩一区二区在线观看| 国产成人亚洲综合a∨婷婷图片 | 亚洲欧美一区二区在线观看| 日韩精品一区二区三区老鸭窝| 91官网在线观看| 成人免费视频视频| 国产一区二区精品在线观看| 男男视频亚洲欧美| 天天综合网 天天综合色| 亚洲免费观看高清完整| 亚洲国产精品黑人久久久| 精品欧美乱码久久久久久1区2区| 在线91免费看| 欧美精品在线一区二区| 欧美亚洲动漫精品| 色欧美片视频在线观看| 91在线视频免费91| 不卡高清视频专区| 粉嫩蜜臀av国产精品网站| 激情综合网最新| 久久99蜜桃精品| 久久se这里有精品| 韩国三级在线一区| 国产一区二区三区综合| 国产成人亚洲综合a∨婷婷| 国产精品亚洲视频| 风间由美性色一区二区三区| 国产成人精品亚洲日本在线桃色 | 国产欧美日韩精品a在线观看| 精品成a人在线观看| 欧美精品一区二区精品网| 欧美精品一区二区精品网| 久久综合av免费| 欧美经典一区二区| 国产精品久久久久影院| 亚洲精品视频一区| 日韩有码一区二区三区| 久久精品久久99精品久久| 国产一区二区在线看| 成人夜色视频网站在线观看| 99精品久久只有精品| 欧美性受xxxx黑人xyx性爽| 宅男噜噜噜66一区二区66| 日韩女优制服丝袜电影| 国产欧美日韩三区| 亚洲美腿欧美偷拍| 男人操女人的视频在线观看欧美 | 久久精品综合网| 亚洲婷婷综合久久一本伊一区 | 日韩av中文字幕一区二区三区| 日韩电影在线观看网站| 国产很黄免费观看久久| 91丝袜呻吟高潮美腿白嫩在线观看| 日本电影欧美片| 欧美一卡二卡在线| 国产精品久久久久久久久晋中 | 欧美日韩国产色站一区二区三区| 91精品国产综合久久国产大片| 久久综合一区二区| 亚洲精品国产精华液| 青青草91视频| 91香蕉视频在线| 91精品国产综合久久精品麻豆| 国产亚洲精品aa| 亚洲v日本v欧美v久久精品| 国产精品一线二线三线精华| 欧洲一区在线电影| 国产欧美日韩久久| 天堂一区二区在线| 成人免费视频网站在线观看| 欧美精品日韩精品| 国产精品久久久久久久久晋中| 蜜臀精品一区二区三区在线观看| 99精品视频一区| 久久久久久久久久久久久女国产乱| 亚洲精品日韩一| 国产精品66部| 91精品国产综合久久福利软件 | 久久久精品日韩欧美| 亚洲午夜在线视频| 成人av网站在线| 欧美哺乳videos| 亚洲国产一区二区a毛片| 成人av在线网站| 国产色婷婷亚洲99精品小说| 日韩1区2区3区| 欧美性猛片aaaaaaa做受| 国产精品私人自拍| 国产精品1区二区.| 精品国产污污免费网站入口| 三级影片在线观看欧美日韩一区二区 | 色婷婷亚洲一区二区三区| 国产拍欧美日韩视频二区| 日本中文字幕一区二区视频| 欧美亚洲高清一区二区三区不卡| 中文字幕亚洲在| 成人久久视频在线观看| 久久丝袜美腿综合| 激情综合网激情| ww亚洲ww在线观看国产| 麻豆一区二区三| 日韩精品一区二区三区视频| 日产国产欧美视频一区精品| 宅男在线国产精品| 三级亚洲高清视频| 欧美一级夜夜爽| 免费观看久久久4p| 精品国产乱码久久久久久图片 | av色综合久久天堂av综合| 国产日韩v精品一区二区|