@digital-go-jp/abr-geocoder

中文文档
2.3.1发布于 2026/08/01MIT近 30 天下载 3031

デジタル庁:アドレス・ベース・レジストリを用いたジオコーダー

此软件包已被标记为弃用

Deprecated. v3 is on GitHub: https://github.com/digital-go-jp/abr-geocoder

原始使用文档
文档目录13 节
  1. 🚨 Upgrade to version 2.3.0 from v2.2.1
  2. 🚨 Upgrade to version 2.2.1 from v2.2
  3. 🚨 Upgrade to version 2.2 from v2.1
  4. Description
  5. Features
  6. Use Cases
  7. Limitations
  8. Installation
  9. abrg download command
  10. abrg update-check command
  11. abrg command
  12. abrg serve start command
  13. abrg serve stop command

abr-geocoder (Digital Agency Address Base Registry Geocoder)

🚨 Upgrade to version 2.3.0 from v2.2.1

  • Bug fix: abrg download -c <prefecture LGCode> no longer skips mt_town_pos_pref**.csv (town master position-reference extension at the prefecture level).
  • Important: With the upcoming Version 3 release, Version 2.3.0 is the final release of the Version 2 series. Subsequent fixes and feature additions will be made in Version 3, and no further support is planned for the Version 2 series.

🚨 Upgrade to version 2.2.1 from v2.2

  • Updated to use the new DCAT format API for downloading datasets.
  • Known Issue: The abrg update-check command is not yet compatible with the new API format and will not work properly. Since we are planning to upgrade to Version 3, support in Version 2 is undecided.

🚨 Upgrade to version 2.2 from v2.1

  • The abrg serve command is splitted into abrg serve start and abrg serve stop commands.

Description

A geocoder that matches input address strings with the Address Base Registry maintained by the Digital Agency, Government of Japan, outputting normalized address strings, town IDs, latitude and longitude, etc. It analyzes Japanese domestic address notation, absorbs variations, and outputs normalized results according to the hierarchy.

Image

Features

  • Geocoder targeting domestic addresses in Japan.
  • Normalizes address notation according to the Address Base Registry and hierarchy.
  • Supports residence indication and partial number (lot number).
  • Uses SQLite, enabling geocoding within the server.
  • High-speed processing through multithreading.
  • Supports six output formats: csv, json, geojson, ndjson, ndgeojson, simplified.

Use Cases

  • Usable as a command:
    • Pipeline with standard input/output.
    • Input/output via file.
  • Usable as a REST server.
  • Usable as a Node.js library:
    • Supports individual requests and streams.
  • Limited support for searches by Kyoto street names.

Limitations

  • Cannot search by landmarks (e.g., famous facility names).
  • Cannot search by postal codes.
  • Cannot search by alphabet (English notation).

Installation

  • Global installation

    npm install -g @digital-go-jp/abr-geocoder
    abrg  # Verify it runs
    
  • Local install

    npm install @digital-go-jp/abr-geocoder
    npm link
    abrg  # Verify it runs
    

abrg download command

Downloads the necessary dataset for geocoding from the Address Base Registry and builds the database using SQLite.

abrg download [options]
  • Specify region(s) for download

    You can specify a particular prefecture or municipality to build a localized database, reducing the data size and speeding up database construction.

    Use the National Local Government Codes to specify the region(s). Separate multiple regions with spaces.

    # Download data for Tokyo
    abrg download -c 130001
    
    # Download data for Tokyo and Kanagawa
    abrg download -c 130001 140007
    
    # Download data for Chiyoda ward
    abrg download -c 131016
    
  • Change directory

    You can change the directory to download the dataset files and save the database. The default is $HOME/.abr-geocoder.

    abrg download -d (path to directory to save data)
    
  • Hide progress bar If you specify the silent option, the progress bar will not be displayed.
    abrg download --silent
    
  • Show debug information Shows the time taken for the process when it is completed.
    abrg download --debug
    

abrg update-check command

Checks for data updates. If there is local data, it checks for updates in the municipalities contained in the database. If new data is available, it can be downloaded.

abrg update-check [options]
  • Pre-specify yes/no You can pre-specify whether to continue downloading if update data is available.
    # Continue downloading
    abrg update-check --yes
    
    # Do not continue downloading
    abrg update-check --no
    
  • Hide progress bar If you specify the silent option, the progress bar will not be displayed.
    abrg update-check --silent
    
  • Change directory

    Specifies the directory to save the database. The default is $HOME/.abr-geocoder.

    abrg update-check -d (path to directory to save data)
    
  • Show debug information Shows the time taken for the process when it is completed.
    abrg update-check --debug
    

abrg command

Geocodes the input address string with the database and outputs normalized address strings, town IDs, latitude, longitude, etc.

