A site-package created by Esri to expose GeoProcessing from ArcGIS to Python.

learn more… | top users | synonyms (8)

0
votes
0answers
7 views

pyscripter not recognizing arcpy environments or auto listing functions

Hi I'm able to use the main window in pyscripter to import arcpy and set an environment, workspace and perform tools. But I can't do anything in the "Python Interpreter" window. shouldn't this window ...
1
vote
1answer
23 views

How to create Circle using X,Y Coordinate and radius by ArcPy? [on hold]

I have been given three parameters X and Y coordinates and a distance or the radius of the circle. I will have to draw a circle using ArcPy by these three parameters where the center is the point of X-...
1
vote
2answers
32 views

Running Python script that includes ArcPy functions?

I have to export about 250 layers in one mxd File to maps in ArcGIS 10. I found a script on this site at Exporting each layer in map to separate image using ArcPy?: mxd = arcpy.mapping.MapDocument(...
0
votes
1answer
20 views

Opening Notepad text editor from ArcPy/Python? [duplicate]

Is it possible to use arcpy to open up an editor (like Notepad) to show a simple text file? I'd like to do this in a tool that generates text which is supposed to be copied and pasted into another ...
1
vote
1answer
17 views

How to turn off the visibility of a layer?

I'm making a geoprocessing tool with ArcObjects Java (IBasicGeoprocessingTool) and I need to make a layer not visible. I managed to get this layer as IFeatureLayer and I get an access to the map or ...
1
vote
0answers
28 views

Calculating polygon width ArcGIS 10.4

I am trying to calculate an average width of a large set of polygons. I found the script below researching the topic. The function is: def add_average_width(featureClass, averageWidthField='Width'): ...
1
vote
1answer
18 views

Invalid Input Data Error 000368 Running ArcPy tools in for loop

I am attempting to iterate over all the feature classes in a folder and I'm getting the error 000368. The other solutions in on SE were not helpful to me unfortunately, so I'm posting a separate ...
0
votes
0answers
20 views

Update data in attribute table based on value in separate column, same row [on hold]

I am trying to update data in one column of an attribute table based on data in another column to update the same row. For example, if one value in a column has the state abbreviation "HI" then ...
0
votes
2answers
32 views

Using Arcpy to copy features in a loop to a differing workspace

I've tried to create a script to loop through a folder and then clip the features. This works. My problem is that my new files are created in the same workspace (in my case Data) but I would like to ...
2
votes
3answers
176 views

Splitting a string field that contains time information

I have a text field within a FGBD that contains a date/time and I need only the time as a string. 'yyyymmdd HH:mm:ss' And I need: 'HH:mm:ss' I've tried .rsplit but I'm not using it correctly. I ...
1
vote
1answer
31 views

Invalid Output Workspace error when executing Slope_3d as WPS

I wrote a small toolbox that calculates the slope in degrees of a given .tif file, stores the ouput to a local folder on my computer and generates 2 by 2 tiles. The toolbox works fine, the publishing ...
3
votes
1answer
24 views

Error when running Extract by Mask Script

I am using ArcGIS 10.3 Desktop to write a script tool to, among other things, extract raster data using a mask. I keep getting these errors: ExecuteError: ERROR 000875: Output raster: C:\...
1
vote
1answer
35 views

Get Raster Centroid using Arcpy

Purpose:To take an input raster image and clip its shape to a parcel block. In later stages this model will be applied to a loop. Logic: The Model receives an input raster image and calculates a ...
0
votes
1answer
33 views

Using memory management and error handling to improve performance of ArcPy script? [on hold]

I have an ArcPy script that adds new fields and then deletes unnecessary fields from a group of feature classes. I am a novice at ArcGIS and even more so at ArcPy, but have been able to piece together ...
0
votes
0answers
24 views

Truncate and Load/append/copy data from Feature Dataset to Feature Dataset [on hold]

I have a SDE featuredataset which contain 20 layers updated every month and historic featuredataset which have the layers from the last month. it is not a big volumen of data, something like 10000 row ...
1
vote
0answers
19 views

Why .getOutput(0) is needed after GetCount_management? [duplicate]

parcelCount = int(arcpy.GetCount_management("Parcels_lyr").getOutput(0)) print parcelCount while parcelCount < 200: arcpy.SelectLayerByLocation_management("Parcels_lyr","WITHIN_A_DISTANCE",\ ...
0
votes
1answer
27 views

Toggle Graphic Element inside ArcMap's Layout View using Arcpy

I am trying to toggle unwanted graphic elements inside of ArcMap's layout view before exporting them as a pdf. I have no problem reading the correct graphic element or relocating it to another ...
0
votes
4answers
64 views

Copying feature from one feature class to another without creating new feature class?

i need to copy a line feature from a line feature class to another existing feature class without creating a new feature class. As copy feature tool creates the copies feature in a new feature class ...
0
votes
2answers
34 views

Choosing data type to use for input as feature class or shapefile in Python script tool using ArcPy?

I am writing a Python script tool within a toolbox with *.tbx extension. I need to make the input parameter flexible (feature class or shape file) , so which data type I should select for this ...
0
votes
0answers
13 views

Creating two multi-choice lists for field value selection in ArcPy? [on hold]

Related to one of my other questions (Creating multi-value choice list of field values and using selected for select in ArcPy?) I have a follow-up question. I have set up two of these multi-choice ...
-1
votes
1answer
25 views

Finding common two vertices for two adjacent polygons and drawing line feature connecting them in ArcGIS for Desktop?

I need to find the common two vertices between two adjacent polygon and draw a line feature connecting these two common vertices: I have tried the following code but it is not working: polygon1 = ...
0
votes
2answers
26 views

Converting all values in attribute table to zero (0) in shapefile using ArcPy?

I'm looking for a python script using ArcPy that can convert all values in a shapefile's attribute table to a value of 0 as I will then populate with other values from another source. I have ...
0
votes
0answers
11 views

how to set a default value for GPFeatureLayer parameter in arcpy [on hold]

I'd like to provide a default value for a GPFeatureLayer parameter in arcpy. The parameter is created like this: paramPointFeatures = arcpy.Parameter( displayName ='A point layer', name ='...
1
vote
3answers
30 views

arcpy field mapping for a spatial join: keep only specific columns

I want to perform a spatial join to find the join point (a node in the code below) that is closest to a target point (a consumer in the code below). In the result, I only need certain attributes from ...
0
votes
0answers
35 views

I can't import arcpy to python in arcgis. What do I do?

I'm running ArcGIS 10.3 on Windows 10. I get an error message when I try to import arcpy. I'll include the error message that I print screened. Should I just un-install ArcGIS and reinstall it? or ...
1
vote
1answer
30 views

ArcGIS Calculate Field, Python Shape Expression

Using ArcGIS 10.1 and Python 2.7- I am trying to write an expression that calculates the mid point of a line. I've tried many different expressions, but I continue to get syntax errors. #An example ...
0
votes
0answers
30 views

Set Script Tool Parameter to Accept Either Input or Output

I've created a script tool that has an optional output parameter of an Excel Workbook. If it's populated, the script will add a new worksheet. However, every time the tool is run, ArcGIS is somehow ...
0
votes
1answer
30 views

Can't get new rows added with Arcpy / InsertCursor

I'm not getting any errors but can't seem to get these rows added. Everything else in the script works fine. I only dabble with Python occasionally so please forgive me for missing anything obvious ...
1
vote
1answer
15 views

Arcpy MakeFeatureLayer_management issue using SQL condition

I have a lines shapefile. I made a small code to select some of its elements and turn them into a standalone layer. The code is like this: arcpy.env.workspace = r"C:\MyDirectory\Mygdb.gdb" network = ...
1
vote
0answers
57 views

Using file opened by GUI in python?

I have these lines of code: import tkFileDialog, arcpy, arcpy.da, numpy as np, Tkinter import arcpy.mapping as mapping fc = tkFileDialog.askopenfilename(filetypes=[('shapefiles','*.shp')],title='...
1
vote
2answers
41 views

Problem looping and summing rasters using ArcGIS 10.3 and Python Script

I need a python script that seeks to cycle through a number of viewpoints, deriving an AGL raster in each case (using arcpy.Viewshed_3d) and progressively summing the AGL rasters into a single ...
0
votes
1answer
31 views

Parsing error SyntaxError: EOL while scanning string literal (line 5)

I want to create a number of featureclass using a template featureclass import arcpy from arcpy import env env.workspace = "C:\new_docs\BIO-FILES\GIS_prog\Lesson1" arcpy.CreateFeatures_management('C:...
1
vote
1answer
21 views

lyr replaceDataSource not reflecting

The changes I made to the MXD with ArcPy is not reflecting the changes in ArcMap. arcpy.env.workspace= "C:\Users\UserID\Desktop" mxdlocation=os.path.join(arcpy.env.workspace,mxdname) mxdloc = ...
0
votes
0answers
29 views

Updating table from Excel spreadsheet using ArcPy? [closed]

This is my code import arcpy arcpy.env.workspace = r"D:\Users\ShawnO\Desktop\PythonExercizes\Parcel_Ownership_update_model\Parcels.gdb" # Local variables: Parcel_Owners = "D:\\Users\\ShawnO\\Desktop\...
0
votes
0answers
22 views

ArcGIS 10.3.x Python tool script - Automatically adding multivalue output feature class to display

I am developing a Python tool script in ArcGIS 10.3.x that is meant to be later published as a geoprocessing service. The tool script produces two output feature classes that I would like to ...
1
vote
2answers
51 views

Iterate over multiple shapefiles, changing year from “2014” to “2015” in file name

I have about 50 shapefiles I would like to change each of their file names which contains "2014" to "2015". I would like to use a python script but have not been able to figure out how to do it. I ...
2
votes
1answer
128 views

Arcpy.da.SearchCursor() help when attribute doesn't exist

I'm updating text elements off of an arcpy.da.SearchCursor script and needed to construct the script to return a response for when the attribute does NOT exist. Here is the snippet of the code THAT ...
0
votes
1answer
45 views

Python new packages installation with ArcGIS interpreter?

I would like to introduce some functions derived from scipyin my code. Since I also need arcpy, I use the Interpreter installed inside ArcGIS, whose directory is: (C:\Python27\ArcGIS10.3\python.exe). ...
0
votes
0answers
20 views

How can Auto connect the two points with layer HW by ARCPY [closed]

How can Auto connect the two points with layer HW
1
vote
1answer
36 views

Appending Feature Class from Geodatbase to another using ArcPy?

I'm trying to write a python script to load feature class from an existing geodatabase to a new one, here is my script: import arcpy from arcpy import env import os import traceback #Set up ...
0
votes
0answers
21 views

Pixel based 10 year NDVI time series

I would to do pixel based 10 year NDVI time series analysis using MODIS data. I’ve 3 seasons in a year. Should I average all values in the study area per season?
0
votes
1answer
34 views

Finding field with maximum value and field name using ArcPy cursor?

I was wondering if an equivalent of summary statistics exists for finding such statistics across fields rather than records in a table. For example, of several fields, I wanted to find which one has ...
2
votes
1answer
45 views

How to set a python code to trigger on any update on a feature class

For example, when I have a geometry change on a point, I would like to update the X and Y fields to the new current location, I understand how to make the code, but not where do I set or put it to be ...
2
votes
3answers
74 views

ArcPy find points that are paired in time and space

I have a shapefile that that is time stamped and tracks two animals. I would like to create a field that denotes "together" based on proximity and location. And example of the data is: time ...
-1
votes
1answer
40 views

Trying to copy all feature classes from one folder to another folder using python but it failed to run

try: arcpy.env.workspace = "C:/WCGIS/Geog485/Lesson1" fcList = arcpy.ListFeatureClasses() for featureClass in fcList: arcpy.CopyFeatures_management(featureClass, "C:/WCGIS/Geog485/Lesson2/...
1
vote
0answers
17 views

Dataset C:\msurya\teritory.sd does not exist or is not supported Failed to execute (UploadServiceDefinition)

I am trying to execute the pythonscript code for the automation of a mapservice. While execution tempdraft.sddraft, and updatedDraft.sddraft files are automatically generated but .SD file has not ...
0
votes
0answers
46 views

Data Driven pages to PDF Python

I am trying to get a script to export each selected data driven page to a pdf. Basically I want each page of the data driven pages in its own PDF. I tried using the method from this page https://blogs....
0
votes
0answers
15 views

A Dynamic Office Address [closed]

This is a strange question, which I am trying to python my way out of, but to no success. I am trying to make a set of GIS templates created for my company (33 office locations all over the eastern ...
2
votes
0answers
18 views

How to export specific DDPs from a set of DDPs?

I have a set of data driven pages and I would like to have a string parameter in the tool that allows me to export specific pages from the set of data driven pages. An example would be if I had a set ...
1
vote
2answers
23 views

Where are Service Area Layers? How to delete them?

Using arcpy I can make a service area layer in Network Analyst like this: outSAResultObject = arcpy.na.MakeServiceAreaLayer(inNetworkDataset, outNALayerName, ...