Skip to content

Commit

Permalink
Add some documentation. Add a Makefile.
Browse files Browse the repository at this point in the history
Add a README.md. Add a generate.rb script.
  • Loading branch information
hfu committed Nov 19, 2023
1 parent 34f35d5 commit 83df324
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ get:
convert:
ruby generate.rb | tippecanoe -f -o a.pmtiles --minimum-zoom=3 --maximum-zoom=14 --base-zoom=14 \
-r2.0 --drop-densest-as-needed

14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ address_all (Address Base Registry from Digital Agency of Japan) in vector tiles

![social preview image](https://user-images.githubusercontent.com/18297/280753506-253f479f-b191-42e6-b1d4-3ff7c5fc4ed6.jpg)

# Source data
[全アドレスデータ from デジタル庁 レジストリカタログ](https://catalog.registries.digital.go.jp/rc/dataset/ba000001/resource/b535cd16-b477-4e5d-81c8-1eb116c97b2f)
## Introduction
This repository contains the address_all dataset, which is the Address Base Registry from the Digital Agency of Japan. The dataset is provided in vector tiles format.

# About social preview image
It is [Watercolor portrait of Ada King, Countess of Lovelace (Ada Lovelace)](https://ja.wikipedia.org/wiki/%E3%82%A8%E3%82%A4%E3%83%80%E3%83%BB%E3%83%A9%E3%83%96%E3%83%AC%E3%82%B9#/media/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB:Ada_Lovelace_portrait.jpg) (pubic domain)
## Usage
To use this dataset, you can download the vector tiles from the provided link and integrate them into your mapping application. The dataset includes detailed address information for locations in Japan.

## Source Data
The source data for this dataset can be found at [全アドレスデータ from デジタル庁 レジストリカタログ](https://catalog.registries.digital.go.jp/rc/dataset/ba000001/resource/b535cd16-b477-4e5d-81c8-1eb116c97b2f). It is a comprehensive collection of address data maintained by the Digital Agency of Japan.

## Social Preview Image
The social preview image used for this repository is a watercolor portrait of Ada King, Countess of Lovelace (Ada Lovelace). The image is in the public domain and can be found [here](https://ja.wikipedia.org/wiki/%E3%82%A8%E3%82%A4%E3%83%80%E3%83%BB%E3%83%A9%E3%83%96%E3%83%AC%E3%82%B9#/media/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB:Ada_Lovelace_portrait.jpg).
8 changes: 8 additions & 0 deletions generate.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# This script reads a zip file containing CSV files and generates GeoJSON data for each "pos" file.
# It uses the 'zip', 'stringio', and 'json' libraries.
# The main function is 'jump_into', which recursively jumps into nested zip files and processes the "pos" files.
# The generated GeoJSON data is printed to the console.

require 'zip'
require 'stringio'
require 'json'

SRC_PATH = 'address_all.csv.zip'

# Recursively jumps into nested zip files and processes the "pos" files.
# @param [Zip::InputStream] stream - The input stream of the zip file
def jump_into(stream)
while entry = stream.get_next_entry
if /.zip$/.match(entry.name.downcase)
Expand Down Expand Up @@ -40,6 +47,7 @@ def jump_into(stream)
end
end

# Open the zip file and call the 'jump_into' function to process the files
Zip::InputStream.open(File.open(SRC_PATH)) {|stream|
jump_into(stream)
}

0 comments on commit 83df324

Please sign in to comment.