Skip to content

Instantly share code, notes, and snippets.

View sanchangon's full-sized avatar
🎯
Focusing

Sanchangon sanchangon

🎯
Focusing
View GitHub Profile
@sanchangon
sanchangon / display-qgis
Created December 20, 2016 16:13
display-qgis-ballon-popup
<!DOCTYPE html>
<html>
<body>
<h2>คุณกำลังเลือกอยู่ที่ [% "TAM_NAM_T" %]</h2>
<p>[% "TAM_NAM_T" %] อยู่ในเขตของ [% "AMP_NAM_T" %]</p>
<p>มีเนื้อที่ [% "AREA" %] ตร.ม.</p>
<p><img src= [% "PATH" %] style="width:304px;height:228px;"></p>
</body>
</html>
@sanchangon
sanchangon / r.sim.water
Created December 20, 2016 15:46
GRASS GIS r.sim.water
(Thu Feb 25 11:10:38 2016) GRASS GIS Site Project
r.in.gdal input=C:\Workspace\site_prj\demsite.tif output=demsite
v.in.ogr input=C:\Workspace\site_prj layer=flood54 output=flood54
v.in.ogr input=C:\Workspace\site_prj layer=site_roads output=site_roads
v.in.ogr input=C:\Workspace\site_prj\site_extent.shp layer=site_extent output=site_extent
@sanchangon
sanchangon / config_cgi-bin
Created December 20, 2016 15:39
config cgi-bin apache2 and change port geoserver
######################################################################################
how to config cgi-bin/proxy.cgi
0. install Python (not work in version 3.x.x)
1. install ms4w
2. install geoserver war file and conig modjk.so then redirect port 80
3. add path C:\ms4w\Apache\cgi-bin ???? copy file proxy.cgi ??? heron.cgi ?????? path ???
@sanchangon
sanchangon / gdal_batchfile
Created December 20, 2016 15:34
GDAL batch file
# Working
for %a in (*.tif) do gdal_translate -a_srs EPSG:4326 -of GTiff %a _%~na.tif
for %a in (*.tif) do gdalwarp -s_srs EPSG:4326 -of GTiff %a _%~na.tif
for %a in (*.tif) do gdalwarp %a mos_.tif
for %a in (*.ecw) do gdal_translate %a %~na.tif
for %a in (*shp) do ogr2ogr -t_srs EPSG:32647 %a %~na.shp
for %a in gdal_translate -a_srs EPSG:32647 -co COMPRESS=JPEG -co JPEG_QUALITY=75 -of GTiff %a _%~na.tif
for %a in (*.tif) do gdal_translate -a_srs EPSG:32647 -co COMPRESS=JPEG -co JPEG_QUALITY=75 -of GTiff %a %~na_.tif
# GDAL Enhance
@sanchangon
sanchangon / Create-field-in-QGIS.md
Last active October 15, 2016 02:43
Calculate field rai ngan and sqrwa in QGIS

Author: Chingchai Humhong (chingchaih@nu.ac.th)

Date: 2016/10/15

1. create field rai ngan and sqrwa in QGIS

$ rai type integer length 5
$ ngan type integer length 5
$ sqrwa type double length 10,2

2. calculate field rai in QGIS

$ floor($area/1600)
@sanchangon
sanchangon / healthcenter.html
Created October 12, 2016 18:12
leaflet-phpgeojson
<html>
<!--
* Name: Leafletjs connect php-geojson through postgis spatial database
* Purpose: GIST@NU (www.cgistln.nu.ac.th)
* Date: 2016/10/13
* Author: Chingchai Humhong (chingchaih@nu.ac.th)
* Acknowledgement:
!-->
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"/>