Skip to content

Instantly share code, notes, and snippets.

View typebrook's full-sized avatar

Hsieh Chin Fan typebrook

View GitHub Profile
@typebrook
typebrook / .env.template
Last active October 31, 2023 07:01
Docker Compose for nginx and gitea
GITEA_DATA_DIR=/tmp/gitea
@typebrook
typebrook / Makefile
Last active February 4, 2023 02:52
Extract fields from county raw data #gis #gov #taiwan
kaohsiung.csv:
curl -Lo $@ https://data.kcg.gov.tw/dataset/7b142b2b-4d92-4a22-ac63-339c95bb0dfc/resource/d6e12411-8655-40ff-a2b2-ea3791c7c586/download/firehydrantonground.csv
taipei.csv:
curl -L https://data.taipei/api/getDatasetInfo/downloadResource\?id\=c106a00b-5a21-4393-b213-475a0ece9f2b\&rid\=b9f8154d-c627-48a8-b3ef-512ed9cde9e7 \
| iconv -f BIG-5 -t UTF-8 >$@
taoyuan_97.csv:
curl -Lo raw.json https://data.tycg.gov.tw/opendata/datalist/datasetMeta/download\?id\=3fd4a492-bcae-45be-8184-aa6fad506701\&rid\=ea487112-ef5b-481a-b49a-26f52dc04b93
echo 'FID,類別碼,識別碼,高程,x,y' >$@
@typebrook
typebrook / hike.geojson
Created May 17, 2021 01:42
六順七彩 in 2021.Feb #hike #osm
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@typebrook
typebrook / Makefile
Last active July 30, 2022 23:54
Remove elements from Mapbox Vector Tiles #protobuf #python #tilemaker #pbf #mvt
pbf:
curl -O https://typebrook.github.io/mapstew/tiles/13/6861/3507.pbf
diff:
curl -O https://download.openstreetmap.fr/replication/asia/minute/004/508/867.osc.gz
@typebrook
typebrook / DownloadProgressLiveData.kt
Created April 19, 2021 15:03 — forked from FhdAlotaibi/DownloadProgressLiveData.kt
Observe Download manager progress using LiveData and Coroutine #android #kotlin #livedata
data class DownloadItem(
val bytesDownloadedSoFar: Long = -1,
val totalSizeBytes: Long = -1,
val status: Int,
val uri: String
)
class DownloadProgressLiveData(private val activity: Activity) :
LiveData<List<DownloadItem>>(),
CoroutineScope {
@typebrook
typebrook / backup.encrypted
Created March 27, 2021 12:47
My backup SSH key #ssh #backup
U2FsdGVkX181R2xhLwRJruW+HBO9lZ9YlYXefHKznUVZcGr+EmOnnpkgCBlTIivC
5DFf+CPCx926tPtEYehrOilMyjcqJwZFepqxqgnpYcIq7KCNPjXqkEN3r/rMWIfw
2tpW8j74DHyrY3/qJLNp5MPwto6WUDLy4ApbaRsE4CN+H5otUKW8Dhbom6fP8yr7
thI4F8tPUum5sK8XNslvHVPNztZxF1BCX0hs7Yl63MLS4peCNidaLF+YhrbZpV1v
TuapIbaR1u5A2mWxcahrlPUN/px0+BM0HEl+AhoD0NKhgzbCxV89HC4qdOzYqoWG
JuBFyDxQNLiB55NxSWGJbts7BtNqSLZRAUWnh7tyMvWbUPbqnSTP504iF1Ds9aCO
AMYSK2je/IQZsm8s5q/KOo9VtRbs7Icm7uR/zBdUXLBWhSGoXkcpZUxfYnzkmXL5
Dl+1Q6q5WHZTgV++uiemBVBzWlFD2CQFj0XXEd3Ir0jabfYjQB7sg9J6SlNZUVtV
qVPRhzFNxP9bZL0Aqc2bklHEJvOlJC89xrM/Zkc5vEb+OLDfkw7qsekLcImwk7CS
JJpplU2B4P30YOTtA3c53G/3zHvv71QjmXXtWrmh51hwJYDmYqitBczSWnE4ac/i
@typebrook
typebrook / .gitignore
Last active June 27, 2022 06:12
匯入臺中市開放門牌資料 #osm #open_data #perl #awk #address #taichung #gov
*.bak
@typebrook
typebrook / Makefile
Last active February 28, 2021 16:07
Get highest peaks in each section of Taipower Coordinate System (8000m x 5000m) #mapstew #taipower
all: peaks.db
taiwan-latest.osm.pbf:
curl -O http://download.geofabrik.de/asia/$@
TEMP_FILE := temp.o5m
peaks.o5m: taiwan-latest.osm.pbf
osmconvert $< --drop-ways --drop-relations -o=$(TEMP_FILE)
osmfilter $(TEMP_FILE) --keep=natural=peak -o=$@
rm $(TEMP_FILE)
@typebrook
typebrook / Makefile
Last active July 30, 2022 23:55
Command to generate Cesium terrain tiles with ctb-tile #cesium #tile #makefile
# Check command ctb-tile at
# https://github.com/geo-data/cesium-terrain-builder
# https://github.com/tum-gis/cesium-terrain-builder-docker
,
.ONESHELL:
ZIP_URL = http://dtm.moi.gov.tw/不分幅_全台及澎湖.zip
DOCKER_IMAGE = "tumgis/ctb-quantized-mesh:latest"
data.zip:
@typebrook
typebrook / Makefile
Last active June 27, 2022 06:12
台電電桿座標 TWD67 -> WGS84 #taipower #crs #osm #import
.ONESHELL:
# Dataset: https://data.gov.tw/dataset/33305
DATASET_URL = http://data.taipower.com.tw/opendata/apply/file/d077006/台灣電力公司_電桿桿號及座標資料.zip
# Ref: https://gist.github.com/mutolisp/20b8d11888775932ab7188769e9e8f9d
PROJ_PARAMS_TWD67 = "+proj=tmerc +lat_0=0 +lon_0=121 +k=0.9999 +x_0=250000 +y_0=0 +ellps=aust_SA +towgs84=-750.739,-359.515,-180.510,0.00003863,0.00001721,0.00000197,0.99998180 +units=m +no_defs"
# The raw dataset from Taipower company
dataset.zip: