ArcGIS for Android地圖上實際距離與對應的螢幕像素值計算

來源:互聯網
上載者:User

標籤:距離   pre   length   ext   roi   detail   android   arc   blog   

    /**     * 將實際地理距離轉換為螢幕像素值     *      * @param distance     *            實際距離,單位為米     * @param currScale     *            當前地圖尺寸     * @param context     * @return     */    public static double metreToScreenPixel(double distance, double currScale,            Context context) {        float dpi = context.getResources().getDisplayMetrics().densityDpi;        // 當前地圖範圍內1像素代表多少地圖單位的實際距離        double resolution = (25.39999918 / dpi)                * currScale / 1000;        return distance / resolution;    }    /**     * 將螢幕上對應的像素距離轉換為當前顯示地圖上的地理距離(米)     *      * @param pxlength     * @param currScale     * @param context     * @return     */    public static double screenPixelToMetre(double pxlength, double currScale,            Context context) {        float dpi = context.getResources().getDisplayMetrics().densityDpi;        double resolution = (25.39999918 / dpi)                * currScale / 1000;        return pxlength * resolution;    }

來自:http://blog.csdn.net/u012481275/article/details/12861179

ArcGIS for Android地圖上實際距離與對應的螢幕像素值計算

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.