$ abrg <inputFile> [<outputFile>] [options]
  • <inputFile>

    Specifies how to input data into the command.

    • If a file path is specified The specified text file will be geocoded. Enter one address per line.

      Example:

      abrg ./sample.txt
      

      sample.txt:

      東京都千代田区紀尾井町1-3   // 1-3 Kioicho, Chiyoda-ku, Tokyo
      東京都千代田区永田町1-10-1  // 1-10-1 Nagatacho, Chiyoda-ku, Tokyo
      ...
      東京都千代田区永田町一丁目7番1号  // 1-7-1 Nagatacho, Chiyoda-ku, Tokyo
      
    • If "-" is specified Receives data from standard input.

      Example:

      echo "東京都千代田区紀尾井町1-3 東京ガーデンテラス紀尾井町 19階、20階" | abrg -
      
  • <outputFile>

    Specifies where to output the processing results. If omitted, outputs to standard output (stdout).

    • If a file path is specified Outputs the processing results to the specified file. The output format is based on the `--format` option. Example:
      abrg ./input.txt ./output.json
      
    • If omitted If omitted, outputs to standard output (stdout). Example:
      cat ./sample.txt | abrg - | jq
      
  • Change output format

    You can change the output format with the -f, --format option. The default is json.

    formatDescription
    csvOutputs results in comma-separated csv format
    simplifiedOutputs results in comma-separated csv format with limited fields
    jsonOutputs results in JSON format
    ndjsonOutputs results in NDJSON format
    geojsonOutputs results in GeoJSON format
    ndgeojsonOutputs results in NDGeoJSON format
  • Specify wildcard character You can specify any character as a wildcard. Useful for cases where certain characters like old kanji that can't be expressed in utf-8 are converted to ● (black circle). The default is `?`.

    Example:

    echo "東京都町●市森野2-2-22" | abrg - --fuzzy "●"
    
  • Hide progress bar If you specify the silent option, the progress bar will not be displayed.
    abrg ./input.txt ./output.txt --silent
    
  • Change directory

    Specifies the directory to save the database. The default is $HOME/.abr-geocoder.

    abrg ./input.txt ./output.txt  -d (path to directory to save data)
    
  • Show debug information Shows the time taken for the process when it is completed. Also outputs the primary key information of each table matched to the input address string.
    abrg ./input.txt ./output.txt --debug
    
  • Change geocoding target

    You can change the geocoding target with the --target option. The default is all.

    formatDescription
    allSearches both residential address and parcel number data. The result for the residential address takes precedence.
    residentialSearches only the residential address data.
    parcelSearches only the parcel number data.

abrg serve start command

Starts the geocoder as a REST API server.

abrg serve start [options]

Example:

curl http://localhost:3000/geocode?address=東京都千代田区紀尾井町1-3
  • Change port number

    Changes the port number for the REST API server. The default is 3000.

    abrg serve start -p 8080
    
  • Change directory

    Specifies the directory to save the database. The default is $HOME/.abr-geocoder.

    abrg serve start -d (path to directory to save data)
    
  • Request parameters

    The request is made via HTTP/GET. The following parameters can be specified:

    | Parameter | Required | Description | |-------------|-------------------------------------------------------------------| | address | Y | The address string to be geocoded. Required parameter. | | target | | Search target (all, residential, parcel) | | format | | Output format for the result. | | fuzzy | | A single character used as a wildcard. |

abrg serve stop command

Stop the geocoder as a REST API server.

abrg serve stop

版本与发布记录

@digital-go-jp/abr-geocoder 共发布 14 个版本,首次发布于 2023/10/20;过去 12 个月发布了 2 个版本。

版本发布日期距今
2.3.1latest2026/08/013 个月前
2.3.02026/07/293 个月前
2.2.12025/10/081.1 年前
2.2.02025/02/191.7 年前
2.1.22024/11/102 年前
2.1.12024/11/082 年前

关于 @digital-go-jp/abr-geocoder 的常见问题

@digital-go-jp/abr-geocoder 是什么?

デジタル庁:アドレス・ベース・レジストリを用いたジオコーダー注意:该包已被作者标记为弃用——Deprecated. v3 is on GitHub: https://github.com/digital-go-jp/abr-geocoder

如何安装 @digital-go-jp/abr-geocoder?

在项目目录运行 npm install @digital-go-jp/abr-geocoder,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 abrg,可以用 npx abrg 直接运行。

@digital-go-jp/abr-geocoder 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/digital-go-jp__abr-geocoder 是否存在。

@digital-go-jp/abr-geocoder 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@digital-go-jp/abr-geocoder 可以商用吗?

@digital-go-jp/abr-geocoder 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@digital-go-jp/abr-geocoder 的下载量有多少?

根据 npm 官方下载统计,@digital-go-jp/abr-geocoder 在 2026/10/12 – 2026/11/10 这 30 天内被下载 3,031 次,日均约 101 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@digital-go-jp/abr-geocoder 还在维护吗?

最新版本 2.3.1 发布于 2026/08/01(3 个月前);至今共发布 14 个版本,其中过去 12 个月发布了 2 个;首次发布于 2023/10/20。作者已将其标记为弃用,新项目建议寻找替代方案。