【问题标题】:Android geocoding by gps lat long通过 gps lat long 进行 Android 地理编码
【发布时间】:2015-11-01 10:38:45
【问题描述】:

在我的 android 应用程序中,我计算 gps 位置并将 lat 日志值显示到 TextView 中,我使用这个 lat long 值在 SQLITE DB 上进行查询。 现在我试图在 TextView 中显示由 lat 和 log 计算的 Location 的名称。我尝试了 geocodeby 我有 soma 错误。 这是我计算纬度和经度值的代码:

ImageView  bt_get_mygpspos = (ImageView)getView().findViewById(R.id.bt_get_mygpspos);
                edittext_mygpspos = (EditText)getView().findViewById(R.id.edittext_mygpspos);
                bt_get_mygpspos.setOnClickListener(new OnClickListener(){
                    @Override
                    public void onClick(View v) {
                        GPSTracker mGPS = new GPSTracker(getActivity());
                        if(mGPS.canGetLocation() ){
                            query.curPos = new LatLng(mGPS.getLatitude(),mGPS.getLongitude());
                            edittext_mygpspos.setText("lat:"+query.curPos.latitude+" lon:"+query.curPos.longitude);
                            Log.e("test", "lat:"+query.curPos.latitude+" lon:"+query.curPos.longitude);
                        }else{
                            mGPS.showSettingsAlert();
                        }
                    }
                });

我如何转换位置名称中的 mGPS.Latitude 和 Longitude 以显示到 TextView 中?

【问题讨论】:

    标签: android reverse-geocoding


    【解决方案1】:

    您可以使用任何基于 Web 的公共 API 进行地理编码,例如:

    Yandex 在前苏联空间中更好,并且具有更好的每日免费限制:与Google 中的 2500 相比,请求为 25 000。在任何其他细节Google 更好。

    【讨论】:

      猜你喜欢
      • 2010-10-25
      • 2018-01-23
      • 1970-01-01
      • 2019-05-18
      • 2015-03-28
      • 1970-01-01
      • 2023-03-10
      • 1970-01-01
      • 2016-10-03
      相关资源
      最近更新 更多