Skip to content

Instantly share code, notes, and snippets.

View handygeospatial's full-sized avatar

Hidenori FUJIMURA handygeospatial

View GitHub Profile
A WMTS enabled server application can serve map tiles of spatially referenced data using tile images with predefined context, extent, and resolution.
@handygeospatial
handygeospatial / file0.txt
Created May 6, 2015 20:57
Shapefile を tippecanoe でベクトルタイル変換して tessera 経由でブラウザ確認するまで ref: http://qiita.com/handygeospatial/items/eda4c6305d6d042c8178
$ ruby togeojson.rb | gzip -9 > some.geojson.gz
$ npm find tilelive
NAME DESCRIPTION
cdbtiles cdbtiles is a tilelive backend plug-in for CouchDB
mbtiles Utilities and tilelive integration for the MBTiles forma
mongotiles mongotiles is a tilelive backend plug-in for MongoDB Gri
tessera A tilelive-based tile server
tilelive API for various map tile backends
tilelive-blend A tilelive provider that blends.
tilelive-bridge Datasource => vector tiles bridge backend for tilelive
tilelive-cache A caching wrapper for tilelive.js
@handygeospatial
handygeospatial / keywords.txt
Created March 1, 2015 20:09
1月29日現在の地理院地図パートナーリストから手動で取り出したキーワード
ハザード
観光
空き家
地質
地盤
防災
データ生産
浸水想定
経路探索
配車
@handygeospatial
handygeospatial / file0.rb
Last active August 29, 2015 14:16
SizedQueue を使った無駄撃ちのない地理院タイルダウンローダ(Ruby) ref: http://qiita.com/handygeospatial/items/5baaf9d0ae1c817420bd
require 'open-uri'
require 'digest/md5'
require 'fileutils'
require 'zlib'
require 'thread'
Z_EXTENT = (18..18)
T = 'std'
N_THREADS = 8
Q_SIZE = 200
{"story": [
{
"type": "Feature",
"geometry" {
"type": "Point",
"coordinate" : [...]
},
"html": "...",
"viewport": ...
},
@handygeospatial
handygeospatial / file0.txt
Created January 14, 2015 20:56
GeoJSONタイルのフォーマットの違い(TileLayer.GeoJSON vs Tangram) ref: http://qiita.com/handygeospatial/items/cc0cf63b13e2857c56ee
/**
Mapzen/OSM.US-style GeoJSON vector tiles
@class GeoJSONTileSource
*/
export class GeoJSONTileSource extends NetworkTileSource {
constructor (source) {
super(source);
this.type = 'GeoJSONTileSource';
}
@handygeospatial
handygeospatial / file0.rb
Last active August 29, 2015 14:12
elevation_of を使って 3D GeoJSON を作成するスクリプト ref: http://qiita.com/handygeospatial/items/aa9175bd3014acc84209
require 'json'
require './elevation_of.rb'
data = JSON.parse(File.open('kyogatake.geojson').read)
a = data['features'][0]['geometry']['coordinates']
a.each_index {|i|
a[i] << elevation_of(a[i][0], a[i][1])
}
@handygeospatial
handygeospatial / file0.rb
Created December 1, 2014 17:22
タイルの説明によく使う図(地理院タイル版) ref: http://qiita.com/handygeospatial/items/adbb7a15e3553fab5bd2
for z in 0..2
for x in 0...(2 ** z)
for y in 0...(2 ** z)
next if File.exist?("#{z}_#{x}_#{y}.png")
`wget -O #{z}_#{x}_#{y}.png http://cyberjapandata.gsi.go.jp/xyz/std/#{z}/#{x}/#{y}.png`
end
end
end
for z in 0..2
@handygeospatial
handygeospatial / file0.html
Created September 18, 2014 19:52
基盤地図情報(数値標高モデル)(5mメッシュ(標高))のGeoJSONタイルのビューア ref: http://qiita.com/handygeospatial/items/5b410fae527eaf463abd
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title></title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css"/>
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
<script src="http://handygeospatial.github.io/mapsites/js/leaflet-hash.js"></script>
<script src="http://handygeospatial.github.io/mapsites/js/TileLayer.GeoJSON.js"></script>