Skip to content

Instantly share code, notes, and snippets.

View daviguima's full-sized avatar
🌎
Learning

David Guimaraes daviguima

🌎
Learning
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CMCDragonkai
CMCDragonkai / ogr_iterate.py
Last active August 26, 2023 08:46
GDAL OGR Iterate over all layers, features, fields and geometry #python #gdal #ogr
from osgeo import ogr
data = ogr.Open('/path/to/vector/file')
print('Data Name:', data.GetName())
# get a layer with GetLayer('layername'/layerindex)
for layer in data:
print('Layer Name:', layer.GetName())
print('Layer Feature Count:', len(layer))
@blaylockbk
blaylockbk / netcdf_basics.py
Last active December 3, 2021 08:43
Basics of opening NetCDF files with Python
#from netCDF4 import Dataset # use scipy instead
from scipy.io import netcdf #### <--- This is the library to import.
# Open file in a netCDF reader
directory = './'
wrf_file_name = directory+'filename'
nc = netcdf.netcdf_file(wrf_file_name,'r')
#Look at the variables available
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active May 25, 2024 06:37
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH