eyecatch

KSJ Browser: Add National Land Numerical Information to QGIS

Published: Last updated:
This article uses QGIS 3.44.

What you'll learn


  • How to use the KSJ Browser plugin
  • How to get National Land Numerical Information data efficiently in QGIS

Recommended for


  • Anyone who often uses National Land Numerical Information data
  • Anyone who finds downloading, unzipping ZIP files, and fixing garbled text tedious
  • Anyone who wants to quickly overlay only the data for the area they need

Introduction

National Land Numerical Information is open data that provides a wide range of GIS data about Japan, such as administrative boundaries, land use, and disaster risk. To use it in QGIS, you usually find the data on the download site, download a ZIP file, unzip it, and then add it to QGIS.

When you want to use many datasets, though, you go back and forth between your web browser and QGIS for each one, downloading and unzipping again and again. The downloaded ZIP files and unzipped folders keep piling up, so keeping track of which file holds which data and sorting out the ones you no longer need also takes effort.

This article shows how to use KSJ Browser, a plugin that lets you find National Land Numerical Information data without leaving QGIS and add it straight to your map. You can download only the files you need from a ZIP. You can also set it up so that, for data you add just to check, removing the layer automatically deletes the downloaded files. Both cut down the work of managing files.

For more about National Land Numerical Information, see the following article.

What is KSJ Browser?

KSJ Browser is a plugin that lets you find data from the National Land Numerical Information Download Service in the QGIS Browser panel and add it to your map.

The data is organized in the same categories as the download site, so you can find what you need the same way you would on the site. You can get data from past years as well as the latest.

Its main features are:

  • Find and add data inside QGIS: double-click data in the Browser panel to add it to your map, without opening the download site
  • Download only the files you need: check what is inside a ZIP before downloading, and get only the files you use
  • Add as a temporary layer: when you remove the layer, the downloaded files are deleted automatically
  • Less garbled text: sets up loading automatically so Japanese text in the attributes does not get garbled
  • Pick a mesh on the map: get data distributed by mesh while checking its extent on the map

KSJ Browser works with QGIS 3.44 and later, and also supports QGIS 4.

Install KSJ Browser

You can install KSJ Browser from the Plugin Manager. From the menu bar, choose Plugins → Manage and Install Plugins, enter KSJ Browser in the search field, and click Install Plugin.

Search for KSJ Browser in the Plugin Manager
Search for KSJ Browser in the Plugin Manager

For details on installing QGIS plugins, see the following article.

Once the installation finishes, National Land Numerical Information (国土数値情報) appears in the Browser panel. If the Browser panel is not visible, choose View → Panels → Browser from the menu bar.

National Land Numerical Information appears in the Browser panel
National Land Numerical Information appears in the Browser panel

Add data from the Browser panel

In QGIS, the basic way to add data is to double-click a file in the Browser panel or drag and drop it onto the map canvas. With KSJ Browser, you can add National Land Numerical Information data to your map the same way you add local files. This section walks through finding data and adding it to the map, using the administrative area data for Hokkaido as an example.

For tips on using the Browser panel, see the following article.

Find data

Expand National Land Numerical Information to see the same categories as the download site, such as administrative regions, land use, disasters and disaster prevention, and transportation. Expand them in the order category → dataset → year → region to find the data you want.

Here, expand Administrative Regions (行政地域) → Administrative Area (Polygon) (行政区域(ポリゴン)) → 2026 (2026年) → Hokkaido (北海道). Years are listed newest first, so you can find data from past years the same way.

Expand the category, dataset, year, and region in order
Expand the category, dataset, year, and region in order

Check what is inside the ZIP

Under the region, the ZIP files distributed on the download site appear. Expand a ZIP file to see the list of files inside it before you download anything.

At this point, no data has been downloaded yet. Even for large datasets, you can check the file structure before downloading.

National Land Numerical Information ZIP files sometimes contain the same data in several formats, such as Shapefile (.shp), GeoJSON (.geojson), and GML (.xml, a format that describes geographic data in XML). If you are not sure which one to use, choose the Shapefile. Each file type has its own icon, which helps you tell them apart.

