Skip to content

Instantly share code, notes, and snippets.

View nyampire's full-sized avatar

Satoshi IIDA nyampire

  • OpenSteetMap Foundation Japan
  • Yokohama, Japan
View GitHub Profile
@nyampire
nyampire / gist:c5ae2fd8d4a86001448923dde84c2382
Created December 24, 2022 23:12
オープンデータ航空写真のタイル化メモ
# unzipして、orthoディレクトリをつくる
unzip ./'*.zip'
mkdir ortho
# mvで、tifとtfwをortho配下に移動
find . -type f -name "*.tf*" -exec mv {} ./ortho \;
find . -type f -name "*.tif" -exec mv {} ./ortho \;
cd ./ortho
@nyampire
nyampire / gist:af991b92252254822d752c34777374f6
Last active October 1, 2023 06:36
OSMの対象地域のユーザ一覧を抽出する:簡易版
# Geofabrikから、Chubu地域のpbf(ina.osm chubu-latest-internal.osm.pbf)をダウンロードする
# JOSMで伊那市のバウンダリをダウンロードして、ina.osmとして保存
# 伊那市の部分だけを抽出
osmium extract -p ina.osm chubu-latest-internal.osm.pbf -o ina2016.osm.pbf
# 2016年から、2022年4月4日までのデータを抽出して、"ina-new2016.osm"として保存
osmium time-filter ina2016.osm.pbf -f osm 2016-01-01T00:00:00Z 2022-04-01T00:00:00Z -o ina-new2016.osm
# buildingタグをもったウェイを抽出
osmium tags-filter ina-new2016.osm w/building -O -o ina-building-2016.osm
@nyampire
nyampire / contain_place_municipality
Created August 21, 2019 03:08
区域内にplace=quarter, neighbourhood or hamletを含む自治体と含まない自治体の一覧
Prefecture,Sub-Pref,Municipality-Large,Municipality-Small
千葉県,,,所属未定地
東京都,,,所属未定地
愛知県,,,所属未定地
和歌山県,,,所属未定地
福岡県,,,所属未定地
鹿児島県,,,所属未定地
沖縄県,,,所属未定地
北海道,石狩振興局,札幌市,中央区
北海道,石狩振興局,札幌市,北区
# -*- coding: utf-8 -*-
def filterTags(attrs):
if not attrs:
return
tags = {}
# 基本のタグ付け
# 県とか郡とかの is_inを付与。
if attrs['FUDE']:
tags.update({'ref:JP_fude':attrs['FUDE']})
@nyampire
nyampire / contain25000
Created July 21, 2018 08:23
1/25000精度の地域を含む自治体の一覧、暫定版
N03_001,N03_002,N03_003,N03_004,N03_007
北海道,石狩振興局,札幌市,南区,01106
北海道,渡島総合振興局,,函館市,01202
北海道,後志総合振興局,,小樽市,01203
北海道,上川総合振興局,,旭川市,01204
北海道,胆振総合振興局,,室蘭市,01205
北海道,釧路総合振興局,,釧路市,01206
北海道,十勝総合振興局,,帯広市,01207
北海道,オホーツク総合振興局,,北見市,01208
北海道,空知総合振興局,,夕張市,01209
This file has been truncated, but you can view the full file.
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=shift_jis">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 15">
@nyampire
nyampire / a-web-maps-101.md
Created November 29, 2016 01:47 — forked from mgiraldo/a-web-maps-101.md
A web maps primer

#A web maps primer

I was invited to the National Library of Colombia's 2nd Digital Book Week as a speaker and to give a workshop on digital mapping tools. I thought it would be useful to share that workshop since it encompasses a lot of different processes and tools that make digital cartography today very accessible. It is a primer on working with various free web mapping tools so you can make your own awesome maps.

##TL;DR You will make [this][result]. This tutorial assumes you have a digitized map and some data you want to overlay on it. The general steps covered are:

  1. geo-referencing the scanned map so that web tiles can be generated
  2. generating GeoJSON data to be overlaid
  3. creating a custom base map (to serve as reference/present day)
# This is the default osm2pgsql .style file that comes with osm2pgsql.
#
# A .style file has 4 columns that define how OSM objects end up in tables in
# the database and what columns are created. It interacts with the command-line
# hstore options.
#
# Columns
# =======
#
# OsmType: This is either "node", "way" or "node,way" and indicates if this tag
地方,都道府県,地方(北海道,振興局,郡,市町村 (東京23区),区
region,province/prefecture,-,subprovince,district,city/town/village,suburb
北海道,北海道,道北,宗谷総合振興局,-,稚内市,-
北海道,北海道,道北,宗谷総合振興局,枝幸郡,枝幸町,-
北海道,北海道,道北,宗谷総合振興局,枝幸郡,中頓別町,-
北海道,北海道,道北,宗谷総合振興局,枝幸郡,浜頓別町,-
北海道,北海道,道北,宗谷総合振興局,宗谷郡,猿払村,-
北海道,北海道,道北,宗谷総合振興局,天塩郡,豊富町,-
北海道,北海道,道北,宗谷総合振興局,天塩郡,幌延町,-
北海道,北海道,道北,宗谷総合振興局,利尻郡,利尻町,-
@nyampire
nyampire / gist:9017607
Created February 15, 2014 10:51
map.rb error
$ ruby ./map.rb 14
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': /Library/Ruby/Gems/1.8/gems/georuby-2.2.1/lib/geo_ruby/simple_features/point.rb:289: odd number list for Hash (SyntaxError)
human_representation(options, { x: x }).join
^
/Library/Ruby/Gems/1.8/gems/georuby-2.2.1/lib/geo_ruby/simple_features/point.rb:289: syntax error, unexpected ':', expecting '}'
human_representation(options, { x: x }).join
^
/Library/Ruby/Gems/1.8/gems/georuby-2.2.1/lib/geo_ruby/simple_features/point.rb:295: odd number list for Hash
human_representation(options, { y: y }).join
^