-1
我正在使用Geocoder获取某些坐标的地址。它给出了地址对象中的结果地址,我试图研究地址对象,以便我可以重新排列用户显示的各种属性(例如场所,地区,地标,地点,次级地域,城市,州)。什么是Android Geocoder响应结构?
我假设Geocoder对象以前有点不同,并且有很多地址线,但是目前它只有一个,所有以逗号分隔的短语都与下面提供的其余身体不匹配。
以下JSON结构,以供参考:
1> Delhi Address: [
{
"mAddressLines": {
"0": "E46, Lodhi Colony, Sector 3G, Rohini, Delhi, 110085, India"
},
"mAdminArea": "Delhi",
"mCountryCode": "IN",
"mCountryName": "India",
"mFeatureName": "E46",
"mHasLatitude": true,
"mHasLongitude": true,
"mLatitude": 28.703985300000003,
"mLocale": "en_US",
"mLocality": "Delhi",
"mLongitude": 77.1024425,
"mMaxAddressLineIndex": 0,
"mPostalCode": "110085",
"mPremises": "E46",
"mSubAdminArea": "North West Delhi",
"mSubLocality": "Rohini"
}
]
2> Delhi Address: [
{
"mAddressLines": {
"0": "684, Pocket 7, Sector 2, Rohini, Delhi, 110085, India"
},
"mAdminArea": "Delhi",
"mCountryCode": "IN",
"mCountryName": "India",
"mFeatureName": "684",
"mHasLatitude": true,
"mHasLongitude": true,
"mLatitude": 28.700565400000002,
"mLocale": "en_US",
"mLocality": "Delhi",
"mLongitude": 77.0993105,
"mMaxAddressLineIndex": 0,
"mPostalCode": "110085",
"mPremises": "684",
"mSubAdminArea": "North West Delhi",
"mSubLocality": "Rohini"
},
{
"mAddressLines": {
"0": "Himalaya Apartment, Guru Gowalkar Marg, Pocket 00, Sector 2, Rohini, Delhi, 110085, India"
},
"mAdminArea": "Delhi",
"mCountryCode": "IN",
"mCountryName": "India",
"mFeatureName": "Himalaya Apartment",
"mHasLatitude": true,
"mHasLongitude": true,
"mLatitude": 28.7004086,
"mLocale": "en_US",
"mLocality": "Delhi",
"mLongitude": 77.09895829999999,
"mMaxAddressLineIndex": 0,
"mPostalCode": "110085",
"mPremises": "Himalaya Apartment",
"mSubAdminArea": "New Delhi",
"mSubLocality": "Rohini",
"mThoroughfare": "Guru Gowalkar Marg"
}
]
3> Hyderabad Address: [
{
"mAddressLines": {
"0": "Rinda Legend Capital Mall, Main Rd, Subhash Nagar, Badi Chowdi, Koti, Hyderabad, Telangana 500095, India"
},
"mAdminArea": "Telangana",
"mCountryCode": "IN",
"mCountryName": "India",
"mFeatureName": "Rinda Legend Capital Mall",
"mHasLatitude": true,
"mHasLongitude": true,
"mLatitude": 17.3852123,
"mLocale": "en_US",
"mLocality": "Hyderabad",
"mLongitude": 78.48660459999999,
"mMaxAddressLineIndex": 0,
"mPostalCode": "500095",
"mPremises": "Rinda Legend Capital Mall",
"mSubAdminArea": "Ranga Reddy",
"mSubLocality": "Koti",
"mThoroughfare": "Main Road"
},
{
"mAddressLines": {
"0": "5-1-314, Main Rd, Subhash Nagar, Badi Chowdi, Koti, Hyderabad, Telangana 500095, India"
},
"mAdminArea": "Telangana",
"mCountryCode": "IN",
"mCountryName": "India",
"mFeatureName": "5-1-314",
"mHasLatitude": true,
"mHasLongitude": true,
"mLatitude": 17.3852895,
"mLocale": "en_US",
"mLocality": "Hyderabad",
"mLongitude": 78.4865963,
"mMaxAddressLineIndex": 0,
"mPostalCode": "500095",
"mSubAdminArea": "Hyderabad",
"mSubLocality": "Koti",
"mSubThoroughfare": "5-1-314",
"mThoroughfare": "Main Road"
},
{
"mAddressLines": {
"0": "Omnitech InfoSolutions, 1st Floor, Bulding No 17, Main Rd, Goutam Nagar, Badi Chowdi, Kachiguda, Hyderabad, Telangana 501301, India"
},
"mAdminArea": "Telangana",
"mCountryCode": "IN",
"mCountryName": "India",
"mFeatureName": "Omnitech InfoSolutions",
"mHasLatitude": true,
"mHasLongitude": true,
"mLatitude": 17.385044,
"mLocale": "en_US",
"mLocality": "Hyderabad",
"mLongitude": 78.486671,
"mMaxAddressLineIndex": 0,
"mPostalCode": "501301",
"mPremises": "Omnitech InfoSolutions",
"mSubAdminArea": "Ranga Reddy",
"mSubLocality": "Kachiguda",
"mSubThoroughfare": "1st Floor, Bulding No 17",
"mThoroughfare": "Main Road"
},
{
"mAddressLines": {
"0": "Mobile Tower, Main Rd, Goutam Nagar, Badi Chowdi, Kachiguda, Hyderabad, Telangana 500095, India"
},
"mAdminArea": "Telangana",
"mCountryCode": "IN",
"mCountryName": "India",
"mFeatureName": "Mobile Tower",
"mHasLatitude": true,
"mHasLongitude": true,
"mLatitude": 17.385044,
"mLocale": "en_US",
"mLocality": "Hyderabad",
"mLongitude": 78.486671,
"mMaxAddressLineIndex": 0,
"mPostalCode": "500095",
"mPremises": "Mobile Tower",
"mSubAdminArea": "Ranga Reddy",
"mSubLocality": "Kachiguda",
"mThoroughfare": "Main Road"
},
{
"mAddressLines": {
"0": "Saini Industries, 1-47/2, Fateh Nagar, Fateh Nagar, Gandhi Nagar, Badi Chowdi, Kachiguda, Hyderabad, Telangana 500018, India"
},
"mAdminArea": "Telangana",
"mCountryCode": "IN",
"mCountryName": "India",
"mFeatureName": "Saini Industries",
"mHasLatitude": true,
"mHasLongitude": true,
"mLatitude": 17.385047399999998,
"mLocale": "en_US",
"mLocality": "Hyderabad",
"mLongitude": 78.4866596,
"mMaxAddressLineIndex": 0,
"mPostalCode": "500018",
"mPremises": "Saini Industries",
"mSubAdminArea": "Hyderabad",
"mSubLocality": "Kachiguda"
}
]
任何一个可以提供一些见解,为什么mAddressLine不与身体的其他部分相匹配?
编辑: 我的疑问是例如一日一个AddressLine是:
"E46, Lodhi Colony, Sector 3G, Rohini, Delhi, 110085, India"
但身体的其余部分:
"mAdminArea": "Delhi",
"mCountryCode": "IN",
"mCountryName": "India",
"mFeatureName": "E46",
"mHasLatitude": true,
"mHasLongitude": true,
"mLatitude": 28.703985300000003,
"mLocale": "en_US",
"mLocality": "Delhi",
"mLongitude": 77.1024425,
"mMaxAddressLineIndex": 0,
"mPostalCode": "110085",
"mPremises": "E46",
"mSubAdminArea": "North West Delhi",
"mSubLocality": "Rohini"
没有 '洛迪殖民地' 或'部门3G',那是什么?相反,地方性显示为'德里',它不是一个地方,它是整个城市。
我使用 地址= geocoder.getFromLocation(location.getLatitude(),location.getLongitude(),5 ); 但是,转换为json时的地址创建了上述结构,我没有这个结构的问题,但地址线和主体下部之间存在差异。 – Ari