Geo-Postcodes-JP-0.005

NAME

Geo::Postcodes::JP::Process - process Japan Post Office postcode data

read_ken_all

my $postcodes_ref = read_ken_all ('KEN_ALL.CSV');

Read the file KEN_ALL.CSV. The return value is an array reference containing the lines of the postcode file in the same order as the file itself. The routine issues a fatal error if a problem is encountered.

The return value is a double indexed array.

process_line

my %values = process_line ($line);

Turn a line of the postcode file into a hash of its values.

The values of the hash are

number

The JIS code number for the region. The JIS standards for regions ofJapan are numbered JIS X 0401 (1973) for the prefecture identificationcodes, and JIS X0402 (2003) identification codes for cities, towns andvillages.

old_postcode

The old three or five digit postcode.

new_postcode

The new seven digit postcode.

ken_kana

The kana version of the prefecture.

city_kana

The kana version of the city.

address_kana

The kana version of the address.

ken_kanji

The kanji version of the prefecture.

city_kanji

The kanji version of the city.

address_kanji

The kanji version of the address.

one-region-multiple-postcodes

This is 1 if the same address has more than one postcode, zerootherwise.

numbering-start

Indicates if numbering starts, 1 if so.

has-choume

Indicates there is a division into "choume".

one-postcode-multiple-regions

This is 1 if the same postcode covers more than one region, zerootherwise.

TERMINOLOGY

In this module, "postcode" is the translation used for the Japanese term "yuubin bangou" (郵便番号). They might be called "postal codes" or even "zip codes" by some.

This module only deals with the seven-digit modern postcodes. It does not deal with the old three and five digit postcodes, these are not parsed from the file.

ken

"Ken" means the Japanese system of prefectures, which includes the "ken" divisions as well as the "do/fu/to" divisions, with "do" used for Hokkaido, "fu" for Osaka and Kyoto, and "to" for the Tokyo metropolis. These are got from the module using the word "ken".

In this module, "city" is the term used to point to the second field in the postcode data file. Some of these are actually cities, like "Mito-shi" (水戸市), the city of Mito in Ibaraki prefecture. However, some of them are not really cities but other geographical subdivisions.

address

In this module, "address" is the term used to point to the third field in the postcode data file. This is called 町域 (chouiki) by the Post Office.

jigyosyo

In this module, "jigyosyo" is the term used to point to places of business. Some places of business have their own postcodes,

For example, in the following data file entry, "3100004" is the postcode, "茨城県" (Ibaraki-ken) is the "ken", "水戸市" (Mito-shi) is the "city", and "青柳町" (Aoyagicho) is the "address".