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 | |
# This will rename all files ending with ".sf1" to ".txt" | |
[os.rename(f, f.replace('.sf1', '.txt')) for f in os.listdir('') if f.endswith('.sf1')] |
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
# For each line in the text file, remove the first 4 columns | |
f1 = open('tx000382010.txt', 'r') | |
f2 = open('tx000382010mod.txt', 'w') | |
for line in f1: | |
f2.write(line.replace('SF1ST,TX,000,38,', '')) | |
f1.close() | |
f2.close() |
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 csv | |
#removes columns starting at remove_from up to- but *not including* - remove_to | |
remove_from = 239 | |
remove_to = 260 | |
fp_in = open("tx000452010.txt", "rb") | |
fp_out = open("tx000452010_PT1.txt", "wb") | |
reader = csv.reader(fp_in, delimiter=",") |
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 csv | |
# Removes columns starting at remove_from up to- but *not including* - remove_to | |
# In this example, all columns are removed except for the first 5 and last 21 | |
remove_from = 5 | |
remove_to = 239 | |
fp_in = open("tx000452010.txt", "rb") |
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
''' | |
batchFieldUpdate.py | |
For each feature class in EMST_Districts on Comanche.sde, do the following: | |
1 - Adds new field "Feature_Type" | |
2 - Calculates field | |
if type = null add "vegetation" | |
''' |
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
''' | |
batchFieldDelete.py | |
Iterate through features in featuredataset to delete unwanted fields. | |
Delete fields: | |
1 - Area_MI | |
2 - DOT_Feature | |
3 - Area_MI | |
''' |
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 | |
from arcpy import * | |
env.workspace = r"C:\Users\RABBEY-C\RA_GIS\Projects\RA_EMST\Updated_Phase_Features.gdb\District_Unions" | |
fcList = arcpy.ListFeatureClasses() | |
#Renames featureclasses ending in "_Union" with "" | |
for fc in fcList: |
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
'''=============================== | |
ClipLooper.py | |
The purpose of this script is to step through all 10 counties in the dataset and | |
clip each of the 3 features (Water Bodies, Streams, City Limits) to the counties border. | |
Script Arguments: | |
0 - Input County FC | |
1 - Input Water Bodies FC | |
2 - Input Streams FC |
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
''' | |
DoForms_Downloader.py | |
v1.10 | |
3/21/2014 | |
This script will accomplish the following: | |
- Allows user to select featureclass generated from DoForms |
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
''' | |
=========================== | |
listAliases.py | |
4/8/2014 | |
This script will allow the user to select a feature class and output the features Name, Alias, and Type to a .csv file. | |
Arguments: | |
0 - Input Featureclass |
OlderNewer