---?image=assets/images/geo_depart.png&size=50%
---?image=assets/images/wildcat-eyes-logo.jpg&size=90%
---?image=assets/images/terrabytes27.gif
---?image=assets/images/usgs.png
[KyFromAbove](http://kyfromabove.ky.gov/)
<iframe src="https://www.outrageGIS.com/pointclouds/johnson" width="100%" height="600px"></iframe>
---?image=assets/images/dir.gif
@ul
- Python 3
- subprocess, urllib, and zipfile
- For point clouds (on WinOS)
- LASTools laszip.exe
- Potree point cloud renderer PotreeConverter.exe
- Tile index grids
- QGIS @ulend
---?image=assets/images/q03.png&size=80%
---?image=assets/images/q04.png&size=80%
data_names = [
"ftp://ftp.kymartian.ky.gov/kyaped/DEMs_5FT/N115E318_DEM.zip",
"ftp://ftp.kymartian.ky.gov/kyaped/DEMs_5FT/N115E319_DEM.zip",
"ftp://ftp.kymartian.ky.gov/kyaped/DEMs_5FT/N115E320_DEM.zip",
"ftp://ftp.kymartian.ky.gov/kyaped/DEMs_5FT/N115E321_DEM.zip"]
# Populate project folder with asset folders
downloads = f'{root}/{project}/downloads'
lidar = f'{root}/{project}/lidar'
naip_year = f'{root}/{project}/{year}'
dem = f'{root}/{project}/dem'
# Create folders
folders = [f'{root}/{project}', downloads, lidar, naip_year, dem]
for folder in folders:
subprocess.run(f'mkdir {folder}', shell=True, stdout=subprocess.PIPE)
print(f"mkdir {folder}")
@ul
- Layer name based on grid size
- 5k (lidar, DEM, <2ft img)
- 10k (2 ft NAIP)
- 20k (>2ft NAIP)
- file extensions and year changes @ulend
@ul
- Multiple queries
- 7 years of NAIP
- Soon 2 years of lidar
- Download multiple years using same list
- Must match same resolution @ulend
if "laz" in data_names[0][-3:].lower():
name = url[-12:]
elif "naip" in data_names[0][-22:-18].lower():
extension = "jpg"
name = url[-12:-4]
if year == "2016":
naip_prefix = "ky_2ft_naip_2016_"
elif "dem" in data_names[0][-7:-4].lower():
name = url[-16:-4]
elif "1ft" in data_names[0][-16:-13].lower():
name = url[-12:-4]
# Download, extract, and move
with urllib.request.urlopen(url) as response:
with open(f'{downloads}/{name}.zip', 'wb') as outFile:
data = response.read()
outFile.write(data)
with ZipFile(f'{downloads}/{name}.zip', 'r') as zip:
zip.extractall(f'{downloads}/{name}')
subprocess.run(f'mv {downloads}/{name}/*.* {naip_year}')
ls -n1 dem/*.img > list.txt
gdal_merge.py -ot Float32 -of GTiff -o dem.tif --optfile list.txt
---?image=assets/images/q07.png&size=80%
# Create interactive point cloudmap with PotreeConverter.exe
for i in names:
if ".las" in i:
with open(f'{root}\\{project}\\potree_las_list.txt', 'a+') as outFile:
outFile.write(f"{root}\\{project}\\lidar\\{i}\n")
potreeOut = f"""{potree_tools} --list-of-files
{root}\\{project}\\potree_las_list.txt
-o {root}\\{project}\\potree -p index"""
subprocess.run(potreeOut)
---?image=assets/images/geo_depart.png&size=50%