将纬度和经度转换为 esri arcGIS MapPoint
我在将纬度和经度值转换为 android esri arcGIS 地图点时遇到问题。这是我从 GPS 坐标获取纬度和经度值的代码:
LocationManager lm;
String towers;
double lat;
double longi;
TextView txt;
lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Criteria crit = new Criteria();
towers = lm.getBestProvider(crit, false);
Location location = lm.getLastKnownLocation(towers);
if(location != null)
{
lat = location.getLatitude();
longi = location.getLongitude();
}
现在我有了纬度和经度值。现在我需要的是将这些值转换为有效的 esri arcGIS MapPoint。谁能帮助我吗?
提前致谢。
I am having trouble in converting the latitude and longitude values into android esri arcGIS map Point. Here's my code to get latitude and longitude values from GPS coordinates:
LocationManager lm;
String towers;
double lat;
double longi;
TextView txt;
lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Criteria crit = new Criteria();
towers = lm.getBestProvider(crit, false);
Location location = lm.getLastKnownLocation(towers);
if(location != null)
{
lat = location.getLatitude();
longi = location.getLongitude();
}
now I have the latitude and longitude values. Now all I need is to convert these values into valid esri arcGIS MapPoint. Can anyone help me?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
假设您使用的是 ESRI Android API?如果是这样,请在地图上创建一个图形图层。然后创建一个点对象
,然后设置 x/y 值:
然后将 myPoint 添加到图形对象。
http://help.arcgis.com/en/arcgismobile/10.0/apis/ android/api/index.html
Assuming you're using the ESRI Android API? If so, create a graphics layer on your map. Then create a point object
then set the x/y values:
then add myPoint to the graphics object.
http://help.arcgis.com/en/arcgismobile/10.0/apis/android/api/index.html
是的,这是可能的。但您不使用 ArcGis 中的位置管理器。
ArcGIS 有像 LocationListener 这样的预定义方法,即:OnStatusChangedListener。
请参阅以下代码,将位置纬度和经度转换为 esri arcGIS MapPoint。
Yes, it is possible. But you don't use the locationmanager in ArcGis.
ArcGIS has the predefined method like LocationListener, that is: OnStatusChangedListener.
See the below code for converting location latitude and longitude into esri arcGIS MapPoint.
我从此处借用了一些
代码没有声称效率,但这至少是一个起点。
I've borrowed some code from here
I make no claims of efficiency, but it's a starting point at least.
免责声明:我不是这方面的专家,但想尽力提供帮助。 :)
现在有一个 ArcGIS Stack Exchange 站点。一直在添加更多信息,与互联网上发布的信息相比,这是一个很好的综合资源。
对于框架,我推荐 Android 版 GeoTools。
顺便说一句,QGIS for Android 是 Marco Bernasocchi 的一个有趣项目,您可能会发现有帮助作为参考。
希望您能找到您要找的东西!
Disclaimer: I'm not an expert in this, but want to try to help. :)
There is now an ArcGIS Stack Exchange site. There's more information being added all the time and is a nice consolidated resource compared to what is out there disbursed on the interwebs.
For frameworks, I recommend GeoTools for Android.
As an aside, QGIS for Android is an interesting project from Marco Bernasocchi which you may find helpful as a reference.
Hope you can find what you're looking for!
我制作了一个函数,将位置点的两个参数转换为 arcgis 点:
i made a function that converts the two parameters of a location point to arcgis point :
//将经纬度转换为地图点XY
//convert longitude and latitude to map point X Y