georegion.java

来自「OpenMap是一个基于JavaBeansTM的开发工具包。利用OpenMap你」· Java 代码 · 共 93 行

JAVA
93
字号
/* *                     RESTRICTED RIGHTS LEGEND * *                        BBNT Solutions LLC *                        A Verizon Company *                        10 Moulton Street *                       Cambridge, MA 02138 *                         (617) 873-3000 * * Copyright BBNT Solutions LLC 2001, 2002 All Rights Reserved * */package com.bbn.openmap.geo;/** * An arbitrary space described in terms of Geo objects. GeoRegions are assumed * to be closed paths representing areas. */public interface GeoRegion extends GeoPath {    /**     * Is the Geo inside the region?     *      * @param point     * @return true if point is inside region.     */    boolean isPointInside(Geo point);    // ------------------------------    // Basic Implementation    // ------------------------------    public static class Impl extends GeoPath.Impl implements GeoRegion {        public Impl(Geo[] coords) {            super(coords);        }        /**         * Create a region of LatLon pairs.         *          * @param lls alternating lat/lon in decimal degrees.         */        public Impl(float[] lls) {            this(lls, true);        }        /**         * Create a region of LatLon pairs.         *          * @param lls alternating lat/lon values.         * @param isDegrees true if lat/lon are in degrees, false if in radians.         */        public Impl(float[] lls, boolean isDegrees) {            super(lls, isDegrees);        }        /**         * @deprecated use getID() instead.         */        public void setRegionId(Object rid) {            id = rid;        }        /**         * @deprecated use getID() instead.         */        public Object getRegionId() {            return id;        }        public boolean isSegmentNear(GeoSegment s, double epsilon) {            return Intersection.isSegmentNearPolyRegion(s,                    getPoints(),//                    toPointArray(),                    epsilon);        }        public boolean isPointInside(Geo p) {            return Intersection.isPointInPolygon(p, getPoints()/*toPointArray()*/);        }        public BoundingCircle getBoundingCircle() {            if (bc == null) {                return new BoundingCircle.Impl(this);            }            return bc;        }    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?