Expand the ZIP file to check its contents
Expand the ZIP file to check its contents

Add only the files you need

Double-click the file you want to add, or drag and drop it onto the map canvas. Here, double-click the Shapefile (.shp).

The first time you add data, the Loading Method and Save Location (国土数値情報の追加方法・保存先) dialog opens. Select Add as Temporary Layer (一時レイヤーとして追加) and continue. The difference between the loading methods is explained later in “Add as a temporary layer.”

The Loading Method and Save Location dialog
The Loading Method and Save Location dialog

While the data is downloading, a spinning icon and 読み込み中… (Loading…) appear on the file's row. When the download finishes, the administrative area data is added to the map.

Administrative area data for Hokkaido added to the map (Created by processing “National Land Numerical Information (Administrative Area Data)” (Ministry of Land, Infrastructure, Transport and Tourism))
Administrative area data for Hokkaido added to the map (Created by processing “National Land Numerical Information (Administrative Area Data)” (Ministry of Land, Infrastructure, Transport and Tourism))

A Shapefile is made up of several files, such as .dbf and .prj in addition to .shp. Double-click the .shp, and KSJ Browser downloads all the files it needs together. Files you do not use, such as the GeoJSON in the same ZIP, are not downloaded.

For example, when you unzip the ZIP for the land use subdivision mesh around Sapporo, the Shapefile set is about 100 MB and the GeoJSON with the same content is about 210 MB. Because you download only the files you use, you save both download time and storage space.

You can also add a file to the map by right-clicking it and selecting Add Layer to Project.

Load data without garbled text

National Land Numerical Information Shapefiles use different encodings (the rules for storing characters as data) depending on the dataset and year. If the encoding QGIS uses to read a file does not match, Japanese text in the attribute table becomes garbled.

KSJ Browser detects the encoding automatically and sets it when you add data. So Japanese text in the attribute table displays correctly without you having to think about encodings.

Japanese text displays correctly in the attribute table (Created by processing “National Land Numerical Information (Administrative Area Data)” (Ministry of Land, Infrastructure, Transport and Tourism))
Japanese text displays correctly in the attribute table (Created by processing “National Land Numerical Information (Administrative Area Data)” (Ministry of Land, Infrastructure, Transport and Tourism))

In rare cases, the detection is wrong and the text is garbled. If that happens, change the encoding in Layer Properties.

Check the data description and terms of use

Right-click a dataset and select Open Official Description, Attribute Definitions, and Terms of Use (公式の説明・属性定義・利用条件を開く) to open its description page on the download site. This is useful when you want to check what attribute names mean or look up the code lists for attribute values.

Open the official description page from the context menu
Open the official description page from the context menu

In National Land Numerical Information, the terms of use, including whether commercial use is allowed, differ by dataset and year. Right-click a ZIP file and select Open Official Description and Terms of Use for This Version (この版の公式説明・利用条件を開く) to check the terms for that year's data. Always check them before you use the data.

Add as a temporary layer

Set the loading method

The current loading method appears at the top of National Land Numerical Information in the Browser panel. To change it, double-click this item, or right-click National Land Numerical Information and select Set Loading Method and Save Location (追加方法・保存先を設定…). Once you set it, data is added the same way from then on.

The current loading method appears at the top of the Browser panel
The current loading method appears at the top of the Browser panel

You can choose from two loading methods:

  • Save to Folder and Add (フォルダに保存して追加): saves the downloaded files to a folder you specify. Suited to data you use repeatedly
  • Add as Temporary Layer: saves the downloaded files to a temporary folder. When you remove all the layers that read those files, the files are deleted automatically

While you are looking for data, you often just display downloaded data on the map to check its extent or attributes. Deleting the downloaded files by hand each time is tedious, but if you add the data as a temporary layer, removing the layer from the Layers panel automatically deletes the downloaded files.

Saving the project does not keep data added as a temporary layer. Export any data you want to keep to a file.

