Skip navigation
All Places >

python snippets

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

Recent Activity

mrosenberg57
I am trying to join an Oracle table to a feature class but have not found success yet... Here is my code: # Import arcpy moduleimport arcpyfrom arcpy import env #Set Variables parent = "Database Connections\\db.sde\\db.DBO.layer"child = "Database Connections\\db.sde\\db.DBO.layer2"codeList = ['SC21', 'SC22', 'SC23', 'SC24', 'SC25', 'SC26', '2C27',… (Show more)
in python snippets
xander_bakker
Recently a question made me think of how to calculate statistics of all fields (all attributes) for each record of an attribute table. See thread here:how to add up all the fields in an attribute table    The OP actually wanted to get the summary statistics of a field (not sum all fields of a record), but I thought I would share a snippet of how…
in python snippets
griner
I don't understand when an input argument to an arcpy function that says it takes a layer as an input but it really only works when I give it the name of the layer. Specifically: I use the arcpy.mapping.ListLayers() function to get a list of all the 'layers' in my mxd. I then search through this list to find the layer for which the .name value of… (Show more)
in python snippets
geo.harsha
I have a point feature class with more than 10 million records, when I give the input to MinimumBoundingGeometry_management  geoprocessing tool using CONVEX_HULL geometry type using arcpy module in arcgis ,i am getting the minimum bounding box polygon as the output.But I want the output polygon vertices to exactly align the input… (Show more)
in python snippets
griner
Tabulate intersection for different geometries produces inconsistent outputs. I have class features in layers of point, line and polygon geometries.  I'm using TabulateIntersection_analysis to to determine the portion of each class feature that is in a county (using a polygon layer of county boundaries).  So, the Zone layer has to be the county… (Show more)
in python snippets
behClevest
Using ArcGIS 10.4, what Toolbox is the equivalent to performing manual join in ArcMap between a Vector Feature Class and a Table? I am trying to create a GIS Model in Model Builder and I need to Join a Shapefile to a .dbf table so I used Add Join from the Toolbox which looks is for Raster datasets! ESRI Claims that the Add Join tool Joins a layer… (Show more)
in python snippets
behClevest
I am trying to create a Python Toolbox tool which is supposed to add two fields State and StateAbb to selected Shapefile from selected combobox. How I can add a Combobox which contains a list of US states to the Tool? import arcpy class Toolbox(object):     def __init__(self):         """Define the toolbox (the name of the toolbox is the name of… (Show more)
in python snippets
n.ueberschaeresri-rw-esridist
Hi folks,    I managed to calculate the distance between two points (from two different feature classes) using the vincenty module from geopy.distance.  For quite some time I struggled to find out why I got wrong distances. (even to realize it took me some time) In the end I figured that the vincenty module requires the coordinates in… (Show more)
in python snippets
srikanthku
Hi All,   I am working on task to update MultiPatch data published as a Web Layer to ArcGIS portal, To achieve this I have written python script to overwrite Web Layer by referring to Upload Service Definition—Help | ArcGIS for Desktop .   But ended with error!! ExecuteError("ERROR 999999: Error executing function.\nService name… (Show more)
in python snippets
Load more items