Skip to content

Instantly share code, notes, and snippets.

@nishadhka
nishadhka / kml_io.py
Created January 30, 2021 06:18 — forked from mazzma12/kml_io.py
IO / Read and write KML file with geopandas and fiona driver
import fiona
import geopandas as gpd
# Enable fiona driver
gpd.io.file.fiona.drvsupport.supported_drivers['KML'] = 'rw'
# Read file
df = gpd.read_file(path, driver='KML')
# Write file
@nishadhka
nishadhka / S5p_tiles_mosaic.ipynb
Created July 4, 2020 02:02
S5p large area tiles and mosaic using harp and xarray-pyhton
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nishadhka
nishadhka / Pyspark_to_extract_OSM_PBF_and_convert.md
Last active January 11, 2020 08:56
Pyspark to extract OSM PBF and convert into shape file
  1. based on this to convert the pbf into paraquet file
  2. The library, https://github.com/adrianulbona/osm-parquetizer to convert the osm.pbf file into three paraquet files
java -jar target/osm-parquetizer-1.0.1-SNAPSHOT.jar ../test1/romania-latest.osm.pbf
  1. The Python pyspark code to read the paraquete file and make subset on extent and save the shape file
  2. Using the docker for https://hub.docker.com/r/airpollutionstudyindia/matplotlib and executing the code in the contianer
from pyspark.sql import SparkSession
from pyspark.sql.functions import col,explode
@nishadhka
nishadhka / vim_commands.md
Last active November 8, 2019 10:57
Handy vim commands

Handy vim commands

  1. To save :w
  2. to quit :q
  3. to start nerdtree :NERDTREE
  4. to move in nerdtree :ctrl+w
  5. to close a file :ctrl+w+q
  6. to select multple lines :v
  7. to cut :d
  8. to copy :y
@nishadhka
nishadhka / .vimrc
Created November 8, 2019 04:02
Config file for VIM with nerdtree
"Source https://github.com/j1z0/vim-config/blob/master/vimrc
"vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
"git interface
@nishadhka
nishadhka / Jupyterhub_install.ipynb
Last active September 15, 2018 23:07
Jupyterhub_install.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nishadhka
nishadhka / ndvi_gee_shapefile.py
Created August 25, 2018 04:38
NDVI shape file creator from Landsat images, using Google earth engine and Python API
import numpy as np
import fiona
from shapely import geometry
import ee
ee.Initialize()
from gee_library import *
from rasterio.features import shapes
import geopandas as gp
import ntpath
import glob
@nishadhka
nishadhka / Ushahidi_API_use_cases.ipynb
Last active August 23, 2018 04:49
usefull_tools/Ushahidi_API_use_cases.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nishadhka
nishadhka / ushahidi_form_key.py
Created August 20, 2018 18:09
Ushahidi form to key mapper, using attributes API
import requests
import json
oauth_url = 'http://sample_ushahidinstance/platform/oauth/token'
oauth_d = {
"grant_type": "password",
"scope": "apikeys posts country_codes media forms api tags savedsearches sets users stats layers config messages notifications webhooks contacts roles permissions csv tos dataproviders",
"client_id": "ushahidiui",
"client_secret": "35e7f0bca957836d05ca0492211b0ac707671261",
@nishadhka
nishadhka / ml-Python-libraries.md
Last active October 15, 2019 12:55
Python machine learning libraries in docker

Machine learning libraries of Python in Docker

The docker tar.gz'd is 2.4 GB in size, download from here

background and installed libraries in the docker

  • to set up the new ubuntu docker image, it is 124MB in size,
    sudo docker search ubuntu
    sudo docker pull ubuntu