Package org.openstreetmap.josm.data.coor

Examples of org.openstreetmap.josm.data.coor.LatLon.lat()


                        e[GPRMC.WIDTH_NORTH_NAME.position],
                        e[GPRMC.LENGTH_EAST_NAME.position],
                        e[GPRMC.WIDTH_NORTH.position],
                        e[GPRMC.LENGTH_EAST.position]
                );
                if((latLon.lat()==0.0) && (latLon.lon()==0.0)) {
                    ps.zero_coord++;
                    return false;
                }
                // time
                currentDate = e[GPRMC.DATE.position];
View Full Code Here


        if (!Main.isDisplayingMapView()) {
            return;
        }
        MapView mv = Main.map.mapView;
        LatLon curPos = mv.getProjection().eastNorth2latlon(mv.getCenter());
        lat.setText(Double.toString(curPos.lat()));
        lon.setText(Double.toString(curPos.lon()));

        double dist = mv.getDist100Pixel();
        double zoomFactor = 1/dist;
View Full Code Here

            this.lat = coor.lat();
            this.lon = coor.lon();
            invalidateEastNorthCache();
        } else if (eastNorth != null) {
            LatLon ll = Projections.inverseProject(eastNorth);
            this.lat = ll.lat();
            this.lon = ll.lon();
            this.east = eastNorth.east();
            this.north = eastNorth.north();
        } else {
            this.lat = Double.NaN;
View Full Code Here

    private String generateFileName(ProjectionEntries projectionEntries, double pixelPerDegree, Projection projection, double east, double north, String mimeType) {
        LatLon ll1 = projection.eastNorth2latlon(new EastNorth(east, north));
        LatLon ll2 = projection.eastNorth2latlon(new EastNorth(east + 100 / pixelPerDegree, north));
        LatLon ll3 = projection.eastNorth2latlon(new EastNorth(east + tileSize / pixelPerDegree, north + tileSize / pixelPerDegree));

        double deltaLat = Math.abs(ll3.lat() - ll1.lat());
        double deltaLon = Math.abs(ll3.lon() - ll1.lon());
        int precisionLat = Math.max(0, -(int)Math.ceil(Math.log10(deltaLat)) + 1);
        int precisionLon = Math.max(0, -(int)Math.ceil(Math.log10(deltaLon)) + 1);

        String zoom = SystemOfMeasurement.METRIC.getDistText(ll1.greatCircleDistance(ll2));
View Full Code Here

                    default:
                        throw new AssertionError();
                }
                if (DEBUG) System.err.println(" - new with idx "+idx);
                LatLon center = bbox.getCenter();
                BBox b = new BBox(lon1,lat1, center.lon(), center.lat());
                children[idx] = new GPLevel<>(level + 1, b, this, owner);
            }
            return children[idx].getBounded(ll);
        }
       
View Full Code Here

            this.bbox = calculateBBox(); // calculateBBox reference quad
        }

        private BBox calculateBBox() {
            LatLon bottom_left = this.coor();
            double lat = bottom_left.lat() + parent.height() / 2;
            double lon = bottom_left.lon() + parent.width() / 2;
            return new BBox(bottom_left.lon(), bottom_left.lat(), lon, lat);
        }

        QBLevel<T> findBucket(BBox bbox) {
View Full Code Here

        private BBox calculateBBox() {
            LatLon bottom_left = this.coor();
            double lat = bottom_left.lat() + parent.height() / 2;
            double lon = bottom_left.lon() + parent.width() / 2;
            return new BBox(bottom_left.lon(), bottom_left.lat(), lon, lat);
        }

        QBLevel<T> findBucket(BBox bbox) {
            if (!hasChildren())
                return this;
View Full Code Here

        default:
            throw new RuntimeException(tr("Unknown mode {0}.", mode));
        }
        if (pnt != null) {
            LatLon c = pnt.getCoor();
            String coordAttr = "lat=\"" + c.lat() + "\" lon=\"" + c.lon() + "\"";
            if (pnt.attr.isEmpty()) {
                inline(type, coordAttr);
            } else {
                openAtt(type, coordAttr);
                writeAttr(pnt);
View Full Code Here

    @Test
    public void testReadLatLon() {
        LatLon latlon = ExifReader.readLatLon(sampleFile);
        assertNotNull(latlon);
        DecimalFormat f = new DecimalFormat("00.0");
        assertEquals("51°46'"+f.format(43.0)+"\"", LatLon.dms(latlon.lat()));
        assertEquals("8°21'"+f.format(56.3)+"\"", LatLon.dms(latlon.lon()));
    }

    /**
     * Test coordinates extraction
View Full Code Here

            for (int i=0; i<1000; ++i) {
                double[] cart = ellips.latLon2Cart(ll);
                ll = ellips.cart2LatLon(cart);

                if (!(Math.abs(lat - ll.lat())<EPSILON && Math.abs(lon - ll.lon())<EPSILON)) {
                    String error = String.format("point: %s iterations: %s current: %s errorLat: %s errorLon %s",
                            new LatLon(lat, lon), i, ll, Math.abs(lat - ll.lat()), Math.abs(lon - ll.lon()));
                    System.err.println(error);
                    Assert.fail();
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.