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 / updateRowsWithNestedLoop.py
Created Dec 4, 2015
Updates a field using a nested loop in an arcpy update cursor
View updateRowsWithNestedLoop.py
import arcpy
lyr = arcpy.mapping.Layer(r'C:\Some\Arb\Folder\work.gdb\ftr_test')
cursor = arcpy.da.UpdateCursor(lyr, 'Name')
for i in xrange(10):
for e in ['X', 'Y']:
upd.next() # Increment the cursor
upd.updateRow(['Zone ' + str(i) + e])
@cindygis
cindygis / addFieldWithExtendTable.py
Last active Mar 31, 2016
Adds a new field using a numpy array to layers in a map document.
View addFieldWithExtendTable.py
'''
@date 12/10/2015
@author Cindy Williams
Adds a new field to layers in a map document, based
on a current field.
For use in the Python window in ArcMap.
'''
@cindygis
cindygis / splitLineAtInteractivePoint.py
Created Oct 6, 2015
Uses an arcpy FeatureSet to allow the user to interactively create points on a line which will be used to split that line into parts, while retaining all attributes.
View splitLineAtInteractivePoint.py
'''
@date 06/10/2015
@author Cindy Williams
@version 1.0
Uses an arcpy FeatureSet to allow the user to interactively create
points on a line which will be used to split that line into parts,
while retaining all attributes.
Requirements:
@cindygis
cindygis / extractDOCtablesToXLS.py
Created Sep 29, 2015
Writes the contents of all rows from multiple tables in a Word document to a spreadsheet.
View extractDOCtablesToXLS.py
import docx
import xlwt
doc = r"C:\Some\Arb\Folder\input.docx"
xls = r"C:\Some\Arb\Folder\output.xls"
document = docx.Document(doc)
book = xlwt.Workbook()
cur_sheet = book.add_sheet("Tables")
row_num = 0
@cindygis
cindygis / writeFieldsToDOC.py
Created Sep 21, 2015
Uses the python-docx package to write various properties of a feature class to docx format.
View writeFieldsToDOC.py
'''
@date 15/09/2015
@author Cindy Williams
Uses the python-docx package to write various
properties of a feature class to docx format.
'''
import arcpy
@cindygis
cindygis / convertSIDtoTiff.py
Last active Sep 18, 2015
Converts a folder of MRSID files to TIFF files.
View convertSIDtoTiff.py
'''
@date 2015/09/18
@author Cindy Williams
Converts a folder of MRSID files to TIFF files.
For use as a standalone script.
'''
import arcpy
@cindygis
cindygis / displayRasterProperties.py
Created Sep 3, 2015
Prints a comparison of the specified raster properties using arcpy and numpy.
View displayRasterProperties.py
#
# @date 25/08/2015
# @author Cindy Williams
#
# Prints a comparison of the specified raster
# properties using arcpy and numpy.
#
# For use as a standalone script.
#
@cindygis
cindygis / panZoomDataFramesToDDPDataFrame.py
Created Sep 1, 2015
Pans and zooms each data frame in an ArcMap document to the extent and scale of the data frame containing the data driven pages index layer before exporting.
View panZoomDataFramesToDDPDataFrame.py
#
# @date 25/08/2015
# @author Cindy Williams
#
# Pans and zooms each data frame in an ArcMap document
# to the extent and scale of the data frame containing
# the data driven pages index layer before exporting.
#
# For use as a standalone script.
#
@cindygis
cindygis / convertMultiPagePDFtoTIFF.py
Created Aug 18, 2015
Converts a range of pages from a pdf to separate tiff files using the PDF to TIFF tool added at ArcGIS 10.3.
View convertMultiPagePDFtoTIFF.py
#
# @date 18/08/2015
# @author Cindy Williams
#
# Converts a range of pages from a pdf to separate tiff
# files using the PDF to TIFF tool added at ArcGIS 10.3.
# For very basic conversion, with minimal error handling.
#
# For use as a standalone script.
#
@cindygis
cindygis / reformatAllLayerNames.py
Last active Aug 29, 2015
Quickly formats the names of all the layers in a map document.
View reformatAllLayerNames.py
#
# @date 14/08/2015
# @author Cindy Williams
#
# Quickly formats the names of all the layers in a map
# document. In this example, the part of the name before
# the first full stop is removed, underscores are replaced
# spaces, a regex is used to insert spaces before capitals
# and the string is converted to proper case.
#
You can’t perform that action at this time.