Skip to content

Instantly share code, notes, and snippets.

View shnhrtkyk's full-sized avatar
🏠
Working from home

teddy shnhrtkyk

🏠
Working from home
View GitHub Profile
@shnhrtkyk
shnhrtkyk / txt2las.sh
Created December 27, 2019 19:41
macでtxt2las 一括
for file in `\find . -name '*.txt'`; do
echo $file
tonnage=${file##*/}
echo ${tonnage/.txt/.las}
/path/to/LAStools-master/bin/txt2las -i $file -o ../train_las/${tonnage/.txt/.las} -parse xyzc
done
for file in `\find . -name '*.txt'`; do
echo $file
echo ${file##*/}
cut -f1,2,3,4 -d";" $file > ../train_pointtxt/${file##*/}
cut -f5- -d";" $file > ../train_wavetxt/${file##*/}
done
#!/bin/sh
#$ -c#!/bin/sh
#$ -cwd
#$ -l q_node=1
#$ -l h_rt=24:00:00
. /etc/profile.d/modules.sh
gridopt = gdal.GridOptions(format='GTiff', algorithm='linear', width=1000,
height=1000)
dtm_data = gdal.Grid('tmp_point.tif', 'tmp_point.vrt', options=gridopt)
@shnhrtkyk
shnhrtkyk / json2gt.py
Created October 4, 2019 21:21
loop file list
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 3 10:46:28 2019
@author: shino
"""
from shapely import wkt
import json
@shnhrtkyk
shnhrtkyk / json2jpg.py
Last active October 4, 2019 12:10
Convert polygons to raster image
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 3 10:46:28 2019
@author: shino
"""
from shapely import wkt
import json
@shnhrtkyk
shnhrtkyk / change_maxsize_pillow.py
Created September 8, 2019 22:25
Pillowの最大サイズ変更
Image.MAX_IMAGE_PIXELS=10000000000
@shnhrtkyk
shnhrtkyk / point2raster.bat
Created July 16, 2019 06:18
irregularなx, yデータからラスター形式に変換する
¥path¥to¥lasgrid.exe -i input.txt -o output.tif -elevation_hightest
¥path¥to¥lasgrid.exe -i input.txt -o output.tif -elevation_lowest
@shnhrtkyk
shnhrtkyk / diff.bat
Created July 12, 2019 07:52
2つのlas形式やtxt形式の点群データを比較する
/path/to/lastools/lasdiff.exe -i input1.las -i linput2.las -o output.las
@shnhrtkyk
shnhrtkyk / las2txt.bat
Created July 9, 2019 05:15
las形式のx, y, z, 強度,リターンナンバー,クラスの情報をtxtに変換
@echo off
for %%a in (G:\path\to\*.las) do (
call :sub "%%a"
)
goto :EOF
:sub