Skip navigation
All Places >

python snippets

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

Recent Activity

rcostley_WaterInstitute
Hi! I have this piece of code that loops through a set of tins and creates contours. The piece of code will create a contour from the first tin, but on the next tin in the folder it says that the tin is unsupported. My last line of code calls it to delete a raster which I had working in memory "memory/tempraster", but now I've noticed when I don't… (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
shubhambhatia
I'm literally new to programming world and python is my first language. For a work i wanna use GP tools in a web page which will run basic operations on published layers.  Is it possible; if so how then ?
in python snippets
kjelly
I have a shapefile called (AOI) with multiple AOI's and wanted to colour them by ID so that they were all different.   I used: aprx = arcpy.mp.ArcGISProject('current') m = aprx.activeMap AOI = m.listLayers('AOI')[0] sym = AOI.symbology sym.updateRenderer('UniqueValueRenderer') colorRamp = aprx.listColorRamps("Cyan to Purple")[0]… (Show more)
in python snippets
newberry
Python (including arcpy) is fun when being used to process GIS vector data (point, line, polygon). However, it is tedious and inefficient compared to SQL. After all, SQL is the database language. Here,  arcpy.AddGeometryAttributes_management, arcpy.da.UpdateCursor, and SQL script were used to calculate field longitude and latitude in a point… (Show more)
in python snippets
Curtis.overholt@riotinto.com
a arcpy.management.SelectLayerByAttribute("(SHAPE_IN_CONTENTS)", "NEW_SELECTION", "LEASE_NAME LIKE 'ABC%'", None) arcpy.management.CopyFeatures("(SHAPE_IN_CONTENTS)", r"C:\Data\GIS\Project\Python\Python.gdb\(SELECTED_SHAPE)", None, None, None, None) arcpy.management.Dissolve("(SELECTED_SHAPE",… (Show more)
in python snippets
kumar_tfnsw
Hi,   I am trying to update the polyline layer using cx_oracle in python script. i read the feature details from another layer as sde.stastext and convert it as a  below format string.     When i insert the string value as bind value using sde.stgeomerty com  ['LINESTRING ( 9291551.34660000 4187266.23730000, 9291554.47640000 4187256.33170000,… (Show more)
in python snippets
shubhambhatia
For some work i was creating a tool which can add same field in attribute table of multiple feature classes. I wrote the script and it worked well but when i added this script to a tool; the tool didn't resulted in same results. I' m attaching screenshots for same. I'm kinda new to scripting and arcpy.
in python snippets
nabazgharib
I want to add feature service as a layer from AGOL to a map ArcPro  , how can I do it?
in python snippets
nbanerjee
Click to view contentHello,   I have a Python expression that utilizes a code block that I am trying to run as a field calculation (manual or with Field Calculator geoprocessing tool).  The code runs without issue, but returns nulls even if I hard-code the return value to a simple string.  I have tried going through line by line to better understand where/why it is… (Show more)
in python snippets
Load more items