Skip navigation
All Places >

python snippets

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

Recent Activity

I have a question… i need to replace a text part in all my tables in a geodatabase e.g. Apple by Orange I have +/- 50 tables with multiple fields, and I need to replace every text block by another The find and replace function in ArcMap doesn’t work Big tank you
in python snippets
Click to view contentI am a computer science student and I working on this project; Goal: Python script to publish hosted feature layer to AGOL from a geodatabase. To eventually move features to Open Data. I am referencing my arcpy object to a Pro project in which lives a gdb file. I store the list of items from the gdb into a list called lyrList that is sent to my… (Show more)
in python snippets
I have a set of file geodatabase tables that are an output form another process.  From that output I created a subset based on part of the filename.  I would like to merge all these files together but the merge tool will not work because in some tables a field with the common name "PROJECT" differs in length.  My solution is to add a new field… (Show more)
in python snippets
Can anyone help me to iterate through folders which contain number of shapefiles in it and join them to other shapefiles in different folders and later export as a separate file after joining. I tried it doing using model builder, somehow it worked, but is kind of manual and is really time consuming.  It would be of a great help, if there is a… (Show more)
in python snippets
Hey all,   I have some text files with x,y coordinates in them. I created a script that finds the specific .txt files that I want and then puts them in a list. Then it creates corresponding EMPTY feature classes for them. I'm trying to use an insertcursor to populate the empty feature classes with the contents of the text files. However, I'm… (Show more)
in python snippets
Click to view contentI need to take vertex coordinates and draw them as polygons using da.InsertCursor. However, it is giving me random results. The script keeps running but many features show empty geometry:     Here is the code I use with 2 ticket examples - one can be inserted with geometry but the other one not. # Define Ticket class Ticket(object):     id = 0… (Show more)
in python snippets
Can someone please assist me with the following task at hand:   I need to export the coordinates of polygon vertices in the following format: Polygon_1, y,x ; y,x ; y,x ; y,x ; y,x   I have 120 000 vertices that needs to be exported in this format (either txt or xls). I have used export feature attribute to ASCII and export as table, but it… (Show more)
Hello guys, is there someone who were annoyed by this kind of problem? So, first of all I want you to notice that the feature class Roads has a POLYLINE geometry type, and there are no multipart features in it. import arcpy for i in arcpy.da.SearchCursor(r'C:\Users\...\Administrative_area.gdb\Roads', ["SHAPE@"]):     print(i[0]) Normally, the… (Show more)
I run a Python script to delete and recreate a set of map services.  To do this, I place a folder with all the mxds and data in the same directory as the existing folder, with a different name. The script then renames the folder using os.rename, and then uses that data for the new map services.   The problem is, I get an 'Access Denied' error… (Show more)
in python snippets
Load more items