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
################################################################################# | |
# | |
# Requirements: You'll need ArcGIS Desktop 10.1 or higher with Python 2.7+ | |
# | |
# Give this script a shapefile or a feature class and it will give you a summary | |
# report for each field (column) in the attribute table. It helps you get a feel | |
# for how "complete" the attributes are populated during data assessment. It's | |
# useful if you need to compare two similar data sources too if you fiddle with | |
# the results in a spreadsheet program. | |
# |
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
################################################################################################################## | |
# | |
# Requirements: You'll need ArcGIS Desktop 10.1 or higher with Python 2.7+ | |
# | |
# If you want to change Transparency for all the layers in your ArcMap MXD quickly, this will do the trick. | |
# | |
# 1. Copy / Paste the initial commands and function definitions below into an MXD's Python command shell, one-by-one | |
# 2. Use the command "setLayerTransparenciesTo(75)" to change every transparency to 75, or whatever you want | |
# (As a side note, notice that the Group Layers are set to 0 transparency. Play with this if you want!) | |
# |
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
############################################################################### | |
# | |
# Requirements: You'll need ArcGIS Desktop 10.1 or higher with Python 2.7+ | |
# Use as a ArcToolbox Script Tool. Add the parameters as needed. | |
# | |
# Give this script an entire Geodatabase and it reports the number of | |
# attachments in attachment table and features in each feature class. | |
# | |
# The output is useful for comparing FC counts between multiple | |
# identical GDBs. |
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
from PIL import Image | |
import glob, os | |
size = 800, 600 | |
for infile in glob.glob("c:/myphotos/*.jpg"): | |
file, ext = os.path.splitext(infile) | |
im = Image.open(infile) | |
im.thumbnail(size, Image.ANTIALIAS) | |
im.save(file + ".jpg", "JPEG") |
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 | |
def permanent_join(target_table, target_attribute, source_table, source_attribute, attribute_to_attach, rename_attribute=None): | |
""" | |
Attaches a field to a dataset in place in ArcGIS - instead of the alternative of doing an actual join and then saving out a new dataset | |
Only works as a one to one join. | |
:param target_table: the table to attach the joined attribute to | |
:param target_attribute: the attribute in the table to base the join on | |
:param source_table: the table containing the attribute to join | |
:param source_attribute: the attribute in table2 to base the join on |
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
############################################################################# | |
# Requirements: ArcGIS 10.0 or higher, Python 2.7 or higher | |
# | |
# Description: Give this script an attachment table in a file geodatabase, | |
# and it will extract all the files and place them into the | |
# folder you designate. | |
# | |
# Note: Since attachments can have the same file name (i.e. Image00001.jpg) | |
# this script appends the attachment id to the file name so that every | |
# file is uniquely named in the folder you designate. |
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
############################################################################### | |
# | |
# Requirements: You'll need ArcGIS Desktop 10.1 or higher with Python 2.7+ | |
# Use as a ArcToolbox Script Tool. Add the parameters as needed. | |
# | |
# Give this script an entire Geodatabase and it reports a list of its feature | |
# classes and whether or not Editor Tracking is enabled. | |
# | |
# The output is useful for managing Editor Tracking for a large number of | |
# feature classes. |
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
################################################################################# | |
# | |
# Requirements: You'll need ArcGIS Desktop 10.1 or higher with Python 2.7 | |
# | |
# Give this script a geodatabase (Personal, File, or SDE connection) and it will | |
# remove the "Geoprocssing History" contents from the Metadata in every Feature | |
# Class inside the geodatabase. | |
# | |
# Before you attempt to use/run this script, make sure you have read the section | |
# near the top called "MODIFIABLE VARIABLES HERE". |
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
##################################################################################### | |
# | |
# Requirements: You'll need Python 3.5.1 or higher to run this | |
# | |
# This script will provide you a basic understanding of the alphanumeric patterns | |
# which exist in a list. You might get this list from a SQL query or something like | |
# that. | |
# | |
# INPUT: Give this script a file that has a single column of ID type strings. | |
# EXAMPLE (from command line): |
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, os | |
fc = os.path.join(r"path",r"to",r"your",r"featureclass") | |
field_list = [[field.name,field.type,str(field.length)] for field in arcpy.ListFields(fc)] | |
for field in field_list: | |
print(','.join(field)) | |
OlderNewer