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
# This is a script that I use to convert geojson to | |
# features in a file gdb | |
# Step 1. Use the REST page of an ArcGIS Map Service to | |
# get the esri json results of the data you want. | |
# Step 2. I used my EsriJSON to GeoJSON app to convert | |
# the results to geojson. http://esritogeo.herokuapp.com/ | |
# Step 3. In ArcMap, use the python window to create a | |
# python dictionary of your geojson. | |
# Step4. Use the following script to convert that geojson | |
# into featureclasses and then merge them. |
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
# | |
# @date 01/04/2015 | |
# @author Cindy Williams | |
# | |
# Creates a point feature class for points derived from | |
# various polyline methods. This example uses polyline.firstPoint | |
# but can be replaced with any of the polyline methods which | |
# generate points. | |
# | |
# For use as a standalone script. |
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
# | |
# @date 16/04/2015 | |
# @author Cindy Williams | |
# | |
# Writes the contents of a feature class to csv. | |
# Writing to csv is usually used when quickly | |
# needing to give file contents to a non-GIS | |
# person, or in creating a GIS inventory. | |
# | |
# For use as a standalone script. |
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
# | |
# @date 29/04/2015 | |
# @author Cindy Williams | |
# | |
# Converts geometry in a feature class to JSON, | |
# and writes it to a CSV file. | |
# | |
# For use in the Python window in ArcCatalog. | |
# |
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
# | |
# @date 11/05/2015 | |
# @author Cindy Williams | |
# | |
# Writes certain properties of a layer within a group | |
# layer in a mxd to csv. | |
# | |
# For use in the Python window in ArcMap. | |
# |
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
# | |
# @date 27/05/2015 | |
# @author Cindy Williams | |
# | |
# Updates the values for a unique symbology renderer | |
# based on range domain values. The layer must have | |
# the unique symbols renderer enabled manually. | |
# | |
# For use in the Python window in ArcMap. | |
# |
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
# | |
# @date 29/05/2015 | |
# @author Cindy Williams | |
# | |
# Updates a layer name with the name of the group layer | |
# it is in, in an existing mxd. | |
# | |
# For use in the Python window in ArcMap. | |
# |
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
# | |
# @date 29/05/2015 | |
# @author Cindy Williams | |
# | |
# Checks an attribute field for duplicate values, | |
# and displays them along with the amount of duplicates. | |
# | |
# For use in the Python window in ArcMap. | |
# |
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 | |
arcpy.env.workspace = r"C:\Some\Arb\Folder" | |
# Define spatial reference WGS 84 | |
sr = arcpy.SpatialReference(4326) | |
for shp in arcpy.ListFeatureClasses(): | |
arcpy.management.DefineProjection(shp, sr) | |
print("Defined " + shp) |
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 | |
import os | |
# Detailed description | |
os_appdata = os.environ['APPDATA'] # Current user's APPDATA folder | |
folder_esri = "ESRI" # ESRI folder name | |
arc_prod = arcpy.GetInstallInfo()['ProductName'] # Get the installed product's name e.g. Desktop | |
arc_ver = arcpy.GetInstallInfo()['Version'] # Get the installed product's version number | |
arc_cat = "ArcCatalog" # ArcCatalog folder name |