Questions tagged [arcpy]

A site-package created by Esri to expose ArcGIS Desktop (ArcMap and ArcGIS Pro) geoprocessing, mapping, etc, to Python.

Filter by
Sorted by
Tagged with
5 votes
1 answer
1k views

Python window vs Toolbox script in ArcGIS for Desktop?

My question is similar to Adding Layer in current session using ARCPY . My script works in ArcMap python window but not as a script in toolbox. I am running ArcGIS 10.0 SP4. The script is given below,...
techtonic's user avatar
5 votes
2 answers
2k views

Problem with the where clause in ArcGIS when dealing with variables

I am writing a python script for ArcGIS. I have an input feature class which contains multiple pipelines which is saved as a variable InputPipeline. I would like to iterate through the pipelines and ...
Fezter's user avatar
  • 21.9k
5 votes
2 answers
3k views

Running ArcPy script from ArcObjects?

the standard method requires to run ArcPy script in command line, i've struggled with it to run but without a result, i can import arcpy, set the workspace to the geodatabase path and describe the env ...
geogeek's user avatar
  • 4,566
5 votes
2 answers
3k views

Calculating slope cell-by-cell in ArcPy?

I am relatively new to the ArcGIS-Python environment and want to calculate elevation raster slope. But it says "ValueError: setting an array element with a sequence". Below code is what I have. ...
Ibe's user avatar
  • 1,231
5 votes
1 answer
13k views

Adding field in attribute table using ArcPy [closed]

I have researched How to add attribute field to existing Shapefile via Python without ArcGIS? but could not implement it. Can give me examples of how to add field name in attribute table? I have ...
Mehul's user avatar
  • 179
5 votes
1 answer
4k views

Create a definition query for groups of layers: Is it possible?

I have a large number of groups created, with each group having many layers. I have looked for a way to set a definition query for all the layers in each group but haven't found anything. Is it even ...
amasephy's user avatar
  • 1,234
5 votes
2 answers
3k views

Creating Loop to replace text in page layout in multiple MXDs instead of one MXD at a time?

I found some code on a website that will perform a search and replace on page layout text elements. Currently you can only do it one MXD at a time. I was hoping to change the code so I can do a search ...
user1830's user avatar
5 votes
2 answers
791 views

Automating line adjustment to a point or a series of points in ArcGIS Suite?

There are multiple toolboxes in ArcGIS Suite that deal with geographic transformation and correction, such as Spatial Adjustment, Rubbersheeting, and Snap. I'm not sure how to best use a tool to ...
JMNC's user avatar
  • 197
5 votes
3 answers
3k views

Use ArcPy to move feature classes to feature dataset

I have a file geodatabase. I am using Python to manipulate data. I have a bunch of feature classes in the root of the FGDB. What I need to do is to loop through them and move all of them into a '...
IrfanClemson's user avatar
5 votes
1 answer
407 views

ArcMap crashing when plotting features with matplotlib few times via Python AddIn?

I made a 3D line plot Python add-in with matplotlib for ArcMap. After I execute this tool 3-4 times, ArcMap crashed. I have also executed it in the Python window, but the situation is just the same. ...
Kayson Cho's user avatar
5 votes
1 answer
2k views

How to only ask for a input if checkmark has been checked? (arcgis script tool)

I am currently working on a python script, that i want to convert to a tool. I have managed to set it up in Arcgis as a tool, but it does not behave exactly as i want it to: What i want it to do ...
Jonas's user avatar
  • 447
5 votes
1 answer
168 views

Python script into model

I have a toolbox to share with my collegaues, it includes a model and imported python script. This script is also imported to the model in the end of session. When I share this toolbox to another PC, ...
Pavel Pereverzev's user avatar
5 votes
1 answer
274 views

Update from/to Z from attributes using arcpy Update Cursor

Trying to update Z values onto some point and line features from the level attributes on each feature. My script works fine on points - the previous Z values of 0 now have the same values as the ...
Midavalo's user avatar
  • 29.7k
5 votes
1 answer
121 views

Change entire label style after certain extent

I need to design a dynamic label in ArcMap that changes its entire style after a certain zoom extent. The research I've done suggests to me that there is currently no way to use VBscript to manipulate ...
Alex92's user avatar
  • 461
5 votes
1 answer
2k views

Python script to print the feature classes which are referencing AGS map services

I have an AGS site and need to identify which feature classes in my SQL Server DB reference the AGS map and feature services. I am not familiar with this environment and would like to automate the ...
Geoffrey West's user avatar
5 votes
2 answers
3k views

What is the correct syntax for the geometry object's "intersect" method in ArcPy?

I'm building a script that utilizes the intersect method of the geometry class so that I can run an intersect analysis on individual polygons within a feature class. As stated here, "intersect (other,...
CStarbird's user avatar
  • 141
5 votes
1 answer
1k views

Managing environment variables in arcpy?

The Arcpy documentation seems to suggest that when writing python scripts that utilize/modify variables in arcpy.env, you should wrap everything in a bunch of try/except/(finally) loops with custom ...
Paul H's user avatar
  • 915
5 votes
1 answer
828 views

