2017-10-10 5 views
-1

ジオコーダーを使用して、いくつかの座標のアドレスを取得しています。 Addressオブジェクトに結果アドレスを与え、私はユーザーオブジェクトのさまざまな属性(例えば、敷地、エリア、ランドマーク、地方、sublocality、都市、州)を並べ替えることができるようにAddressオブジェクトを調べようとしています。Androidジオコーダのレスポンス構造とは何ですか?

Geocoderオブジェクトはこれまでとは少し違っていて、たくさんのアドレス行を持っていたと仮定しますが、現在のところ、カンマで区切られたフレーズは1つしかなく、残りの部分とは一致しません。参照用

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は、身体の残りの部分と一致していない理由として、いくつかの洞察を提供することはできますか?

EDIT: 私の疑問は、例えば第一1 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 '、それらは何ですか?代わりに、地方は「デリー」として現れています。地方ではありません。全体の都市です。 Javaでは

答えて

-1

、ジオコーダ応答

List<android.location.Address> addresses = 
geocoder.getFromLocationName("your-address",1); 
+0

をデシリアライズするためのビルトイン構造Iは、 アドレス= geocoder.getFromLocation(location.getLatitude()、location.getLongitude()を使用して5いあり); しかし、jsonとして変換されたアドレスは上記の構造を作成しますが、構造に問題はありませんが、アドレス行と本体の下部の間に不一致があります。 – Ari

関連する問題