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
| # a method to quickly loop through all the folders/subfolders in a path and create a list of all csv files | |
| # used regex to include only files with "output" in the name | |
| ls.file <- list.files(path = "Z:/GIS/DataLibrary/test", pattern = "^.*output.*.csv$", full.names = TRUE, recursive = TRUE) | |
| lapply(ls.file, function(i) { | |
| ExtractDates(i) | |
| }) |
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
| # this takes a csv with a beginning & end address, pulls google walking directions between those points, | |
| # and then saves the file in the ESRI Shapefile format, with each path as a feature | |
| import googlemaps | |
| import csv | |
| import arcpy | |
| from shapely.geometry import LineString, mapping, shape | |
| from fiona import collection | |
| from datetime import datetime | |
| from osgeo import ogr |
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
| library(data.table) | |
| ### Inputs ### | |
| meta.file <- "/Volumes/Seagate Backup Plus Drive/Volumes/arterial/arterial-config.csv" | |
| ### Load Data ### | |
| meta.df <- fread(meta.file, header=T,sep="|",stringsAsFactors=F) | |
| ### Clean XY Data ### | |
| x <- gsub('.+\\((-[0-9]+\\.[0-9]+),([0-9]+\\.[0-9]+).+','\\1',meta.df$START_LAT_LONG) |
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
| # This script is intended to follow the ArcPy_AssignNodeIDstoSegment.py | |
| # Once the segments have the Node IDs, this script will assign collisions | |
| # to each segment and intersection. | |
| import arcpy | |
| from arcpy import env | |
| ##### Input ##### | |
| env.workspace = "Z:/GIS/DataLibrary/Transportation/BOE_Centerline_Intersections150930/collisiontoInt_test.gdb" | |
| env.overwriteOutput = True #so we can rerun this script and overwrite our output feature class |
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
| library(data.table) | |
| library(fasttime) | |
| start.time <- proc.time() | |
| #parameters that will apply to the data | |
| chunkSize <- 1000000 | |
| colnames <- c('Date.Time','XD.Segment','Speed','Score') | |
| #import csv with list of XD.Segments to filter through | |
| clipped.csv <- "Z:/GIS/DataLibrary/Inrix/LA County_15.2_Shapefiles/ClipforVZTechnicalAnalysis/ClippedInrixSegIDList.csv" |
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 arcpy | |
| from arcpy import env | |
| ##### Input ##### | |
| env.workspace = "Z:/GIS/DataLibrary/Transportation/BOE_Centerline_Intersections150930/collisiontoInt_test.gdb" | |
| env.overwriteOutput = True #so we can rerun this script and overwrite our output feature class | |
| #input fc | |
| col_fc = "Collisions_2009to2013" | |
| input_centerline_fc = "Street_Centerline_Raw" |
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
| library(data.table) | |
| ### Inputs ### | |
| meta.file <- "Z:/GIS/DataLibrary/Riits/TrafficVolumes/data dump/EXPORT - 2015/config.dsv" | |
| ### Load Data ### | |
| meta.df <- fread(meta.file, header=T,sep="|",stringsAsFactors=F) | |
| ### Clean XY Data ### | |
| x <- gsub('.+\\((-[0-9]+\\.[0-9]+) {1}([0-9]+\\.[0-9]+).+','\\1',meta.df$START_LAT_LONG) |
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
| #### This script will take the Riits Sensor Shp, and copy the assetIDs of all intersecting points to the attribute table of the Riits layer | |
| import arcpy | |
| from arcpy import env | |
| env.workspace = "Z:/GIS/DataLibrary/Transportation/BOE_Centerline_Intersections150930/collisiontoInt_test.gdb" | |
| env.overwriteOutput = True #so we can rerun this script and overwrite our output feature class | |
| #input | |
| Riits_sensor_shp = "Z:/GIS/DataLibrary/Riits/TrafficVolumes/data dump/EXPORT - 2015/RiitsSensorsproj.shp" |
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
| library(data.table) | |
| library(fasttime) | |
| #input | |
| week1.file = "Z:/GIS/DataLibrary/Riits/TrafficVolumes/data dump/EXPORT - 2015/october.dsv" | |
| #parameters that will apply to the data | |
| chunkSize <- 500000 | |
| #date ranges |
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 arcpy | |
| from arcpy import env | |
| ##### Input ##### | |
| shp = "C:/Users/dotcid034/Desktop/Export_Output (1)/Export_Output.shp" | |
| col_fields = ["Cross_St","AllStreets","Doyourname"] | |
| cur = arcpy.da.UpdateCursor(shp,col_fields) | |
| for row in cur: | |
| val = None |
OlderNewer