ArcPy is a Python Site-Package developed by Esri for use with its ArcGIS platform at version 10.x and above. It offers a high-level implementation of Esri's ArcObjects programming library.

learn more… | top users | synonyms

-1
votes
1answer
17 views

Solar energy conversion w/m^2 to mj/m^2

i am new here, I am using MERRA monthly solar radiation data. I want to convert w/M^2 to MJ/m^2 I am bit confused, how to convert solar radiation monthly average data W/m^2 to MJ/m^2 so far i ...
1
vote
1answer
28 views

How to randomly keep values to a specific numbers and replacing rest with no data in 2d numpy array without changing anything others

I am new in scientific computing. I have a 2D numpy array(say, A) with shape as (11153L, 4218L), datatype is dtype('uint8') .Now, I want to keep data at some(say, 10000) random positions (row,col) and ...
0
votes
0answers
13 views

Python API Call : pyzillow : Extract Real estate information from Zillow and convert it into a Shapefile

I am trying to extract the real-estate information from Zillow using the pyzillow API.I am trying to get a point shapefile having all the houses for sale information so that I can interpret them in ...
0
votes
0answers
11 views

Cursor erroneously adding duplicates to list

This script iterates through a .dbf table searching for "to" and "from" records and adding each to a list until a certain record is found. It is supposed to be checking if each ComID is in the list, ...
0
votes
1answer
28 views

Numpy savetxt error

Below is the code I am struggling with as a beginner: commonfields = arcpy.ListFields(gt_pnts) names = [f.name for f in commonfields] needed_names = names[3:] gt_pnts_arr = arcpy.da....
0
votes
0answers
25 views

Perform Kriging Interpolation using Arcpy

I have list of point feature class. I am trying to write a python script to perform Krigging interpolation. I am getting error massage in this code "Point_Num" is not defined, Below script i am ...
0
votes
1answer
21 views

ArcGIS and Python

I'm trying to get my head around python integration in ARC. But we don't learn it till next semester, however I see it fit to fulfill my need for my project. (Took second semester project in first) ...
0
votes
0answers
29 views

Installing pip for arcpy

I'm attempting to install pip for arcpy (arcgis 10.2 on windows 7). Running get-pip.py results in the following error message: X:\python>python get-pip.py Traceback (most recent call last): File ...
1
vote
0answers
21 views

Arcpy multiple ring buffer error 000210: Cannot create output

I have problem using MultipleRingBuffer_analysis from arcpy library. Script that was previously working (14 days ago) and i havent touched it now suddenly stopped working and started returning this ...
-2
votes
0answers
37 views

Draw a histogram from raster image

I have a GeoTIFF image and the dimensions of the rasterized image are 2737 x 1994. I want to draw a histogram from this rasterized image. I don't have any idea how to do it using ArcPy or NumPy. How ...
0
votes
2answers
19 views

List field names of layer in MXD file

