Skip navigation
All Places >

python snippets

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

Recent Activity

MatthewLeonard
ArcGIS custom toolbox which uses a python script, for updating a mass amount of field aliases at once, using a list of field names and corresponding aliases input by user. Let’s say you have an ArcGIS feature class or table with a bunch of cryptic, abbreviated field names, and you want to add aliases to make them easier to understand. Let’s say…
in python snippets
nagaraju45
hi any one pls help me, i have one doubt.... i have one gdb, in that gdb tables, data sets and relationship clases i want to export to csv in pycharm with all relationship classes names, primary key, foreign key, cardinality(1-M / M-N) in python script. pls send me the code.
in python snippets
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
Load more items