Skip to content

Instantly share code, notes, and snippets.

Avatar

Satoshi IIDA nyampire

View GitHub Profile
@nyampire
nyampire / contain_place_municipality
Created Aug 21, 2019
区域内にplace=quarter, neighbourhood or hamletを含む自治体と含まない自治体の一覧
View contain_place_municipality
Prefecture,Sub-Pref,Municipality-Large,Municipality-Small
千葉県,,,所属未定地
東京都,,,所属未定地
愛知県,,,所属未定地
和歌山県,,,所属未定地
福岡県,,,所属未定地
鹿児島県,,,所属未定地
沖縄県,,,所属未定地
北海道,石狩振興局,札幌市,中央区
北海道,石狩振興局,札幌市,北区
View fude-trans.py
# -*- 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 Jul 21, 2018
1/25000精度の地域を含む自治体の一覧、暫定版
View contain25000
N03_001,N03_002,N03_003,N03_004,N03_007
北海道,石狩振興局,札幌市,南区,01106
北海道,渡島総合振興局,,函館市,01202
北海道,後志総合振興局,,小樽市,01203
北海道,上川総合振興局,,旭川市,01204
北海道,胆振総合振興局,,室蘭市,01205
北海道,釧路総合振興局,,釧路市,01206
北海道,十勝総合振興局,,帯広市,01207
北海道,オホーツク総合振興局,,北見市,01208
北海道,空知総合振興局,,夕張市,01209
View index.html
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>
View a-web-maps-101.md

#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)
View style
# 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
View Municipality Structure Japan 2014-05-11 CSV
地方,都道府県,地方(北海道,振興局,郡,市町村 (東京23区),区
region,province/prefecture,-,subprovince,district,city/town/village,suburb
北海道,北海道,道北,宗谷総合振興局,-,稚内市,-
北海道,北海道,道北,宗谷総合振興局,枝幸郡,枝幸町,-
北海道,北海道,道北,宗谷総合振興局,枝幸郡,中頓別町,-
北海道,北海道,道北,宗谷総合振興局,枝幸郡,浜頓別町,-
北海道,北海道,道北,宗谷総合振興局,宗谷郡,猿払村,-
北海道,北海道,道北,宗谷総合振興局,天塩郡,豊富町,-
北海道,北海道,道北,宗谷総合振興局,天塩郡,幌延町,-
北海道,北海道,道北,宗谷総合振興局,利尻郡,利尻町,-
View gist:9017607
$ 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
^
View finds.tsv
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 10 columns, instead of 3. in line 9.
#title credit serviceUrl yOriginTop zmin zmax xmin ymin xmax ymax
基盤地図25000_ANF 国土地理院 http://www.finds.jp/ws/tmc/1.0.0/KBN25000ANF-900913-L/{z}/{x}/{y}.png 1 0 18 122 22 149 46
基盤地図25000_BBB 国土地理院 http://www.finds.jp/ws/tmc/1.0.0/KBN25000BBB-900913-L/{z}/{x}/{y}.png 1 0 18 122 22 149 46
基盤地図25000_等高線 国土地理院 http://www.finds.jp/ws/tmc/1.0.0/KBN25000CNB-900913-L/{z}/{x}/{y}.png 1 14 18 122 22 149 46
基盤地図2500 国土地理院 http://www.finds.jp/ws/tmc/1.0.0/KBN2500FN-900913-L/{z}/{x}/{y}.png 1 15 20 122 22 149 46
基盤地図2500の場所 国土地理院 http://www.finds.jp/ws/tmc/1.0.0/KBN2500M-900913-L/{z}/{x}/{y}.png 1 0 14 122 22 149 46
地名 国土交通省 http://www.finds.jp/ws/tmc/1.0.0/pntms-900913-L/{z}/{x}/{y}.png 1 0 17 122 22 149 46
迅速測図東京 国土地理院 http://www.finds.jp/ws/tmc/1.0.0/Tokyo5000-900913-L/{z}/{x}/{y}.png 1 0 17 139.7141327 35.6497387 139.7990809 35.7188234
迅速測図関東 国土地理院 http://www.finds.jp/ws/tmc/1.0.0/Kanto_Rapid-900913-L/{z}/{x}/{y}.png 1 0 18 138.9231137 34.8555318 140.8804024 36.4651697
2万分の1正式図福山 国土地理院 http://www.finds.jp/ws/tmc/1.0.0
@nyampire
nyampire / chiriin_jinsoku.html
Created Jan 12, 2014
Mapbox.jsを使って、地理院地図と迅速測図(農研機構)をスワイプさせる
View chiriin_jinsoku.html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Swipe Layers</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.6.0/mapbox.js'></script>
You can’t perform that action at this time.