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 / convertListToCVD.py
Last active Jul 29, 2018
Extracts a unique list of values from an attribute table and converts it into an coded value domain.
View convertListToCVD.py
#
# @date 31/05/2013
# @author Cindy Williams
#
# Extracts a unique list of values from an attribute table
# and converts it into an coded value domain.
#
# For use as a script tool in an ArcGIS Toolbox.
#
View transferDomainsToFields.py
#
# @author Cindy Jayakumar
# @date 21/07/2018
#
# Extract domains from a field in one feature class, and apply
# it to matching fields in another feature class.
#
import arcpy
@cindygis
cindygis / attachGoogleMapsURL.py
Created May 2, 2018
Adds a field to a point feature class containing a link to launch Google Maps with directions from the current location of the device to the destination point.
View attachGoogleMapsURL.py
#
# @author Cindy Jayakumar
#
# @date 12/05/2018
#
# Adds a field to a point feature class containing a link
# to launch Google Maps with directions from the current
# location of the device to the destination point.
#
# Can be used for navigating to sites while in the field,
@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 / getUniqueFieldValues.py
Created Nov 15, 2017
Methods to get a unique list of values from a field in a feature class
View getUniqueFieldValues.py
import arcpy as ap
import numpy as np
import timeit
lyr = ap.mapping.Layer(r"C:\Some\Arb\Folder\test.gdb\test")
field_name = "NAME"
# Method 1: Python
unique_values = list(set(row[0] for row in ap.da.SearchCursor(lyr, field_name)))
@cindygis
cindygis / alterCamelCaseAlias.py
Last active Oct 5, 2017
How to insert a space between camel case, lest I ever forget again
View alterCamelCaseAlias.py
#
# @date 05/10/2017
# @author Cindy Jayakumar
#
# Change the alias of feature classes to the
# title case version of the CamelCase name
#
# e.g. WaterPumpStation => Water Pump Station
import arcpy
@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.
#
View makequerytablebug.md

http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/make-query-table.htm

When inputting the optional SQL clause, ArcGIS automatically adds quotation marks "" to the field names in the dialog box. This will pass the tool's error checking successfully but will cause the tool to fail with an error.

If you verify the SQL clause in the dialog box, it will give a SQL error with no specifics. When adding the clause, remember to remove the quotation marks.

e.g. If you want to join Layer1 to Layer 2 on common field ID and where Layer 1 contains "Cape Town", ArcGIS will format your expression in the following way:

@cindygis
cindygis / duplicatePoint.py
Created Feb 9, 2017
Uses the geometry of a selected point in one layer to insert new points with selected attributes from a different layer.
View duplicatePoint.py
'''
@author Cindy Jayakumar
@date 31/01/2017
- Inserts a new point with the selected geometry in to_lyr
- Adds attributes to that point from from_lyr
- Updates the record in from_lyr
Uses selected features
@cindygis
cindygis / buildDefQryFromXLS.py
Last active Aug 19, 2016
Loops over an existing spreadsheet and builds up a definition query to apply to a layer in ArcMap
View buildDefQryFromXLS.py
#
# @author Cindy Williams
# @date 25/06/2013
#
# Loops over an existing spreadsheet with attribute data
# and builds up a definition query to apply to the dataset.
#
# For use in the Python window in ArcMap.
#
You can’t perform that action at this time.