Cutting a circular buffer via Arcpy

I am currently working with compressor stations on centerline routes. These compressor stations have a 3 mile buffer surrounding them. I wish to cut a portion of the circular buffer off. These cut ...
GIS_ROOK's user avatar
5 votes
2 answers
486 views

Arcpy: Names and distances of nearest intersecting roads in layer 1 to end points of a road segment from layer 2

As shown in the image below, I'd like to return a new field in layer 2 that for each segment stores a string:"Road C, 1 km from Road A to 0.5km From Road B". Calculation of the distances could be ...
dassouki's user avatar
  • 8,563
5 votes
1 answer
12k views

Calculating geometry area in ArcGIS Desktop using ArcPy?

I have a polygon shapefile and I want to write a Python script to add a field named "area" and calculate its geometry areas. The script is like this: arcpy.AddField_management("...
chy's user avatar
  • 103
5 votes
1 answer
477 views

Changing default IDE for editing Validation code in ArcToolbox?

Do you know a way that I can change the application that opens the validation scripts in ArcGIS 10.2? At the moment hitting Edit... opens up Notepad, which ain't that friendly an IDE.
spk578's user avatar
  • 1,516
5 votes
1 answer
3k views

Defining Feature Set parameter for ArcGIS Python Toolbox tool?

I'm trying to create an ArcGIS Python Toolbox tool which uses a polygon for input. I want the user to be able to create the polygon when the tool is run. I know how to do this using both a ...
Mathiaskopo's user avatar
5 votes
4 answers
7k views

Using PyScripter with ArcGIS for Desktop?

Can someone please let me know how I can set the PyScripter 2.5.3.0 x64 works with Python 2.7.3 which comes with ArcGIS what I did was: I installed the ArcGIS 10.2 I installed PyScripter 2.5.3.0 x64 ...
user1106951's user avatar
  • 1,498
5 votes
1 answer
2k views

Editing PostgreSQL geodatabase table using ArcPy?

I'm trying to update a table using a python script and it's not working. The table resides in a postgres geodatabase and is versioned. I have also verified my user permissions (I'm the admin). The ...
ShaunLangley's user avatar
5 votes
1 answer
2k views

Getting ArcPy autocomplete to work in IDLE?

I want to write scripts in IDLE, but I love how the built in python window in ArcGIS 10.2 automatically fills in the module names as you start typing them. For example, if I type arcpy.Lis..., the ...
Elliott's user avatar
  • 819
5 votes
2 answers
321 views

Field calculator script to work out first 5 dominant area fields?

I have 5 fields of different landcover types with areas of each and found below: > PRC_Water| PRC_Bare| PRC_Urban| PRC_LVeg| PRC_LVeg| > 5 20 40 20 15 I have ...
Jens Hiestermann's user avatar
5 votes
2 answers
679 views

Running Python 2.6 and 2.7 in ArcGIS Desktop?

I figure that there must be a way for me to run python 2.6 and 2.7 on the same computer. I've got a program that requires 2.7, but ArcGIS 10.0 requires 2.6. I'd like to be able to run both programs ...
Tom Dilts's user avatar
  • 419
5 votes
1 answer
171 views

Detecting densely labelled areas in ArcPy?

I'm trying to detect densely labelled areas for a given scale like explained below. so dense labelled area is the area having high rate of overlapping labels. I'd like to detect densely labelled ...
geogeek's user avatar
  • 4,566
5 votes
2 answers
7k views

Using arcpy from the command line on ArcGIS Linux Server 10.1

We installed ArcGIS SERVER (not Desktop!) 10.1 on a RHEL (Red Hat) machine. ArcGIS Sever is supported for Linux. However, it appears they don't make it easy to script in python, from the command ...
CPBL's user avatar
  • 280
5 votes
2 answers
2k views

Creating polyline buffer with ArcPy?

I'm trying to write a python script with ArcPy that draws arcs and I've achieved something with creating a buffer and then clipping it with a bounding box so I only keep the length I need (I thought ...
fgcarto's user avatar
  • 1,524
5 votes
3 answers
882 views

How not to Copy Features when too many would be output?

This question has already been posed to the ArcGIS Geoprocessing forum but I have had no responses there. I have a 3.5 million polygon layer (cadastre) stored in Oracle via ArcSDE. I use a polygon ...
PolyGeo's user avatar
  • 65.1k
5 votes
3 answers
1k views

Merging edited data back into ArcSDE master geodatabase?

I need some suggestions/inspiration for a problem we have. The problem: We have an ArcSDE master GIS database. We will edit this data almost exclusively outside of ArcGIS and outside of ArcSDE. In ...
tmske's user avatar
  • 815
5 votes
2 answers
739 views

Issues with osgeo - qgis.core and arcpy modules

Is it possible to have the python shell from either qgis or argis to load (import) both qgis.core and arcpy? I am developing a metadata creation tool and have completed the core functionality using ...
GeorgeC's user avatar
  • 8,228
5 votes
1 answer
3k views

Updating point geometry based on geometry of another feature class using arcgisscripting?

I'm looking to update the point geometry of lets say "oldFC" by obtaining the shape geometry of "newFC" and applying that to the "oldFC". I also want it to grab the value in the ID field in "newFC"...
amasephy's user avatar
  • 1,234
5 votes
2 answers
10k views

Resolving ImportError: No module named arcgisscripting?

I am trying to run an ArcGIS python script from Eclipse and get the following message: ImportError: No module named arcgisscripting I can run this in IDLE... any ideas?
GuidoS's user avatar
  • 1,174
5 votes
2 answers
3k views

Get feature class names inside ESRI File Geodatabase

I have a project folder with many many folders within that. Some of these child folders contain an ESRI File Geodatabase(s). I want to list all the feature classes that are inside the GDBs that have ...
MapsEveryWhere's user avatar
5 votes
1 answer
839 views

Selecting LiDAR return point type in LiDAR dataset with ArcPy?

I am trying to create a Digital Earth Model (DEM) using ArcPy under ArcGIS Pro 2, but I am running into some problems. I can generate a DEM within ArcGIS Pro by selecting only the ground points ...
user44796's user avatar
  • 1,925
5 votes
1 answer
439 views

List all MXDs that a feature class is in using arcpy

I know it is possible to list the paths of feature classes that are in an MXD using arcpy. But is it possible to do the reverse -- to list all the MXDs that a feature class is in? I am trying to ...
pokateo's user avatar
  • 53
5 votes
2 answers
1k views

Memory leak in ArcGIS Pro: in_memory workspace is not deleted

I have a python script for ArcGIS Pro 2.0.1 that executes the same code with the same data size in a loop. So intuitively the run times of the iterations of the loop shall be about the same. However, ...
elena_grigoreva's user avatar
5 votes
1 answer
214 views

Checking which application Python toolbox was launched from?

Esri's documentation on Python toolboxes states, 'When the script is run as a script tool, arcpy is fully aware of the application (such as ArcMap) it was called from.' How can I check which ...
Ian Yau's user avatar
  • 369
5 votes
1 answer
2k views

Attaching ArcGIS Online attachments in bulk?

I have an ArcGIS for Desktop Advanced license. I have an attachment enabled feature service in ArcGIS Online. I have thousands of files I wish to attach to it. By current process convention, these ...
Alan Leuthard's user avatar
5 votes
3 answers
1k views

Improve the speed at which arcpy creates a layer object

Is there something happening on the back-end, that makes the process below so slow, that can be avoided to speed it up? It is taking between 5 and 7 seconds to turn one layer file (.lyr) into a layer ...
Kristen G.'s user avatar
  • 1,100
5 votes
1 answer
2k views

Error when using arcpy.ArcSDESQLExecute() to connect to SQL Server - ArcGIS 10.4

I am able to connect to a MS SQL Server 2012 geodatabase with the arcpy.ArcSDESQLExecute() when using the .sde connection file pre-created in ArcGIS. I am not able to connect to a MS SQL Server 2012 ...
Alex Tereshenkov's user avatar
5 votes
1 answer
616 views

Changing the legend element anchor point using ArcPy

Is it possible to changed the legend element anchor point using ArcPy? This is the default anchor point: and i want this anchor point location: I know how to changed the legend element position x,y. ...
newGIS's user avatar
  • 4,062
5 votes
1 answer
306 views

Using findAndReplaceWorkspacePaths to change picture path element- ArcPy

Picture element, in 60 MXD files, disappear and there only blanked rectangle instead. I know one way to solved it, by go to the picture properties-->picture tab. But i try to find a way do it with ...
newGIS's user avatar
  • 4,062
5 votes
1 answer
2k views

Running Python toolbox tool both standalone from other tools within same Python toolbox?

I have created a Python toolbox for work that has two tools inside. These tools use the toolbox template and so have a init, getParameterInfo, etc. I want to be able to run one tool both standalone ...
user avatar
5 votes
2 answers
1k views

Creating numpy.array with variable number of fields to test arcpy.da.ExtendTable performance?

There was anArcPy Café blog posting entitled Adding Fields: Performance Tips which advocated: Two approaches to help increase performance when adding numerous fields to a table or feature class. ...
PolyGeo's user avatar
  • 65.1k
5 votes
1 answer
1k views

How to automatically check for lidar flight line overlaps?

I have a series of lidar-based raster products created via FUSION. Since I am working with low density lidar data, many of the raster images show significant striping where lidar returns overlap on ...
Aaron's user avatar
  • 51.7k
5 votes
1 answer
920 views

Arcpy Pythonaddins Equivalent of arcpy.GetParameterAsText

I've build a neat little search arcpy script. The user opens any mxd, zooms to a location, chooses a corporate fGDB, and runs the tool. The user gets a list of all the populated feature class that ...
GISI's user avatar
  • 1,169
5 votes
2 answers
3k views

Using GROUP BY clause in arcpy.da.UpdateCursor

I need to specify a "group by" clause for UpdateCursor arcpy.da. From here I found out that it's possible to do using an optional pair of SQL prefix and postfix. But there are no examples and I'm ...
ievgenii's user avatar
  • 161

1
15 16
17
18 19
212