Package com.bbn.openmap

Examples of com.bbn.openmap.LatLonPoint


     * want the graphic to change according to the grab points.
     */
    public void setGrabPoints() {

        int renderType = text.getRenderType();
        LatLonPoint llp1;

        Debug.message("eomt", "EditableOMText.setGrabPoints()");

        // Do center point for lat/lon or offset points
        if (renderType == OMGraphic.RENDERTYPE_LATLON) {

            if (projection != null) {
                // movingPoint == gpc
                llp1 = projection.inverse(gpc.getX(), gpc.getY());
                text.setLat(llp1.getLatitude());
                text.setLon(llp1.getLongitude());
                // text.setNeedToRegenerate set
            }
        }

        boolean settingOffset = getStateMachine().getState() instanceof GraphicSetOffsetState
                && movingPoint == gpo;

        // If the center point is moving, the offset distance changes
        if (renderType == OMGraphic.RENDERTYPE_OFFSET) {

            llp1 = projection.inverse(gpo.getX(), gpo.getY());

            text.setLat(llp1.getLatitude());
            text.setLon(llp1.getLongitude());

            if (settingOffset || movingPoint == gpc) {
                // Don't call point.setLocation because we only want
                // to
                // setNeedToRegenerate if !settingOffset.
View Full Code Here


     * @throws exception if a parameter is missing or invalid.
     */
    public Projection create(Properties props) throws ProjectionException {

        try {
            LatLonPoint llp = (LatLonPoint) props.get(ProjectionFactory.CENTER);
            float scale = PropUtils.floatFromProperties(props,
                    ProjectionFactory.SCALE,
                    10000000);
            int height = PropUtils.intFromProperties(props,
                    ProjectionFactory.HEIGHT,
View Full Code Here

        LatLonPoint[] boundingPoly = new LatLonPoint[points.length / 2];
        float lat, lon;
        for (int i = 0; i < points.length; i += 2) {
            lat = points[i];
            lon = points[i + 1];
            boundingPoly[i] = new LatLonPoint(lat, lon);
        }
        return boundingPoly;
    }
View Full Code Here

     * @throws exception if a parameter is missing or invalid.
     */
    public Projection create(Properties props) throws ProjectionException {

        try {
            LatLonPoint llp = (LatLonPoint) props.get(ProjectionFactory.CENTER);
            float scale = PropUtils.floatFromProperties(props,
                    ProjectionFactory.SCALE,
                    10000000);
            int height = PropUtils.intFromProperties(props,
                    ProjectionFactory.HEIGHT,
View Full Code Here

        }

        public void actionPerformed(ActionEvent ae) {
            if (map != null) {
                Projection proj = map.getProjection();
                LatLonPoint llp = proj.getCenter();
                new GoToButton(llp.getLatitude(), llp.getLongitude(), proj.getScale(), proj.getName());
            }
        }
View Full Code Here

    /**
     * Override hashCode so that two Intersections at the same
     * location have the same hashcode.
     */
    public int hashCode() {
        LatLonPoint llp = getLocation();
        int hc1 = Float.floatToIntBits(llp.getLatitude());
        int hc2 = Float.floatToIntBits(llp.getLongitude());
        return hc1 ^ (hc2 << 5) ^ (hc2 >>> 27);
    }
View Full Code Here

    }

    public static void write(OMCircle circle, Link link, LinkProperties props)
            throws IOException {

        LatLonPoint llp;
        switch (circle.getRenderType()) {
        case OMCircle.RENDERTYPE_LATLON:
            llp = circle.getLatLon();
            LinkCircle.write(llp.getLatitude(),
                    llp.getLongitude(),
                    circle.getRadius(),
                    props,
                    link.dos);
            break;
        case OMCircle.RENDERTYPE_XY:
            LinkCircle.write(circle.getX(),
                    circle.getY(),
                    circle.getWidth(),
                    circle.getHeight(),
                    props,
                    link.dos);
            break;
        case OMCircle.RENDERTYPE_OFFSET:
            llp = circle.getLatLon();
            LinkCircle.write(llp.getLatitude(),
                    llp.getLongitude(),
                    circle.getOffX(),
                    circle.getOffY(),
                    circle.getWidth(),
                    circle.getHeight(),
                    props,
View Full Code Here

     */
    private Proj createProjection(Properties requestProperties, GetMapRequestParameters parameters)
            throws WMSException {
       
        Properties projProps = new Properties();
        projProps.put(ProjectionFactory.CENTER, new LatLonPoint(0f, 0f));
        projProps.setProperty(ProjectionFactory.WIDTH, Integer.toString(parameters.width));
        projProps.setProperty(ProjectionFactory.HEIGHT, Integer.toString(parameters.height));
       
        Proj projection = parameters.crs.createProjection(projProps);
        parameters.crs.prepareProjection(projection);
        projection.setScale(projection.getMinScale());

        LatLonPoint llp1 = parameters.bboxLatLonMinXY;
        LatLonPoint llp2 = parameters.bboxLatLonMaxXY;
        System.out.println("bbox toLatLon: 1: " + llp1 + ", 2: " + llp2 + ", center: " + parameters.bboxLatLonCenter);
       
        // guess a center value
        // TODO: calculate this from bbox values instead of after latlon converting?
        //float centerLat = ((llp2.getLatitude() - llp1.getLatitude()) / 2) + llp1.getLatitude();
View Full Code Here

     * @param lonPoint longitude of center point, decimal degrees
     * @param radius distance in decimal degrees (converted to radians
     *        internally).
     */
    public OMRangeRings(float latPoint, float lonPoint, float radius) {
        this(new LatLonPoint(latPoint, lonPoint),
             radius,
             Length.DECIMAL_DEGREE,
             -1);
    }
View Full Code Here

     * @param radius distance
     * @param units com.bbn.openmap.proj.Length object.
     */
    public OMRangeRings(float latPoint, float lonPoint, float radius,
            Length units) {
        this(new LatLonPoint(latPoint, lonPoint), radius, units, -1);
    }
View Full Code Here

TOP

Related Classes of com.bbn.openmap.LatLonPoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.