mapbox / mapbox/MapboxGeocoder.swift

Expected fields do not always appear in the MBGeocodedPlacemark

オープン
#167 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug
主要言語
Swift
スター
133
フォーク
46
PR マージ指標
30日以内にマージされた PR はありません

説明

Using v0.10.0.

If I reverse geocode a point in the water of the San Francisco Bay, "California" does not appear as an administrativeRegion on the MBGeocodedPlacemark. If I print the addressDictionary of the placemark, I see that the name is California, but it is not placed under the state key.

Sample code:

CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(37.763778227711242, -122.32790567148118);
MBGeocoder *geocoder = [[MBGeocoder alloc] initWithAccessToken:<token>];
MBReverseGeocodeOptions *options = [[MBReverseGeocodeOptions alloc] initWithCoordinate:coordinate];
[geocoder geocodeWithOptions:options completionHandler:^(NSArray<MBGeocodedPlacemark *> * _Nullable placemarks, NSString * _Nullable attribution, NSError * _Nullable error) {
        
    NSLog(@"%@", [placemarks[0] addressDictionary]);
      
}];

Output:

{
    ISOCountryCode = US;
    country = "United States";
    formattedAddressLines =     (
        "United States"
    );
    name = California;
}

This makes it challenging to properly format and display reverse geocode data that is powered by a dynamic location at run time. If I reverse geocode a location that has a street address, it likely has a state field.

Below is the addressDictionary of a reverse geocode coordinate in downtown San Francisco. The state is now there. (37.794291209161685, -122.412848997168)

{
    ISOCountryCode = US;
    city = "San Francisco";
    country = "United States";
    formattedAddressLines =     (
        "1187 Washington Street",
        "San Francisco",
        "California 94108",
        "United States"
    );
    name = "Washington Street";
    postalCode = 94108;
    state = California;
    street = "Washington Street";
    subAdministrativeArea = "San Francisco";
    subLocality = "Nob Hill";
    subThoroughfare = 1187;
    thoroughfare = "Washington Street";
}

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

MBGeocoder の geocodeWithOptions:completionHandler: フローと、レポートに示されている MBGeocodedPlacemark の addressDictionary から始めます。San Francisco Bay とダウンタウンの座標を比較し、その後、期待される administrativeRegion/state 情報が逆ジオコーディングされた placemark に一貫して公開されていることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
objective-c, swift
領域
api, mobile-dev
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。