Skip navigation
All Places >

python snippets

Log in to follow, share, and participate in this socialgroup.

Recent Activity

JLM007
Does anyone know where I might find an ArcPY script where I would be able to automatically export and download data from a feature service from ArcGIS online. Thank you.
in python snippets
timdun
Hi all, I have a feature class which has 1 field which are hyperlinks to photos: e.g. [PHOTO] : C:\temp\photo1.jpg, c:\temp\photo2.jpg, c:\temp\photo3,jpg All one string in the PHOTO field, separated by commas. I want to strip out each hyperlink and update 9 Hyperlink fields in the feature class: [HYPERLINK1], [HYPERLINK2],… (Show more)
in python snippets
timdun
Hi all, I'm trying to compare data values in 2 separate feature classes and find out what has changed.   FCnew | FIELDA (shapefile or feature class) FCmaster | FIELDA (feature class in a fgdb)   FCnew is periodically being updated by external source - this can have new values or have original values removed. FCmaster is the master table I… (Show more)
in python snippets
ae.swagoner
I am writing a really simple stand alone script. All it does is convert a KML to a feature class,  then it lists the feature classes. The issue I am having is I cannot find the feature classes.  In ArcPro it shows us as the KML name/Placemarks/Polygon.  When I run the script asking for the layer list it returns with empty brackets.       import… (Show more)
in python snippets
drunix
I finally figured out how to iterate an annotation feature class in arcpy to update its attributes. You cannot use a cursor , it just generates errors. You cannot directly use SQL and bypass arcpy because the attribute columns are just for show, the real data is hidden in a binary column you can't see in ArcGIS.   But you can use… (Show more)
in python snippets
mrosenberg57
I have a script that lists all layers in an MXD and I have a script that lists all broken layers in an MXD. I want to list all layers, their name, source, description, and whether or not their source is broken. Can anyone help me with this?   import arcpy, os, fnmatch, csv #Create an empty list of ArcMap documents to process...… (Show more)
in python snippets
jborgion
I've been tasked with updating a number of scripts that we run over night as scheduled tasks.  The original scripts use several try: except blocks that look like this:   if arcpy.Exists(gdbPathNameTestBAK):       try:         arcpy.Delete_management(gdbPathNameTestBAK)         print "Success: Deleted BACKUP  " + gdbPathNameTestBAK     except… (Show more)
in python snippets
dogdaynoon
I am running ArcGIS Pro 2.0.0 on a windows 12 Server (not controlled by me). There is an automated python/arcpy script that runs every night that replaces some tables in a GDB. Until recently the script would run and use the credentials stored by ArcGIS Pro for startup to authorize license level. For some reason now the "Remember Me" option… (Show more)
in python snippets
peyster
>>> import arcpy ... from arcpy import env ... env.workspace = "C:\temp" ... infc = "MDroads.shp" ... clipfc = "MC.shp" ... outfc = "MoCoClip.shp" ... arcpy.Clip_analysis(infc, clipfc, outfc) ... Runtime error Traceback (most recent call last): File "<string>", line 7, in <module> File "c:\program files… (Show more)
in python snippets
sourav@iastate.edu_ISUGISF
In a folder, I have 150+ raster files - some of them are pansharpened images, some are panchromatic images, and some are in other formats. Among them, 30+ pansharpened raster has the same naming format of date_ZoneName_pansharpened.tif  (e.g. 20180511_TX1_pansharpened.tif,  20180511_TX2_pansharpened.tif,  20180511_TX2_pansharpened.tif and etc.).… (Show more)
in python snippets
Load more items