2012-07-23 12 views
14

私は2つの逆ジオコーディングAPI、Google Mapsとfoursquareに精通しています。どちらにも問題があります。 lat、lng = 35.699,139.707(東京)を考えてみましょう。いいえ、無料の逆ジオコーディングAPIを探しています

フォースクエア:私はresponse.venues[0].location.cityエントリにのみ興味が

{ 
"meta": { 
    "code": 200 
}, 
"notifications": [ 
    { 
     "type": "notificationTray", 
     "item": { 
      "unreadCount": 0 
     } 
    } 
], 
"response": { 
    "venues": [ 
     { 
      "id": "4b64ebedf964a520e3d92ae3", 
      "name": "まいどおおきに食堂 東新宿食堂", 
      "contact": { 
       "phone": "0352911870", 
       "formattedPhone": "03-5291-1870" 
      }, 
      "location": { 
       "address": "大久保1-1-45", 
       "crossStreet": "新宿セントラルハイツプラザ 1F", 
       "lat": 35.698492646211, 
       "lng": 139.707271456718, 
       "distance": 61, 
       "postalCode": "169-0072", 
       "city": "新宿区", 
       "state": "東京都", 
       "country": "Japan", 
       "cc": "JP" 
      }, 
      "categories": [ 
       { 
        "id": "4bf58dd8d48988d111941735", 
        "name": "Restaurant japonais", 
        "pluralName": "Restaurants japonais", 
        "shortName": "Japonaise", 
        "icon": { 
         "prefix": "https://foursquare.com/img/categories_v2/food/japanese_", 
         "suffix": ".png" 
        }, 
        "primary": true 
       } 
      ], 
      "verified": false, 
      "stats": { 
       "checkinsCount": 191, 
       "usersCount": 100, 
       "tipCount": 1 
      }, 
      "url": "http://www.shokudo.jp/", 
      "likes": { 
       "count": 0, 
       "groups": [] 
      }, 
      "specials": { 
       "count": 0, 
       "items": [] 
      }, 
      "hereNow": { 
       "count": 0, 
       "groups": [] 
      } 
     } 
    ] 
} 

}

GET https://api.foursquare.com/v2/venues/search?ll=35.699,139.707&oauth_token=5TJR4WQZSOW0ZWTE4ENMXKO3Y415252GITEMRPQIVPMEGCYK&v=20120723&limit=1 

次の結果が得られます。残念ながら、私は日本語を知らないので、それが何であるかは分かりません。まあ、googleはそれが新宿 - 東京の特別区の一つだと言います。

Googleマップ:

GET http://maps.googleapis.com/maps/api/geocode/json?sensor=false&language=en&latlng=35.699,139.707 

利回り:

