Skip navigation
All Places >

python snippets

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

Recent Activity

n.ueberschaeresri-rw-esridist
I am replacing square brackets by round brackets with help of a python script - works perfectly.  But I also want to replace a single word by another word (Cruise -> Campaign): nothing happens.    Here is the part of the script:    r = csv.reader(t, delimiter="\t") all=[] header=r.next() #arcpy.AddMessage(header) for fields in header:… (Show more)
in python snippets
psrapsar
Hi ,   I need to find if the given lat, long point is falling under a SDE Polygon featureclass or not using arcpy. I am using SelectLayerByLocation_management. But, it is running slow (4 sec). I need to make this as fast as possible (in milliseconds).   Can anyone help me?
in python snippets
Holisticbynature
So this was just a play tool idea I had, but I ultimately was not pleased with how I ultimately handled the inputs. The input is literally text, and I thought about remap tables or other objects but was not sure it was much better. I actually would like input or advice on an appropriate input past the solution I made. Code is revealed in the the…
in python snippets
behClevest
Using following ArcPy snippet, I am able to get Extent of current map   import arcpy  import arcpy.mapping  ## Sets the MXD file  IMXD = arcpy.mapping.MapDocument("CURRENT")  ## Sets the Dataframe  DF = arcpy.mapping.ListDataFrames(IMXD, "Layers")[0]  print DF.extent    as: 417939.472327849 241487.977474999 477757.540444938… (Show more)
in python snippets
n.ueberschaeresri-rw-esridist
I didn't really know how to word my question in only a few words for the head line... Let me try to explain my problem:    I have a script that attaches .png files to point features. The idea is to have those files matched to the point that have the same UID as the point.    def AddAttachmentsToUid():    … (Show more)
in python snippets
MTCGIS
I'm working to develop a python script which merges two feature classes into one. I found the following arcpy example quite helpful, however it's only provides an example of how you might approach the problem of mapping input fields with different names and logically similar content for 1 input field from the 2 feature classes. My issue is that I… (Show more)
in python snippets
behClevest
Can you please take a look at this example and let me know how to I can replace Data Source data of a layer in a saved mxd map (Fuse) to a layer called SDEElectric.DBO.Fuse which is in an enterprise geodatabase through database connection   I tried this code but it didnt work import arcpy mxd =… (Show more)
in python snippets
n.ueberschaeresri-rw-esridist
It's me again with lots of cruises/campaigns, points and txt files but now I have additionally polygons to create.    This is my main script:  def main():     # Step 1: find the source files to process     list_of_files=[]     list_of_files = FindFiles(location_for_tables)         # Step2: prozess each file to data for points     for each_file… (Show more)
in python snippets
Dan_Patterson
Reference:  Calculate Distance.                    Date: 2017-08-22   Cumulative DistanceIf you want distance from the first point in a data table to every other point in sequence,  then use cumulative distance function below. Do the following: select Python parser toogle on Show  code block paste the following in the Pre-logic Script Code… (Show more)
Load more items