Misc help on using WSL:
Misc help on using WSL:
This file contains hidden or 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
import os | |
import requests | |
import zipfile | |
import requests | |
def download_file(url, file_name): | |
"""Downloads a large file from a URL. | |
Args: | |
url: The URL of the file to download. |
This file contains hidden or 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
import requests | |
# wfs_url = "https://openmaps.gov.bc.ca/geo/pub/ows?" | |
# f = 'WHSE_WATER_MANAGEMENT.GW_WATER_WELLS_WRBC_SVW' | |
def get_data(wfs_url, dataset): | |
pagesize =10000 | |
r = wfs_query(f) | |
matched = int(r.get('numberMatched')) | |
returned = int(r.get('numberReturned')) |
This file contains hidden or 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
""" Fixes error | |
Global encoding WKT flag not set for point format 6 - 10. | |
encountered when reading las files with PDAL and QGIS | |
first parameter is laz/las file needing fix | |
note: can also override the input crs if it is known | |
https://gis.stackexchange.com/questions/413191/python-pdal-error-reading-format-1-4-las-file-readers-las-error-global-enco | |
usage: |
This file contains hidden or 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
#--requires | |
https://pypi.org/project/qrcode/ | |
pip install -U qrcode[pil] | |
''' | |
import qrcode | |
url = r"https://pub.data.gov.bc.ca/datasets/177864/pdf/082k/082K021.pdf"#sys.argv[1] | |
output = r"./qrcode/082K021.png"#sys.argv[2] | |
qr = qrcode.make(url) | |
if output[-3:] == 'png': |
This file contains hidden or 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
import os | |
from osgeo import ogr | |
def parse_config(xlsx): | |
''' parses xls into list of dictionaries | |
{'xls tab name':[{'value':'', | |
'layer_name':'', | |
'layer_source':'', | |
'feature_class':''},{}] | |
''' | |
data = [] |
This file contains hidden or 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
git remote add upstream https://github.com/bcgov/gis-pantry | |
git fetch upstream | |
git checkout master | |
git reset --hard upstream/master | |
git push origin master --force |
This file contains hidden or 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
@echo on | |
set batch_home=%~dp0 | |
echo %~dp0 | |
set batch_drive=%CD:~0,2% | |
E: | |
cd %QGIS_PATH%\bin | |
call o4w_env.bat | |
call qt5_env.bat | |
call py3_env.bat | |
path %OSGEO4W_ROOT%\apps\qgis\bin;%PATH% |
NewerOlder