Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

790-0054のaddress2の値が空 #4

Open
shunkit opened this issue Sep 19, 2018 · 3 comments
Open

790-0054のaddress2の値が空 #4

shunkit opened this issue Sep 19, 2018 · 3 comments

Comments

@shunkit
Copy link

shunkit commented Sep 19, 2018

https://madefor.github.io/postal-code-api/api/v1/790/0054.json

address2は「空港通(1、2丁目)」のはずです。

@shunkit shunkit changed the title 790-0054のaddress3の値が空 790-0054のaddress2の値が空 Sep 19, 2018
@miya0001
Copy link
Member

自動入力を想定してて (xxx) 付きのときはその列を捨ててるんです。
なにかいいアイディアがあればぜひご提案いただけるとうれしいです。

@manzoku
Copy link

manzoku commented Mar 31, 2019

ちょっとややこしいですけど、
「空港通(1、2丁目)」は「空港通1丁目」と「空港通2丁目」に
「空港通(3~7丁目)」「は「空港通3丁目」「空港通4丁目」「空港通5丁目」「空港通6丁目」「空港通7丁目」に
「上美唄町(協和、南)」(079-0177)は「上美唄町協和」「上美唄町南」に
という感じで【数字】の時と【そうではない】時とにわけてあげるというのもありかもしれません。

シンプルに「、」の前後で分けるだけで「丁目」は前半の方にはつかない。という割り切りもありなのかもです。
「~」が曲者ですが。。。


と考えもしましたが、そもそも郵便番号下4桁をjsonファイルにしているので、同じ郵便番号だと
単純にはどうにもできないんですね。
キーdataの2要素目に分割したものも返すようにするとシーンによって使い分けできるかもしれないです。

@matsubo
Copy link

matsubo commented Dec 24, 2021

郵便番号を保管する用途のデータ利用法にあうように加工したマスタを使えば、このあたりが最適化されております。

例:

% curl -s https://postcode.teraren.com/postcodes/7900054.json | jq
{
  "postcode_type": "area",
  "jis": "38201",
  "old": "790",
  "new": "7900054",
  "prefecture_kana": "エヒメケン",
  "city_kana": "マツヤマシ",
  "suburb_kana": "クウコウドオリ",
  "prefecture": "愛媛県",
  "city": "松山市",
  "suburb": "空港通",
  "street_address": null,
  "office": null,
  "office_kana": null,
  "post_type": null,
  "is_separated_suburb": 1,
  "is_koaza": 0,
  "is_chome": 1,
  "is_include_area": 0,
  "status": 0,
  "reason": 0,
  "created_at": "2021-12-21T00:00:16.000Z",
  "updated_at": "2021-12-21T00:00:16.000Z"
}
% curl -s https://postcode.teraren.com/postcodes/0790177.json | jq
{
  "postcode_type": "area",
  "jis": "01215",
  "old": "07901",
  "new": "0790177",
  "prefecture_kana": "ホッカイドウ",
  "city_kana": "ビバイシ",
  "suburb_kana": "カミビバイチョウ",
  "prefecture": "北海道",
  "city": "美唄市",
  "suburb": "上美唄町",
  "street_address": null,
  "office": null,
  "office_kana": null,
  "post_type": null,
  "is_separated_suburb": 1,
  "is_koaza": 0,
  "is_chome": 0,
  "is_include_area": 0,
  "status": 0,
  "reason": 0,
  "created_at": "2021-12-21T00:00:16.000Z",
  "updated_at": "2021-12-21T00:00:16.000Z"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants