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
Dir | Rename-Item -NewName {$_.name -replace "","_"} |
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
python -m SimpleHTTPServer | |
http://192.168.1.2:8000 | |
http://127.0.0.1:8000 |
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
import os | |
mxd = arcpy.mapping.MapDocument("CURRENT") | |
df = arcpy.mapping.ListDataFrames(mxd)[0] | |
place = 'D:/Projects/chkNRSA_Watersheds/arcpyWSheds' | |
for f in os.listdir(place): | |
if '.shp' in f and not '.xml' in f: | |
if f[:9].replace('_','-') in wsheds: | |
addLayer = arcpy.mapping.Layer('%s/%s' % (place, f)) | |
arcpy.mapping.AddLayer(df,addLayer,"BOTTOM") |
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
import geopandas as gpd | |
from shapely.geometry.polygon import Polygon | |
from shapely.geometry.multipolygon import MultiPolygon | |
def explode(indata): | |
indf = gpd.GeoDataFrame.from_file(indata) | |
outdf = gpd.GeoDataFrame(columns=indf.columns) | |
for idx, row in indf.iterrows(): | |
if type(row.geometry) == Polygon: | |
outdf = outdf.append(row,ignore_index=True) |
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
final = np.load('D:/Projects/chkNRSA_Watersheds/FlowlineComidsZone.npy') | |
temp = final[:,0].astype(int) | |
x = 23763375 | |
final[np.where(temp == x)] |
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
import sys | |
import pandas as pd | |
import numpy as np | |
sys.path.append('D:/Projects/StreamCat') | |
from StreamCat_functions import dbf2DF, findUpstreamNpy | |
NHD_Dir = 'D:/NHDPlusV21' | |
numpy_dir = 'D:/NHDPlusV21/StreamCat_npy/bastards' | |
zone = '07' |
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
import arcpy, os, sys | |
from arcpy import env | |
inputs = {'CA':['18'],'CO':['14','15'],'GB':['16'],'GL':['04'],'MA':['02'],'MS':['05','06','07','08','10L','10U','11'],'NE':['01'],'PN':['17'],'RG':['13'],'SA':['03N','03S','03W'],'SR':['09'],'TX':['12']} | |
# process one coordinate at a time, locating routes for all hydroregions before looping to next coordinate set | |
# note that once the flowlines are converted into routes, all attribute information will get dropped, we will process the Locate Routes tool again to determine COMID (to get to stream order) for all sites that fail the checks | |
sites = 'D:/Projects/WEMAP_WSA/SplitCatsNAD83/xyLayer_join.shp' |
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
import numpy as np | |
import geopandas as gpd | |
from geopandas.tools import sjoin | |
NHD_dir = "D:/NHDPlusV21" | |
inputs = np.load('%s/StreamCat_npy/zoneInputs.npy' % NHD_dir).item() | |
pt_file = "C:/Users/Rdebbout/Downloads/Stations_albers.shp" | |
pts = gpd.GeoDataFrame.from_file(pt_file) | |
l = "/NHDPlus" |
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
import os | |
import rasterio | |
import numpy as np | |
home = 'L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/LandscapeRasters/QAComplete' | |
tifs = [] | |
for x in os.listdir(home): | |
if ".tif" in x and "mar14" in x and not 'xml' in x and not 'ovr' in x: | |
print x | |
tifs.append(x) |
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
import itertools | |
import rasterio as rs | |
import geopandas as gpd | |
from rasterio.crs import CRS | |
from rasterio import features | |
def makeAffine(tf, lbl, w, h): | |
if lbl == 'A': | |
return tf | |
if lbl == 'B': |
OlderNewer