Skip to content

Instantly share code, notes, and snippets.

View chingchai's full-sized avatar
:octocat:
Focusing

Chingchai Humhong chingchai

:octocat:
Focusing
View GitHub Profile
@chingchai
chingchai / ssl-server.js
Created October 13, 2020 13:38
HTTPS-NodeServer
// Dependencies
const fs = require('fs');
const http = require('http');
const https = require('https');
const express = require('express');
const app = express();
// Certificate
const privateKey = fs.readFileSync('/etc/letsencrypt/live/yourdomain.com/privkey.pem', 'utf8');
const certificate = fs.readFileSync('/etc/letsencrypt/live/yourdomain.com/cert.pem', 'utf8');
@chingchai
chingchai / timeseries.html
Last active October 13, 2020 09:05
wms-timeseries
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="Creating a Timeseries with GeoServer and OpenLayers" />
<meta name="author" content="mapedia" />
<title>WMS Time</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css">
<script src="https://openlayers.org/en/v4.6.5/build/ol.js"></script>
@chingchai
chingchai / add_wms-wfs_geoserver.py
Created August 12, 2019 02:59
Add WMS/WFS layer From GeoServer
# -*- coding: utf-8 -*-
# Add WMS/WFS layer From GeoServer
# Author : CHINGCHAI HUMHONG
# Email : chingchai.h@gmail.com
# Institute: MAPEDIA COMPANY
# Copyright 2019. All rights reserved.
import os, sys
from qgis.core import *
import qgis.utils
@chingchai
chingchai / countries.geojson
Last active July 26, 2019 05:44
Leaflet with GeoJSON
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chingchai
chingchai / google_hybrid.xml
Last active July 25, 2019 04:19
BaseMaps Google for QGIS2
<GDAL_WMS>
<!--
Data is subject to term of use detailed at
http://code.google.com/intl/nl/apis/maps/terms.html and
http://www.google.com/intl/en_ALL/help/terms_maps.html
Line Group : LTaxSmartGroup & SmartLTax
Parameter by : Attagorn Srinarong
Cr. : Chingchai Hoomhong
url : http://mt.google.com/vt/lyrs=
@chingchai
chingchai / leaflet_image_overlay.html
Created July 21, 2019 16:56
Leafletjs-Image_Overlay
<html>
<head>
<title>Image Overlays</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<!-- Make sure you put this AFTER Leaflet's CSS -->
<script src="https://unpkg.com/leaflet@1.5.1/dist/leaflet.js"
integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og=="
@chingchai
chingchai / list_field_pyqgis3.py
Created July 21, 2019 15:33
Get Shapefile Field and Type in PyQGIS
# -*- coding: utf-8 -*-
# Get Shapefile Field and Type in PyQGIS
# Author : CHINGCHAI HUMHONG
# Copyright 2019. All rights reserved.
import os
import sys
from osgeo import ogr
location = r"C:\Workspace\pyqgis\pl_village.shp"
dataSource = ogr.Open(location)
@chingchai
chingchai / thaichote_wmts_leaflet.html
Created May 2, 2018 07:50
Leaflet Add Thaichote WMTS
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Thaichote</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="http://leafletjs.com/docs/images/favicon.ico" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.1.0/dist/leaflet.css" integrity="sha512-wcw6ts8Anuw10Mzh9Ytw4pylW8+NAD4ch3lqm9lzAsTxg0GFeJgoAtxuCLREZSC5lUXdVyo/7yfsqFjQ4S+aKw=="
crossorigin="" />
@chingchai
chingchai / show_all_label.sld
Created May 1, 2017 03:30
SLD Geoserver - Point show all labels
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>Point show all labels</Name>
<UserStyle>
<Title>Chingchai: Point show all labels</Title>
<FeatureTypeStyle>
<Rule>
<PointSymbolizer>
<Graphic>
@chingchai
chingchai / leaftwms.html
Created March 21, 2017 18:43
Example Leaflet Add WMS From GeoServer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width">
<title>Example Leaflet Add WMS From GeoServer</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css">
</head>
<style>