Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hfu committed Nov 7, 2023
1 parent ab1bf88 commit b5a8720
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.zip
*.pmtiles
*.pmtiles-journal

5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
get:
curl -O https://catalog.registries.digital.go.jp/rsc/address/address_all.csv.zip
convert:
ruby generate.rb | tippecanoe -f -o a.pmtiles

5 changes: 5 additions & 0 deletions generate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,19 @@ def jump_into(stream)
elsif /pos/.match(entry.name.downcase)
first = true
keys = []
layer = ''
stream.each_line {|l|
l.force_encoding('utf-8')
if first
layer = entry.name.downcase.split('_pos_')[0].split('_')[-1]
keys = l.strip.split(',')
first = false
else
geojson = {
:type => 'Feature',
:tippecanoe => {
:layer => layer
}
}
geojson[:properties] = keys.zip(l.strip.split(',')).to_h
geojson[:geometry] = {
Expand Down

0 comments on commit b5a8720

Please sign in to comment.