Actual distance on ArcGIS for Android map and corresponding screen pixel value calculation

Source: Internet
Author: User

This article mainly describes the "actual distance on the ArcGIS for Android map and the corresponding screen pixel value calculation", mainly related to the ArcGIS for
The actual distance on the Android map and the corresponding screen pixel value calculations for the ArcGIS for
The actual distance on the Android map and the corresponding screen pixel value calculation of interested students can refer to.

/**
* Convert actual geographic distance to screen pixel value
*
* @param distance
* Actual distance, unit of meter
* @param Currscale
* Current map size
* @param context
* @return
*/
public static double Metretoscreenpixel (double distance, double Currscale,
Context context) {
float dpi = context.getresources (). Getdisplaymetrics (). densitydpi;
1 pixels in the current map extent represents the actual distance of the map units
Double Resolution = (25.39999918/DPI)
* CURRSCALE/1000;
return distance/resolution;
}

/**
* Convert the corresponding pixel distance on the screen to the geographic distance on the current display map (m)
*
* @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;
}

Actual distance on ArcGIS for Android map and corresponding screen pixel value calculation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.