Skip to content

Instantly share code, notes, and snippets.

View typebrook's full-sized avatar
💭
Adapting new job

Hsieh Chin Fan typebrook

💭
Adapting new job
View GitHub Profile
@typebrook
typebrook / README.md
Last active November 21, 2020 03:59
quick script for 黃超群 #script #rescue #jq

轉換 NetMonster 資料

產製GeoJSON

  1. 下載本頁面下方的ntm2geojson.exe(點選Raw按鈕)
  2. 將JSON格式檔案和exe檔案放在同一資料夾
  3. 點兩下exe檔案,產生出新的.geojson檔案

檢視地圖

可至下列網站點選open,將GeoJSON格式檔案上傳,以在地圖中檢視
http://geojson.io

@typebrook
typebrook / index.html
Last active July 27, 2020 02:19
大屯九連峰 #hike #gpx #磐石
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Display a map</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<script src="https://api.mapbox.com/mapbox-gl-js/v1.11.1/mapbox-gl.js"></script>
<link href="https://api.mapbox.com/mapbox-gl-js/v1.11.1/mapbox-gl.css" rel="stylesheet" />
<style>
body { margin: 0; padding: 0; }
@typebrook
typebrook / Makefile
Last active July 30, 2022 23:58
sprite for rudymap #rudymap #sprite #mapbox #icon
.ONESHELL:
all: sprite
clean:
rm *.svg *.json *.png 2>/dev/null
svg:
while read svg _ _ url; do
curl $$url | sed '/stroke="#000000"/d' >$$svg
@typebrook
typebrook / google.html
Last active August 3, 2020 06:05
Examples for My talk in Coscup 2020 #coscup2020 #map
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>OpenStreetMap with Google Maps v3 API</title>
<style type="text/css">
html, body, #map {
height: 100%;
@typebrook
typebrook / Makefile
Last active July 30, 2022 23:58
Update OSM villages with wikidata #osm #wikidata #village #script
all: final.osc
clean:
rm *.list *.osm *.osc
# P31=屬於 Q7930614=中華民國村里 P5020=中華民國戶政資料代碼
define quest
SELECT DISTINCT ?village ?ref
WHERE {
?village wdt:P31 wd:Q7930614.
@typebrook
typebrook / Makefile
Last active June 11, 2022 04:57
Add OSM ID into Wikidata #wikidata #osm #script #wip
clean:
rm *.list *.osm *.osc
# P31=屬於 Q7930614=中華民國村里 P5020=中華民國戶政資料代碼
define quest
SELECT DISTINCT ?village ?villageLabel
WHERE {
?village wdt:P31 wd:Q7930614.
MINUS { ?village wdt:402 [] } .
SERVICE wikibase:label { bd:serviceParam wikibase:language "zh" }
@typebrook
typebrook / README.md
Last active February 25, 2023 11:32
A simple script to upload OsmChange file #osm #changeset #script

Upload OsmChange file with script

Usage

# By default, changeset would be uploaded to test server: 
# https://master.apis.dev.openstreetmap.org
./osm.api.changeset.commit <OSC FILE>

# Use --serious to upload changeset to normal OSM server
./osm.api.changeset.commit --serious <OSC FILE>
@typebrook
typebrook / Makefile
Last active June 11, 2022 04:56
更新林務局通訊點資訊 #osm #tagging #rudymap #mobile
.ONESHELL:
all: changes.osc
clean:
rm *.osm *.osc
OVERPASS_API := https://overpass.nchc.org.tw/api/interpreter
TAIWAN_BBOX := 20.72799,118.1036,26.60305,122.9312
@typebrook
typebrook / Makefile
Last active March 10, 2021 07:15
Remove changeset from cmi3j89d9o #osm #editor
all: final.osc
clean:
rm *.list *.osm *.osc
#OVERPASS_API := https://overpass-api.de/api/interpreter
OVERPASS_API := https://overpass.nchc.org.tw/api/interpreter
TAIWAN_BBOX := 20.72799,118.1036,26.60305,122.9312
USER := cmi3j89d9o
@typebrook
typebrook / arcgis.html
Last active September 29, 2020 12:32 — forked from JoeThunyathep/index.html
Index file for Cesium NYC application #cesium #3d #arcgis #nlsc #citygml
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<title>Intro to SceneLayer | Sample | ArcGIS API for JavaScript 4.16</title>
<style>