For how to export a layer to a file, see the following article.

Use with Kumoy

Temporary layers also work well with Kumoy, a cloud service for sharing maps and data made in QGIS on the web. Data you upload to Kumoy is managed in the cloud, so you do not need to keep the files you downloaded for the upload on your computer.

Add National Land Numerical Information data as a temporary layer, check it on the map, and then upload it to Kumoy. After the upload, remove the original temporary layer, and the downloaded files are deleted too. You can go from getting data to sharing it in the cloud without managing local files.

For how to upload to Kumoy, see the following article.

Add data by clicking a mesh on the map

Some National Land Numerical Information data, such as the land use subdivision mesh, divides all of Japan into squares (meshes) about 80 km on a side and is distributed mesh by mesh. Each mesh has a number, and to get the data from the download site, you need to look up the mesh number for the place you want in advance.

KSJ Browser adds a layer that shows the extent and number of each mesh (the mesh index) to the map. Just click a mesh to get its data.

This section uses the land use subdivision mesh around Sapporo as an example. Displaying a basemap makes it easier to see where each mesh is. For how to add a basemap, see the following article.

  1. Expand Land Use (土地利用) → Land Use Subdivision Mesh (土地利用細分メッシュ) → 2021 (2021年), and double-click Add Mesh Index to Map (メッシュ索引を地図に追加) at the top.
Double-click Add Mesh Index to Map at the top of the year
Double-click Add Mesh Index to Map at the top of the year
  1. The outlines and numbers of the distributed meshes appear on the map, and the tool switches to Run Feature Action. Overlay the meshes on the basemap to find the one that covers the area you want, and click inside it. If the same mesh has several files, the Select Distribution File to Add (追加する配布ファイルを選択) dialog opens. If files in both the world geodetic system (世界測地系) and the Tokyo Datum (日本測地系), two geodetic datums (references for expressing positions), are listed, choose the world geodetic system file unless you have a reason not to.

  2. In the Select Layers to Add (追加するレイヤーを選択) dialog, check the layers you want to add and click Add Selected Layers (選択したレイヤーを追加). If the same data is listed in several formats, choose the Shapefile (.shp).

The Select Layers to Add dialog
The Select Layers to Add dialog

The land use subdivision mesh data for the selected mesh is added to the map. Click another mesh to add the data for the neighboring mesh as well.

Land use subdivision mesh data added for the clicked mesh (GSI Tiles in the background; created by processing “National Land Numerical Information (Land Use Subdivision Mesh Data)” (Ministry of Land, Infrastructure, Transport and Tourism))
Land use subdivision mesh data added for the clicked mesh (GSI Tiles in the background; created by processing “National Land Numerical Information (Land Use Subdivision Mesh Data)” (Ministry of Land, Infrastructure, Transport and Tourism))

Because you can overlay the area you want on the mesh extents, you can get exactly the meshes you need, even where the area crosses mesh boundaries.

If you switch to another tool to pan or zoom the map, select the mesh index layer in the Layers panel, click Run Feature Action on the toolbar, and then click a mesh.

Click Run Feature Action on the toolbar
Click Run Feature Action on the toolbar

Conclusion

This article introduced KSJ Browser, a plugin that lets you find National Land Numerical Information data in the QGIS Browser panel and add it to your map.

Finding data on the download site, unzipping the ZIP, and adding the data to QGIS can all be done inside the Browser panel. You can download only the files you need from a ZIP, and if you add data as a temporary layer, the downloaded files do not stay on your computer. Settings that prevent garbled text are applied automatically, and you can get data by clicking a mesh on the map, so National Land Numerical Information becomes easier to use.

If you often use National Land Numerical Information data, give KSJ Browser a try.

Data sources

About the author
QGIS LAB Editorial Team
QGIS LAB Editorial Team

QGIS LAB is a comprehensive information hub for QGIS, the open-source GIS software. Under the concept of “Geospatial for Greater Good,” we share the knowledge and skills to open up the world through location data.