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 are publishing an MXD as a map service you might get a warning from | |
# the Analyze option that some number of layers "draws at all scale ranges". | |
# | |
# This script sets all the layers in the MXD you have open to a minimum scale | |
# value of your choosing IF a layer's value is not set (indicated by being 0.0). | |
# |
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 are publishing an MXD as a map service you might get a warning from | |
# the Analyze option that some number of layers "draws at all scale ranges". | |
# | |
# This script lists all the layers in the MXD you have open and what their | |
# minimum scale is set at, if at all. Those with '0.0' values have no value set. | |
# |
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)) | |
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
################################################################################# | |
# | |
# 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 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: 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
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
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
############################################################################### | |
# | |
# 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. |
NewerOlder