I have an ArcMap file (.MXD) that I want to search for its layers and then pick a layer and have Python show me the field names of the attribute table of that layer. I have gotten so far that Python (...
2
votes
3answers
75 views

Call a Python 2.7 module in Python 3.2

I have a GUI program that I have developed in Python 3.2 to extract various geospatial data products. I need to call a module I have developed in Python 2.7. I am looking for a way to be able to ...
0
votes
0answers
11 views

Why is 12 hour time being printed as year in Python?

I have a data set that I would like to make calculations on using a date field with a time value in an Oracle database in ArcGIS for Desktop. The name of this field is 'ORIGDTTIME'. A sample value ...
-2
votes
1answer
18 views

How do I get the length of shortest route by arcpy after solve the NA

I use arcpy.na.MakeRouteLayer build a layer, and use arcpy.na.AddLocations add two stop points, and use arcpy.na.Solve get the shortest route. But how can I get the length of the shortest route.
0
votes
0answers
12 views

How to batch set symbology to Proportional Symbology in ArcMap?

I am mapping Noxious weed infestations using point data in ArcMap 10.3. Each point has the square footage of the infestation listed in the "WeedArea" field in the attribute table. Depending on the ...
-2
votes
1answer
51 views

Updating a csv with python

I am very new to python and am working on a project to automate a mapping process for several thousand shape files. My eventual goal is to get each row in my csv into a separate .dbf dbase table. The ...
0
votes
0answers
19 views

Calculate field: arcpy throwing a name (variable) does not exist error while trying to iterate field name inside an expression

I am trying to write a code to calculate multiple fields i created earlier in a script based on existing fields. To do this, one parameter in the equation expression must for each iteration use the ...
-2
votes
0answers
15 views

I want to calculate a part of shapefile name to field for thousands of shapefiles using python

I want to calculate shapefile name to field for thousands of shapefiles using python. Example:blu123a1_AQDCTP.shp, blu123f1_PS_D_R.shp, tag342g1_BRNK20.shp i want to calculate only ...
-1
votes
0answers
10 views

Arcpy : field mapping issue in AddLocations method with GPFeatureRecordSetLayer inputs destination

Do you know how to map a field in the Arcpy's AddLocations method, from a GPFeatureRecordSetLayer dataset (FeatureSet from my JavaScript code) ? I created an OD matrix that runs well and that's got ...
0
votes
1answer
40 views

Creating polygons/polylines from origin points using Python in ArcGIS?

I am still very new to Python. I am heading a project to map the building footprints within our county on the tax map. I have found a previous question that may be very helpful for this project: http:...
0
votes
1answer
30 views

Failed to copy gdb in ArcPy

I am trying to archive a geodatabase into an Archive folder. The geodatabase is successfully copied into the Archive folder, but I receive an error code that prohibits the rest of my code from running....
0
votes
1answer
29 views

Python Pool.map() - locally works, on server fails

I've researched many pool.map on SO and still can't seem to find anything that hints at my issue. I have if __name__ == '__main__' in every .py file. I have freeze_support() in each .py that ...
0
votes
0answers
18 views

Passing a variable from Python to R in subprocess

I'm creating a script tool for ArcMap that will use Python for geoprocessing and an R subprocess to handle dataframe manipulation. Right now I have Python writing the output that R will work on as a ...
0
votes
0answers
12 views

Python produces empty table in IDLE, but works successfully in ArcMap

I've encountered an issue, where the same exact line of script works successfully in ArcMap but doesn't work as intended in when run in IDLE. I'm trying to produce a Near Table. I do not receive any ...
0
votes
2answers
2k views

ArcPy Python script - Runtime Error: ERROR 010240: could not save raster dataset to C:\L_B2dpy with output format GRID

I m working on a script with python and arcpy to process Landsat satellite images. Near the end of the script of get an error at the same location each time. The error occurs after one successful run ...
0
votes
1answer
23 views

How to generate spatial weight matrix in python script?

I need to create spatial weights matrices for different point shapefiles,so I tried to batch process in stand-alone Python script. Here is the example code exported from the ModelBuilder in the ArcGIS ...
0
votes
1answer
29 views

DBF Table Join without using Arcpy?

I have created a rather large CSV file (63000 rows and around 40 columns) and I want to join it with an ESRI Shapefile. I have used ArcPy but the whole process takes 30! minutes. If I make the join ...
0
votes
1answer
27 views

How to extract strings at particular position while using os.sep?

I am using this code in ArcGIS environment to extract the file path of geodatabases in multiple folder. gdbpath = path.split(featureclass)[0] pathname = gdbpath.split(os.sep) print pathname Result: ...
0
votes
0answers
17 views

Arcpy GAIT (defense solution) error — “ExecuteError: Unable to start XWin.”

I am trying to build a process using Python to run GAIT (version 23). Arcpy provides access to a GAIT tool via the Defense solution (which I have), but no matter what data I run through the script, I ...
0
votes
0answers
17 views

Looped arcpy.SelectLayerByAttribute predictably fails to select certain features

I have written a script that exports land use rasters based on catchments that contribute to sample sites of interest. The script loops through site IDs and selects catchment polygons based on an ...
0
votes
0answers
43 views

Python script producing ERROR 999999 on clip function

I am trying to write a Python script that takes a folder of shapefiles, selects one of the features within one of the polygon shapefiles and creates a buffer on that feature. This feature is then used ...
0
votes
0answers
65 views

Definition Query in Python

I'm trying to do a definition query on a layer for attributes that are not null values so I can search and update cursor but I keep getting an error message. Layer name is PREMISE. Here's what my ...
0
votes
2answers
172 views

clip analysis in arcpy

I have one shapefile that covers an entire city, and a list of shapefiles which are buffers in different places in the city. I want to clip the city with each buffer. I tried using ArcPy in Python but ...
-1
votes
1answer
28 views

Arcpy, select features based on part of a string

So for my example, I have a large shapefile of state parks where some of them are actual parks and others are just trails. However there is no column defining which are trails vs actual parks, and I ...
-1
votes
1answer
29 views

SearchCursor in Arcpy Returning Tuples & Lists, Not a List

I have a fairly simple piece of code that searches a polygon feature class and stores the data for a selection of fields in a list: for eachSMField in smFieldList: with arcpy.da.SearchCursor(...
0
votes
1answer
34 views

How to apply a formula to each cell of a numpy array

I am trying to take an existing numpy array and apply a formula to each cell of the array. I have the code below but it returns the following error. Traceback (most recent call last): File "C:\...
0
votes
1answer
23 views

FeatureClassToFeatureClass_conversion in mxd - don't want to add new layer to mxd

I am running a script from the Python window in ArcMap. listOfLayers = arcpy.mapping.ListLayers(mxd, "", df) fileGeodb = r"C:\foo\bar\gdb_name.gdb" for layer in listOfLayers: arcpy....
-2
votes
1answer
27 views

I'm trying to create ashapefile of x,y coordinates from a txt. file but am getting the following error

Traceback (most recent call last): File "C:\Users\Brett\Desktop\Jefferson_final.py", line 31, in point = arcpy.Point(coordinate[0],coordinate[1]) IndexError: list index out of range Here is my ...
0
votes
0answers
47 views

arcpy script using sqlalchemy and pandas only runs once

I am struggling with the following issue: I created a arcpy script in which I connect to a database via sqlalchemy and collect some data into a pandas data frame. When I execute the tool within ...
0
votes
1answer
47 views

Creating functions from following code in python

I'm trying to create functions from the following code but am having trouble. I've posted the code i want to make functions out of up top and my failed attempt at the bottom. Thanks for your help ...
-2
votes
1answer
25 views

Formatting a text file in python

This is my code: import arcpy arcpy.env.workspace = "C:\Users\Brett\Desktop\lesson_6\Lesson6_Data" infc = "Cities.shp" outputFile = open("C:\Users\Brett\Desktop\lesson_6\Lesson6_Data\...
-1
votes
1answer
24 views

Pass Argument to Python Script in Windows Command Prompt

I'm trying to pass an argument to python via windows command prompt, but am encountering the following error: [Errno 22] Invalid argument Command Prompt Code: C:\Python27\python.exe "C:\Users\...
2
votes
1answer
367 views

ListFeatureClasses() glitch with SDE

I'm running ListFeatureClasses() on every Feature Dataset in my SDE using arcpy - the line goes something like this: FDS = arcpy.ListFeatureDatasets() for FD in FDS: arcpy.env.workspace = FD ...
0
votes
2answers
89 views

DBF to CSV Convertion

I have been trying all day to convert dbf files to CSV and cannot seem to get it. I have looked at various options and cannot seem to get one that will work. Here is one that I have been trying. ...
1
vote
1answer
1k views

Why won't arcpy create my table?

I am getting an error Failed to execute: Input Table: Parameters are not valid. ERROR 000732: Input Table: Dataset mytable does not exist or is not supported Failed to execute (AddField). ...
1
vote
1answer
1k views

Random number generation with Python, ArcGIS 10.1

I have a shapefile with 1,000+ cases and three fields (DOUBLE) ran1, ran2 and ran3, which I have set up to receive the product of separate random number generation operations. Unfortunately, the ...
0
votes
3answers
2k views

How to limit for loop iterations within cursor?

I am using a for loop within a SearchCursor to iterate through features in a featureclass. import arcpy fc = r'C:\path\to\featureclass' with arcpy.da.SearchCursor(fc, ["fieldA", "FieldB", "FieldC"...
0
votes
0answers
17 views

Arcpy code restarting automatically

I have a section of code to create a dictionary which I've run on several other files without issues. The only thing I changed to run the code on this file is the file pathway. When I run it, it gets ...
0
votes
0answers
57 views

How do I use a 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='...
0
votes
0answers
13 views

Unable to save 3 dimensional array as stacked raster .img file in arcpy, RuntimeError: ERROR 010240

Unable to save a 3 dimensional array to stacked raster .img file. I have this array: arr.shape (10, 148, 160) Now when I try to save this into raster .img format: out_ras = arcpy....