{ 
    "results" : [ 
     { 
     "address_components" : [ 
      { 
       "long_name" : "41", 
       "short_name" : "41", 
       "types" : [ "sublocality_level_4", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "1", 
       "short_name" : "1", 
       "types" : [ "sublocality_level_3", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "1丁目", 
       "short_name" : "1丁目", 
       "types" : [ "sublocality_level_2", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Okubo", 
       "short_name" : "Okubo", 
       "types" : [ "sublocality_level_1", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Shinjuku", 
       "short_name" : "Shinjuku", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "Tokyo", 
       "short_name" : "Tokyo", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "Japan", 
       "short_name" : "JP", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "Japan, Tokyo, Shinjuku, Okubo, 1丁目1−41", 
     "geometry" : { 
      "location" : { 
       "lat" : 35.69893960, 
       "lng" : 139.7069460 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 35.70028858029149, 
        "lng" : 139.7082949802915 
       }, 
       "southwest" : { 
        "lat" : 35.69759061970850, 
        "lng" : 139.7055970197085 
       } 
      } 
     }, 
     "types" : [ "sublocality_level_4", "sublocality", "political" ] 
     }, 
     { 
     "address_components" : [ 
      { 
       "long_name" : "169-8540", 
       "short_name" : "169-8540", 
       "types" : [ "postal_code" ] 
      }, 
      { 
       "long_name" : "2", 
       "short_name" : "2", 
       "types" : [ "sublocality_level_3", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "1丁目", 
       "short_name" : "1丁目", 
       "types" : [ "sublocality_level_2", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Okubo", 
       "short_name" : "Okubo", 
       "types" : [ "sublocality_level_1", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Shinjuku", 
       "short_name" : "Shinjuku", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "Tokyo", 
       "short_name" : "Tokyo", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "Japan", 
       "short_name" : "JP", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "1丁目-2 Okubo, Shinjuku, Tokyo 169-8540, Japan", 
     "geometry" : { 
      "location" : { 
       "lat" : 35.69946460, 
       "lng" : 139.70746810 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 35.70081358029149, 
        "lng" : 139.7088170802915 
       }, 
       "southwest" : { 
        "lat" : 35.69811561970850, 
        "lng" : 139.7061191197085 
       } 
      } 
     }, 
     "types" : [ "postal_code" ] 
     }, 
     { 
     "address_components" : [ 
      { 
       "long_name" : "1", 
       "short_name" : "1", 
       "types" : [ "sublocality_level_3", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "1丁目", 
       "short_name" : "1丁目", 
       "types" : [ "sublocality_level_2", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Okubo", 
       "short_name" : "Okubo", 
       "types" : [ "sublocality_level_1", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Shinjuku", 
       "short_name" : "Shinjuku", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "Tokyo", 
       "short_name" : "Tokyo", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "Japan", 
       "short_name" : "JP", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "Japan, Tokyo, Shinjuku, Okubo, 1丁目1", 
     "geometry" : { 
      "bounds" : { 
       "northeast" : { 
        "lat" : 35.69984490, 
        "lng" : 139.70749510 
       }, 
       "southwest" : { 
        "lat" : 35.69787060, 
        "lng" : 139.70506090 
       } 
      }, 
      "location" : { 
       "lat" : 35.69880630, 
       "lng" : 139.70610160 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 35.70020673029150, 
        "lng" : 139.7076269802915 
       }, 
       "southwest" : { 
        "lat" : 35.69750876970850, 
        "lng" : 139.7049290197085 
       } 
      } 
     }, 
     "types" : [ "sublocality_level_3", "sublocality", "political" ] 
     }, 
     { 
     "address_components" : [ 
      { 
       "long_name" : "1丁目", 
       "short_name" : "1丁目", 
       "types" : [ "sublocality_level_2", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Okubo", 
       "short_name" : "Okubo", 
       "types" : [ "sublocality_level_1", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Shinjuku", 
       "short_name" : "Shinjuku", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "Tokyo", 
       "short_name" : "Tokyo", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "Japan", 
       "short_name" : "JP", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "Japan, Tokyo, Shinjuku, Okubo, 1丁目", 
     "geometry" : { 
      "bounds" : { 
       "northeast" : { 
        "lat" : 35.70128920, 
        "lng" : 139.70796940 
       }, 
       "southwest" : { 
        "lat" : 35.69787060, 
        "lng" : 139.7019760 
       } 
      }, 
      "location" : { 
       "lat" : 35.69868950, 
       "lng" : 139.70306310 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 35.70128920, 
        "lng" : 139.70796940 
       }, 
       "southwest" : { 
        "lat" : 35.69787060, 
        "lng" : 139.7019760 
       } 
      } 
     }, 
     "types" : [ "sublocality_level_2", "sublocality", "political" ] 
     }, 
     { 
     "address_components" : [ 
      { 
       "long_name" : "Okubo", 
       "short_name" : "Okubo", 
       "types" : [ "sublocality_level_1", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Shinjuku", 
       "short_name" : "Shinjuku", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "Tokyo", 
       "short_name" : "Tokyo", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "Japan", 
       "short_name" : "JP", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "Okubo, Shinjuku, Tokyo, Japan", 
     "geometry" : { 
      "bounds" : { 
       "northeast" : { 
        "lat" : 35.70956610, 
        "lng" : 139.7091340 
       }, 
       "southwest" : { 
        "lat" : 35.69787310, 
        "lng" : 139.70060080 
       } 
      }, 
      "location" : { 
       "lat" : 35.70418340, 
       "lng" : 139.70558750 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 35.70956610, 
        "lng" : 139.7091340 
       }, 
       "southwest" : { 
        "lat" : 35.69787310, 
        "lng" : 139.70060080 
       } 
      } 
     }, 
     "types" : [ "sublocality_level_1", "sublocality", "political" ] 
     }, 
     { 
     "address_components" : [ 
      { 
       "long_name" : "Higashishinjuku Station", 
       "short_name" : "Higashishinjuku Station", 
       "types" : [ "train_station", "transit_station", "establishment" ] 
      }, 
      { 
       "long_name" : "27", 
       "short_name" : "27", 
       "types" : [ "sublocality_level_3", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "7丁目", 
       "short_name" : "7丁目", 
       "types" : [ "sublocality_level_2", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Shinjuku", 
       "short_name" : "Shinjuku", 
       "types" : [ "sublocality_level_1", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Shinjuku", 
       "short_name" : "Shinjuku", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "Tokyo", 
       "short_name" : "Tokyo", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "Japan", 
       "short_name" : "JP", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "Higashishinjuku Station, 7丁目-27 Shinjuku, Tokyo, Japan", 
     "geometry" : { 
      "bounds" : { 
       "northeast" : { 
        "lat" : 35.7050830, 
        "lng" : 139.7144590 
       }, 
       "southwest" : { 
        "lat" : 35.6926030, 
        "lng" : 139.7000410 
       } 
      }, 
      "location" : { 
       "lat" : 35.697920, 
       "lng" : 139.7075490 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 35.7050830, 
        "lng" : 139.7144590 
       }, 
       "southwest" : { 
        "lat" : 35.6926030, 
        "lng" : 139.7000410 
       } 
      } 
     }, 
     "types" : [ "train_station", "transit_station", "establishment" ] 
     }, 
     { 
     "address_components" : [ 
      { 
       "long_name" : "169-0072", 
       "short_name" : "169-0072", 
       "types" : [ "postal_code" ] 
      }, 
      { 
       "long_name" : "Okubo", 
       "short_name" : "Okubo", 
       "types" : [ "sublocality_level_1", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Shinjuku", 
       "short_name" : "Shinjuku", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "Tokyo", 
       "short_name" : "Tokyo", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "Japan", 
       "short_name" : "JP", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "Okubo, Shinjuku, Tokyo 169-0072, Japan", 
     "geometry" : { 
      "bounds" : { 
       "northeast" : { 
        "lat" : 35.70972520, 
        "lng" : 139.71028470 
       }, 
       "southwest" : { 
        "lat" : 35.69710930, 
        "lng" : 139.69624280 
       } 
      }, 
      "location" : { 
       "lat" : 35.70418340, 
       "lng" : 139.70558750 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 35.70972520, 
        "lng" : 139.71028470 
       }, 
       "southwest" : { 
        "lat" : 35.69710930, 
        "lng" : 139.69624280 
       } 
      } 
     }, 
     "types" : [ "postal_code" ] 
     }, 
     { 
     "address_components" : [ 
      { 
       "long_name" : "Shinokubo Station", 
       "short_name" : "Shinokubo Station", 
       "types" : [ "train_station", "transit_station", "establishment" ] 
      }, 
      { 
       "long_name" : "10", 
       "short_name" : "10", 
       "types" : [ "sublocality_level_3", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "1丁目", 
       "short_name" : "1丁目", 
       "types" : [ "sublocality_level_2", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Hyakunincho", 
       "short_name" : "Hyakunincho", 
       "types" : [ "sublocality_level_1", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Shinjuku", 
       "short_name" : "Shinjuku", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "Tokyo", 
       "short_name" : "Tokyo", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "Japan", 
       "short_name" : "JP", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "Shinokubo Station, 1丁目-10 Hyakunincho, Shinjuku, Tokyo, Japan", 
     "geometry" : { 
      "bounds" : { 
       "northeast" : { 
        "lat" : 35.7078270, 
        "lng" : 139.708840 
       }, 
       "southwest" : { 
        "lat" : 35.6953970, 
        "lng" : 139.6937970 
       } 
      }, 
      "location" : { 
       "lat" : 35.7013060, 
       "lng" : 139.7000440 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 35.7078270, 
        "lng" : 139.708840 
       }, 
       "southwest" : { 
        "lat" : 35.6953970, 
        "lng" : 139.6937970 
       } 
      } 
     }, 
     "types" : [ "train_station", "transit_station", "establishment" ] 
     }, 
     { 
     "address_components" : [ 
      { 
       "long_name" : "Shinjuku Station", 
       "short_name" : "Shinjuku Station", 
       "types" : [ "train_station", "transit_station", "establishment" ] 
      }, 
      { 
       "long_name" : "38", 
       "short_name" : "38", 
       "types" : [ "sublocality_level_3", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "3丁目", 
       "short_name" : "3丁目", 
       "types" : [ "sublocality_level_2", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Shinjuku", 
       "short_name" : "Shinjuku", 
       "types" : [ "sublocality_level_1", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Shinjuku", 
       "short_name" : "Shinjuku", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "Tokyo", 
       "short_name" : "Tokyo", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "Japan", 
       "short_name" : "JP", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "Shinjuku Station, 3丁目-38 Shinjuku, Tokyo, Japan", 
     "geometry" : { 
      "bounds" : { 
       "northeast" : { 
        "lat" : 35.7005790, 
        "lng" : 139.7124960 
       }, 
       "southwest" : { 
        "lat" : 35.6812220, 
        "lng" : 139.6878250 
       } 
      }, 
      "location" : { 
       "lat" : 35.6909210, 
       "lng" : 139.7002580 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 35.7005790, 
        "lng" : 139.7124960 
       }, 
       "southwest" : { 
        "lat" : 35.6812220, 
        "lng" : 139.6878250 
       } 
      } 
     }, 
     "types" : [ "train_station", "transit_station", "establishment" ] 
     }, 
     { 
     "address_components" : [ 
      { 
       "long_name" : "160-0022", 
       "short_name" : "160-0022", 
       "types" : [ "postal_code" ] 
      }, 
      { 
       "long_name" : "Shinjuku", 
       "short_name" : "Shinjuku", 
       "types" : [ "sublocality_level_1", "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Shinjuku", 
       "short_name" : "Shinjuku", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "Tokyo", 
       "short_name" : "Tokyo", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "Japan", 
       "short_name" : "JP", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "Shinjuku, Tokyo 160-0022, Japan", 
     "geometry" : { 
      "bounds" : { 
       "northeast" : { 
        "lat" : 35.70311470, 
        "lng" : 139.71922230 
       }, 
       "southwest" : { 
        "lat" : 35.68222330, 
        "lng" : 139.69241360 
       } 
      }, 
      "location" : { 
       "lat" : 35.69110170, 
       "lng" : 139.7067630 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 35.70311470, 
        "lng" : 139.71922230 
       }, 
       "southwest" : { 
        "lat" : 35.68222330, 
        "lng" : 139.69241360 
       } 
      } 
     }, 
     "types" : [ "postal_code" ] 
     }, 
    /* REMOVED FOR BREVITY */ 
    ], 
    "status" : "OK" 
} 

Google MapsのAPI英語であるが、その結果はあまりにも低レベルです。たとえば、都市と町は通常localityタイプで識別されます。ここでは東京の特別区の一つである新宿がありますが、東京の行政制度の詳細な実装です。東京を東京にしたい。もちろん、の代わりにadministrative_area_level_1タイプのトークンを検索することもできます。東京は実際に日本の都道府県の1つであることがわかっています。

foursquare APIは同じ問題を抱えています。それは新宿と東京の州を日本語でのみ報告しています!

常識的な結果を返す簡単な高レベルの逆ジオコーディングAPIはありますか?つまり、日本国外には誰も「新宿に行く」とは言いません。人々は "私は東京に行く"と言う。

ありがとうございました。

+1

あなたの「常識」の定義は非常に狭いです。世界の人々の70%以上が英語を話さないので、地元の人々がその場所に呼ぶものを返すよりも、もっと「共通」なのでしょうか? いずれにしても、東京は都市ではなく、レベル1の管理区域(州、州、県、広州)です。あなたが日本の都市の名前を知らないという理由だけで、「東京」、「埼玉」、「長野」と言いたいなら、lvl1管理エリアをgoogle APIから使用してください。しかし、 Yahoo APIに私を参照するために "シカゴ"の代わりに "イリノイ"と言ってください。 – Lacrymology

答えて

5

Yahoo Maps APIは、精度を設定する機能を備えているため、手助けすることができます。

+0

+1私は今それをチェックしている。私はこの質問で与えられた座標とまったく同じように動作するようです。しかし、私はさらに多くの座標を調べる必要があります。 – mark

+0

しかし、1つの問題があります。 YahooはGoogleよりもかなり少ない領域をカバーしています。 – mark

2

あなたは、私はそれがどのように正確に知りませんが、あなたが

http://dev.virtualearth.net/services/v1/geocodeservice/geocodeservice.asmx/ReverseGeocode?latitude=[NUMBER]&longitude=[NUMBER]&key=[MAPS_KEY]&culture=%22en-us%22&format=json 
23

オープンストリートマップがあまりにも逆ルックアップツールを持って、それを試すことができBing Mapsのを試すことができます。

http://wiki.openstreetmap.org/wiki/Nominatim#Reverse_Geocoding_.2F_Address_lookup

例からリンク:

クエリ:

http://nominatim.openstreetmap.org/reverse?format=xml&lat=52.5487429714954&lon=-1.81602098644987&zoom=18&addressdetails=1 

結果:

<reversegeocode timestamp="Fri, 06 Nov 09 16:33:54 +0000" querystring="..."> 
    <result place_id="1620612" osm_type="node" osm_id="452010817"> 
    135, Pilkington Avenue, Wylde Green, City of Birmingham, West Midlands (county), B72, United Kingdom 
    </result> 
    <addressparts> 
    <house>135</house> 
    <road>Pilkington Avenue</road> 
    <village>Wylde Green</village> 
    <town>Sutton Coldfield</town> 
    <city>City of Birmingham</city> 
    <county>West Midlands (county)</county> 
    <postcode>B72</postcode> 
    <country>United Kingdom</country> 
    <country_code>gb</country_code> 
    </addressparts> 
</reversegeocode> 
+0

ただし、このサービスはごく少数のリクエスト(「1秒あたり1リクエストの絶対最大値」)にのみ使用されます。 –

5

GeocodeFarmを試してみてください。

毎日無料のクエリがIPベースで提供されていますが、Webサービスは無制限で無料です。安い$ 25は毎日25,000回のクエリを提供します(これは私のアプリケーション用です)。

結果は分かりやすく、徹底した文書化、フォワードとリバースなどがあります。

+1

毎日25000件のクエリが実際には£100 /月です... – KPM

+0

今無料版はありません。それに気づく –

関連する問題