Skip to content

Instantly share code, notes, and snippets.

View KMR-zoar's full-sized avatar

Zoar KMR-zoar

  • Kawagoe, Japan
View GitHub Profile
[param]
east = "137.500,20.455,153.987,45.558"
center = "129.587,20.455,137.945,37.910"
west = "122.933,20.455,129.815,34.780"
[osm]
api = "https://www.openstreetmap.org/history/feed"
[rgeocode]
api = 'http://www.finds.jp/ws/rgeocode.php'
let
filePath = "?????.geojson",
source = Json.Document(File.Contents(filePath)),
converted2Table = Record.ToTable(source),
features = converted2Table{5}[Value],
fearure2table = Table.FromList(
features, Splitter.SplitByNothing(), null, null, ExtraValues.Error
),
expandedColumn1 = Table.ExpandRecordColumn(
fearure2table, "Column1", {
@KMR-zoar
KMR-zoar / app.js
Last active March 1, 2019 06:32
Remove layers added by ol-geocoder seach
function remove_search_marker() {
var remove_layer_name = 'geocoder-layer';
var layers_to_remove = [];
map.getLayers().forEach(function(layer) {
var layer_name = layer.getProperties().name;
if (layer_name && layer_name.match(remove_layer_name)) {
layers_to_remove.push(layer);
}
});
@KMR-zoar
KMR-zoar / law.js
Created March 28, 2019 08:20
simpleMatch for Brackets
import CodeMirror from 'codemirror'
CodeMirror.defineMode('law', () => {
return {
token: (stream, state) => {
const inBrackets = stream.match(/(.*?)/)
if (inBrackets) {
return 'keyword'
}
stream.next()
//Tasking Manager と PostgreSQL のコンテナを停止して待機状態のコンテナを削除します
$ docker-compose down
//PostgreSQL コンテナ用に保持されているデータを削除します
$ docker volume rm tasking-manager_pgdata
//Tasking Manager と PostgreSQL のコンテナを立ち上げます
$ docker-compose up -d
//Tasking Manager コンテナで bash を起動して標準入出力に接続します
@KMR-zoar
KMR-zoar / leafletGeoJsonTileLayer.js
Last active April 8, 2019 07:05
Leaflet で GeoJSON タイルを表示するためのシンプルな実装です。このスクリプトのオリジナルは pkorac 氏によって作成されました。
/*
# このスクリプトの元ネタはこちらです。
https://gist.github.com/pkorac/5287314
ご自身の責任でご利用ください。
- 普段通り地図画像タイルを設定します
- 'tileload' イベントから JSON をロードする関数を呼び出します
- タイルレイヤーに GeoJSON データを追加します
- ズーム完了時に一度タイルレイヤーをクリアすることで様々なズームレベルの GeoJSON タイルを利用できます
geo2topo ground.geojson -o ground.topojson
cd topo2osm/
npm i
node index.js ../ground.topojson > ../ground.osm
@KMR-zoar
KMR-zoar / colorStep.js
Last active April 12, 2019 08:15
指定された範囲を段階に分けて配列の要素を返す関数
const colorStep = (inputInt, maxInt, minInt, colorPalette) => {
const dLength = colorPalette.length - 1;
const isBetween = inputInt > maxInt || inputInt < minInt ? false : true;
if (isBetween) {
const d = maxInt - minInt;
const dInt = inputInt - minInt;
const colorIndex = Math.floor(dInt / (d / dLength));
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"lib": ["es2019"], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
"jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
@KMR-zoar
KMR-zoar / list.md
Last active May 17, 2019 03:55
所沢市CC-ZEROライセンスオープンデータ一覧

埼玉県オープンデータポータルより所沢市でCC-ZEROライセンスのデータを一覧化

データセット名 データ名 ジオメトリ
とことこマップ_くらし・手続き くらしに役立つ施設_20190228 ポイント
とことこマップ_くらし・手続き ごみ・リサイクル_20190228 ポイント
とことこマップ_くらし・手続き 上下水道_20190228 ポイント
とことこマップ_くらし・手続き 区画整理_20190228 ポイント
とことこマップ_くらし・手続き 市営住宅_20190228 ポイント
とことこマップ_くらし・手続き 市役所・まちづくりセンター等_20190228 ポイント