Created
December 18, 2018 23:00
-
-
Save DanielJDufour/a6ccdf62230a7a2f31c5ab9cb6f3f977 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
import numpy as np | |
import rasterio as rio | |
from sys import argv | |
_, filepath = argv | |
def pad(string): | |
length = len(string) | |
padding = 10 - length | |
return string + " " * padding | |
with rio.open(filepath) as src: | |
firstband = src.read().tolist() | |
for bandid, band in enumerate(src.read()): | |
print("band:", bandid) | |
for rowid, row in enumerate(band): | |
print(pad(rowid + ":", 10)) | |
for colid, cell in enumerate(row.tolist()): | |
#print(str(bandid) + ":" + str(rowid) + ":" + str(colid) + " >> " + str(cell) + "\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment