Skip to content

Instantly share code, notes, and snippets.

View clubgisdotnet's full-sized avatar

ClubGIS.net clubgisdotnet

View GitHub Profile
var pt = ee.Geometry.Point(89.07, 22.65);
// Load Sentinel-1 C-band SAR Ground Range collection (log scaling, VV co-polar)
var collection = ee.ImageCollection('COPERNICUS/S1_GRD').filterBounds(pt)
.filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV'))
.select('VV');
// Add dropdown for year
var thisYear = new Date();
@clubgisdotnet
clubgisdotnet / preprocess_sentinel_snap.py
Last active June 16, 2019 08:21
Download Sentinel-1 image from Copernicus Hub and process raw file in batch.
import os
import datetime
import gc
import glob
import snappy
from sentinelsat import SentinelAPI, geojson_to_wkt, read_geojson
from snappy import ProductIO
class sentinel1_download_preprocess():
def __init__(self, input_dir, date_1, date_2, query_style, footprint, lat=24.84, lon=90.43, download=False):
var pt = ee.Geometry.Point(90.9186, 24.6823);
// Load Sentinel-1 C-band SAR Ground Range collection (log scaling, VV co-polar)
var collection = ee.ImageCollection('COPERNICUS/S1_GRD').filterBounds(pt)
.filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV'))
.select('VV');
// Add dropdown for year
var year = ['2018', '2017', '2016'];
{
"cmd": ["path\\to\\Kotlinc\\bin\\kotlinc.bat", "$file", "-include-runtime", "-d", "$file_path\\\\$file_base_name.jar"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"working_dir": "$file_path",
"selector": "source.Kotlin",
"windows": {
"encoding": "utf-8"
},
"variants": [
{
@clubgisdotnet
clubgisdotnet / extract_coordinates_from_docx.py
Last active October 3, 2022 16:06
Extract coordinates from the docx
# This is where the actual code starts
from docx import Document
import sys, os, re
reload(sys)
sys.setdefaultencoding('utf8')
root_dir = "C:\\Google_Link" # The path of the parent folder which have all the docx files
for root, dirs, files in os.walk(root_dir):
for name in files:
@clubgisdotnet
clubgisdotnet / wrap_files_folders.py
Last active June 14, 2019 15:41
Wrap each files with a folder
# !/usr/bin/python
# -*- coding: utf-8 -*-
# Wrap each files to its own folder, run once
import os
import shutil
dir_name = "D:\\DOCUMENTS\\Google_Link\\all docx"
docx_files = os.listdir(dir_name)