【ArcGIS for Android】經緯度坐標、地圖投影坐標、屏幕坐標互相轉換


 

SpatialReference mSR4326 = SpatialReference.create(4326);
SpatialReference mSR3857 = SpatialReference.create(3857);

 

1. 屏幕坐標轉換成投影坐標

@Override
public boolean onSingleTap(MotionEvent point) {

SpatialReference sr = map.getSpatialReference();

Point dp = map.toMapPoint(point.getX(), point.getY());

}


2. 投影坐標轉換成經緯度

Point wgsPoint = (Point) GeometryEngine.project(dp ,map.getSpatialReference(),mSR3857);

3、經緯度轉換成投影坐標

Point mapPoint = (Point) GeometryEngine.project(wgsPoint ,mSR4326,map.getSpatialReference());

4、投影坐標轉換成屏幕坐標

Point screenPoint = map.toScreenPoint(mapPoint);


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM