Skip to content

Instantly share code, notes, and snippets.

View IngIeoAndSpare's full-sized avatar
✈️
여행가고싶다

WI-Hyun-joong IngIeoAndSpare

✈️
여행가고싶다
  • korea
View GitHub Profile
@IngIeoAndSpare
IngIeoAndSpare / iris.csv
Created September 24, 2019 01:59 — forked from netj/iris.csv
sepal.length sepal.width petal.length petal.width variety
5.1 3.5 1.4 .2 Setosa
4.9 3 1.4 .2 Setosa
4.7 3.2 1.3 .2 Setosa
4.6 3.1 1.5 .2 Setosa
5 3.6 1.4 .2 Setosa
5.4 3.9 1.7 .4 Setosa
4.6 3.4 1.4 .3 Setosa
5 3.4 1.5 .2 Setosa
4.4 2.9 1.4 .2 Setosa
@IngIeoAndSpare
IngIeoAndSpare / DbConnectHandler.cs
Created September 26, 2019 00:38
Db connect sample gist
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ImageFileAnalysis.DTO;
namespace ImageFileAnalysis.Modules.DbModuel
{
class DbConnectHandler
@IngIeoAndSpare
IngIeoAndSpare / GetTestFile.py
Created December 5, 2019 08:36
file copyer
## file metadata module
import os.path
import shutil
from os import listdir
from os.path import isfile, join
BYNARY_FILE_PATH = 'E:\\map_tile_checker\\train_data'
TEST_FILE_PATH = 'E:\\map_tile_checker\\test_data'
LABEL_ARRAY = ['dispersion', 'line', 'square', 'unspecified_shapes']
@IngIeoAndSpare
IngIeoAndSpare / pngtosvg.py
Last active March 5, 2020 07:23
Batch Convert PNG to SVG (python 3.x)
import os
import base64
def main():
startSvgTag = """<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
@IngIeoAndSpare
IngIeoAndSpare / convertPng.py
Created April 2, 2020 07:08
background add alpha layer and convert png image
import cv2
def transBg(self, img):
tmp = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
_,alpha = cv2.threshold(tmp,0,255,cv2.THRESH_BINARY)
b, g, r = cv2.split(img)
rgba = [b,g,r, alpha]
dst = cv2.merge(rgba,4)
return dst
@IngIeoAndSpare
IngIeoAndSpare / coordinateUtil.cs
Created June 18, 2020 00:59
Tile coordinate convert code
private (double, double) convertWsg84Coordinate(double x, double y, double z)
{
double lat = Math.Asin(z / Math.Sqrt(x * x + y * y + z * z)) * (180 / Math.PI);
double lot = -Math.Atan2(y, x) * (180 / Math.PI);
return (lat, lot);
}
//wsg84 coordinate
public (string, string) calculateTileIdLatLot(double lat, double lot, int level)
{
@IngIeoAndSpare
IngIeoAndSpare / fileListGetter.cs
Last active August 3, 2020 10:20
example file list
using System.IO;
// list init for file info dto
List<TargetFileInfoDTO> fileInfoList = new List<TargetFileInfoDTO>();
// root file path (dds, jpg file root path)
string ROOT_FILE_PATH = @"FILE_PATH";
// search option dict
@IngIeoAndSpare
IngIeoAndSpare / reversGeoCoding.py
Created March 11, 2021 05:00
geocoding using VWorld
## url 접속을 위한 실습
import urllib
import json
import folium
geo_url_context = "http://api.vworld.kr/req/address?service=address&request=getcoord&version=2.0"
## url 주기
@IngIeoAndSpare
IngIeoAndSpare / drawLine.cs
Created March 30, 2021 08:14
DrawLineInUnity
public void drawTestLine(XDOInfo xdoInfo){
float radiusRatio = 10000 / (float)6378137;
// convert : -y , z, -x
double min_x = (double)xdoInfo.boundMinY * -1 * radiusRatio;
double min_y = (double)xdoInfo.boundMinZ * radiusRatio;
double min_z = (double)xdoInfo.boundMinX * -1 * radiusRatio;
double max_x = (double)xdoInfo.boundMaxY * -1 * radiusRatio;
double max_y = (double)xdoInfo.boundMaxZ * radiusRatio;
@IngIeoAndSpare
IngIeoAndSpare / koreanDisplay.py
Created April 15, 2021 05:06
colab 한글깨짐 방지
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.font_manager as fm
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
!apt -qq -y install fonts-nanum
fontpath = '/usr/share/fonts/truetype/nanum/NanumBarunGothic.ttf'