Skip to content

Instantly share code, notes, and snippets.

Cindy Jayakumar cindygis

Block or report user

Report or block cindygis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cindygis
cindygis / convertXLStoGIS.py
Last active Aug 29, 2015
Takes a folder of spreadsheets and converts it to geodatabase tables using available arcpy tools.
View convertXLStoGIS.py
#
# @author Cindy Williams
# @date 14/11/2014
#
# Takes a folder containing deeds data in spreadsheet
# format and converts it into a GIS table for further processing.
# It must adhere to a specific format.
#
# For use as a script tool in an ArcGIS Toolbox.
#
@cindygis
cindygis / exportMultiDDPasJPEG.py
Last active Aug 29, 2015
Exports data driven pages from a folder of map documents as JPEGs.
View exportMultiDDPasJPEG.py
#
# @author Cindy Williams
# @date 23/08/2013
#
# Exports the data driven pages from a folder of
# map documents as JPEGs.
#
# For use as a script tool in an ArcGIS Toolbox.
#
@cindygis
cindygis / createCVDfromGen.py
Last active Aug 29, 2015
Creates a new coded value domain from values in a feature class using a generator expression.
View createCVDfromGen.py
#
# @date 25/02/2015
# @author Cindy Williams
#
# Extracts a list of values from a field in an attribute table
# to be used in a coded value domain.
#
# For use in the Python window in ArcCatalog.
#
@cindygis
cindygis / assignExistingDomainToField.py
Last active Aug 29, 2015
Adds a new field and assigns an existing domain to a feature class, or assigns the domain only if the field exists.
View assignExistingDomainToField.py
#
# @date 25/02/2015
# @author Cindy Williams
#
# Adds a new field to feature classes in a file GDB
# and assigns an existing domain to it. If the field
# exists, only the domain is assigned.
#
# For use in the Python window in ArcCatalog.
#
@cindygis
cindygis / getEsriWKT.py
Last active Aug 29, 2015
Returns the ESRI WKT for a given coordinate system from epsg.io
View getEsriWKT.py
#
# @date 04/03/2015
# @author Cindy Williams
#
# Returns the ESRI WKT for a given EPSG from epsg.io
# Adapted from http://geospatialpython.com/2014/12/wkt-epsg-strings-made-easy.html
#
def getPRJwkt(epsg):
import urllib
@cindygis
cindygis / getPointDistanceAlongLine.py
Created Mar 6, 2015
Returns the distance a point is along a line.
View getPointDistanceAlongLine.py
#
# @date 06/03/2015
# @author Cindy Williams
#
# Returns the distance a point is along a line. Assumes that the
# existing point and line feature classes have the same spatial reference,
# and the points are snapped to the line.
#
# For use as a standalone script.
#
@cindygis
cindygis / listSubtypesOfFC.py
Last active Aug 29, 2015
Prints out the key-values pairs of the dictionary of subtypes on a feature class.
View listSubtypesOfFC.py
import arcpy
ftr = r"C://Some//Arb//Folder//work.gdb//ftr"
subs = arcpy.da.ListSubtypes(ftr)
for k, v in subs.iteritems():
print k, v['Name']
@cindygis
cindygis / transferSTsAndCVDs.md
Last active Aug 29, 2015
Transfer descriptions of subtypes and coded value domains from feature class to shapefile
View transferSTsAndCVDs.md

######Change this setting when exporting a feature class with subtypes and attribute domains to shapefile

####Transfer Field Domain Descriptions (Environment setting)

#####This geoprocessing environment controls whether output shapefiles and dBASE (.dbf) tables will have fields added containing domain and subtype descriptions, in addition to fields containing domain and subtype codes.

@cindygis
cindygis / toggleLabelsInMXD.py
Last active Aug 29, 2015
Set the label expression and switch on labels for all layers in an ArcMap document.
View toggleLabelsInMXD.py
#
# @date 17/09/2014
# @author Cindy Williams
#
# Set the label field and switch labels on for
# all layers in a mxd.
#
# For use in the Python window in ArcMap.
#
@cindygis
cindygis / listCodeValuesInCVD.py
Last active Aug 29, 2015
Prints out a list of code-value pairs for a given attribute domain in a workspace.
View listCodeValuesInCVD.py
import arcpy
arcpy.env.workspace = "Database Connections\arb.sde"
cvd = "cvd_District"
for dom in arcpy.da.ListDomains():
if dom.name == cvd:
for i in dom.codedValues.iteritems():
print i
# One liner
cvd_pairs = [i for i in dom.codedValues.iteritems() for dom in arcpy.da.ListDomains() if dom.name == cvd]
You can’t perform that action at this time.