Skip to content

Instantly share code, notes, and snippets.

View ar-siddiqui's full-sized avatar

Abdul Raheem Siddiqui ar-siddiqui

View GitHub Profile
@ar-siddiqui
ar-siddiqui / create_cog.py
Created October 26, 2022 16:04
Turn GeoTiff to Cloud Optimized GeoTiff
import subprocess
import sys
def create_cog(in_tif: str, out_tif: str):
# TODO for edge cases may need to call gdaladdo twice: first to clear existing ovrs and then to make new ovrs
# TODO parameterize and expose compression options (algorithm, level, predictor)
# TODO are we sure this creates a fully compliant COG? internal tile sizes and regular blocking constraints?
print(f"running gdaladdo on: {in_tif}")
subprocess.check_call(["gdaladdo", "-r", "average", in_tif, "2", "4", "8", "16"])
@ar-siddiqui
ar-siddiqui / LULC_2020_Coverage_Grid.qlr
Last active July 15, 2021 00:22
LULC 2020 Coverage Grid
<!DOCTYPE qgis-layer-definition>
<qlr>
<layer-tree-group expanded="1" name="" checked="Qt::Checked">
<customproperties/>
<layer-tree-layer expanded="1" name="LULC 2020 Download Scenes" providerKey="arcgisfeatureserver" legend_split_behavior="0" checked="Qt::Checked" id="LULC_2020_Download_Scenes_379f0277_a7e1_433e_8e19_d7eb11e8979a" patch_size="-1,-1" legend_exp="" source=" crs='EPSG:4326' filter='' url='https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/LULC_2020_Download_Scenes/FeatureServer/0'">
<customproperties/>
</layer-tree-layer>
</layer-tree-group>
<maplayers>
<maplayer simplifyLocal="1" autoRefreshTime="0" minScale="100000000" maxScale="0" labelsEnabled="0" refreshOnNotifyMessage="" readOnly="0" simplifyAlgorithm="0" hasScaleBasedVisibilityFlag="0" refreshOnNotifyEnabled="0" autoRefreshEnabled="0" geometry="Polygon" type="vector" simplifyDrawingHints="1" styleCategories="AllStyleCategories" simplifyDrawingTol="1" wkbType="MultiPolygon" simplifyMaxScale="1">