Groups
Sign in
Groups
Google-Maps-API-Japan
Conversations
About
Send feedback
Help
「横浜」のジオコーディング
31 views
Skip to first unread message
古川大輔
unread,
Aug 22, 2010, 8:17:40 AM
8/22/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google-Maps-API-Japan
こんにちは。
Google Geocoding API(
http://code.google.com/intl/ja/apis/maps/documentation/geocoding/
)をつかって、「横浜」を検索すると、石川県河北郡津幡町横浜の位置が帰ってきます。
http://maps.google.com/maps/api/geocode/json?address=%E6%A8%AA%E6%B5%9C&sensor=false
間違いじゃないのですけど、自分の期待値としては、神奈川県の横浜駅が帰ってきてほしいところです。
WEBで公開されているGoogleMapに「横浜」と入れると横浜駅に移動するので、別のAPIを使うとかすれば実現できるのではないかと思うのです
けど、どなたか何かご存じでないですか?
Masashi.K
unread,
Aug 22, 2010, 8:49:31 PM
8/22/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google-Maps-API-Japan
古川さん
たしかに石川県の横浜という位置が返ってきますね。
Webで公開されているGoogle Mapの方は、普段から日本のGoogleの方たちが
メンテナンスと最適化をしているのでそうなってますが
APIの方とは必ずしも連動していないみたいですよ。
Google Maps APIの方では、boundsを設定しながら検索すると
良いと思います。
他に「Geocoding(
http://www.geocoding.jp
)」や
「HeartRails Express(
http://express.heartrails.com/
)」などを
使って、組み合わせる、駅名を優先するなど
独自で工夫をするとよいのではないでしょうか。
On 8月22日, 午後9:17, 古川大輔 <
mogyanl...@gmail.com
> wrote:
> こんにちは。
>
> Google Geocoding API(
http://code.google.com/intl/ja/apis/maps/documentation/geocoding/
> )をつかって、「横浜」を検索すると、石川県河北郡津幡町横浜の位置が帰ってきます。
http://maps.google.com/maps/api/geocode/json?address=%E6%A8%AA%E6%B5%.
..
古川大輔
unread,
Aug 22, 2010, 10:18:20 PM
8/22/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google-Maps-API-Japan
こんにちは。コメントありがとうございます。
いただいたコメントに従っていろいろ試してみましたところ、なんだか面白い解決法に気づきました。
無制限
http://maps.google.com/maps/api/geocode/json?address=%E6%A8%AA%E6%B5%9C&sensor=false
→石川県横浜しかでてこない
boundで関東近辺に制限
http://maps.google.com/maps/api/geocode/json?address=%E6%A8%AA%E6%B5%9C&bounds=35,139|36,141&sensor=false
→神奈川県横浜、石川県横浜の順番
→でも、これだと逆に「すすきの」が神奈川県にある すすきの になって、これはこれで不都合(わがままですけど^^; )
boundで日本国内に制限
http://maps.google.com/maps/api/geocode/json?address=%E6%A8%AA%E6%B5%9C&bounds=23,123|47,147&sensor=false
→石川県横浜しかでてこない
regionをjpにする
http://maps.google.com/maps/api/geocode/json?address=%E6%A8%AA%E6%B5%9C®ion=jp&sensor=false
→神奈川県横浜、石川県横浜の順番で出てくる
最後のregion作戦だと、「横浜」は神奈川県の横浜駅を示すし、「すすきの」は北海道のすすきの駅を指して、大変理想的な振る舞いです。
マニュアルによると、regionをつけるとRegion Biasingというので検索結果にバイアスがかかる、のだそうで、
http://code.google.com/intl/ja/apis/maps/documentation/geocoding/#RegionCodes
どうしてこれで都合のいい結果が出てくるのか正直分からないのですけど、
まあつけて駄目なパラメータではなさそうなので、とりあえずこれで行こうかと思っています。
/Furukawa
Reply all
Reply to author
Forward
0 new messages