Package org.locationtech.udig.catalog.internal.wmt.wmtsource

Examples of org.locationtech.udig.catalog.internal.wmt.wmtsource.NASASource


         * @param wmtSource
         * @return
         */
        public NASATile getTileFromCoordinate(double lat, double lon,
                WMTZoomLevel zoomLevel, WMTSource wmtSource) {
            NASASource nasaSource = (NASASource) wmtSource;
           
            // normalize latitude and longitude
            lat = WMTTileFactory.normalizeDegreeValue(lat, 90);
            lon = WMTTileFactory.normalizeDegreeValue(lon, 180);

            lat = WMTTileFactory.moveInRange(lat,
                    nasaSource.getBounds().getMinY(), nasaSource.getBounds().getMaxY());
            lon = WMTTileFactory.moveInRange(lon,
                    nasaSource.getBounds().getMinX(), nasaSource.getBounds().getMaxX());
           
            NASAZoomLevel nasaZoomLevel = (NASAZoomLevel) zoomLevel;
           
            int row = (int) Math.abs((lat - nasaSource.getBounds().getMaxY())  / nasaZoomLevel.getHeightInWorldUnits());
            int col = (int) Math.abs((lon - nasaSource.getBounds().getMinX()) / nasaZoomLevel.getWidthInWorldUnits());
           
            WMTPlugin.debug("[NASATile.getTileFromCoordinate] " + zoomLevel.getZoomLevel() + //$NON-NLS-1$
                    "/" + col +  "/" + row + " lon: " + lon + " lat: " + lat, Trace.NASA)//$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
           
            return new NASATile(col, row, nasaZoomLevel, (NASASource) wmtSource);
View Full Code Here


            return new NASATile(col, row, nasaZoomLevel, (NASASource) wmtSource);
        }
        //endregion

        public WMTZoomLevel getZoomLevel(int zoomLevel, WMTSource wmtSource) {
            NASASource nasaSource = (NASASource) wmtSource;
           
            return nasaSource.getZoomLevel(zoomLevel);
        }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.catalog.internal.wmt.wmtsource.NASASource

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.