A site-package created by Esri to expose many ArcObjects to Python.

learn more… | top users | synonyms (1)

3
votes
1answer
77 views

Arcpy.da.UpdateCursor, Error - Sequence size must match size of row

I am trying to use an UpdateCursor fill in a field but I keep getting an error, can anyone tell me what I am doing wrong? My code is below: import arcpy fc= "C:\Users\Keri\Desktop\GEP_690\Project ...
0
votes
0answers
46 views

Dissolving features by attribute(s)

How to apply ‘statistic_field’ to just one ‘dissolve_field’? I have a feature class that I need to dissolve by PageName but also by earliest year in SERVED_YEAR. So, how to apply MIN to SERVED _YEAR ...
1
vote
1answer
41 views

Why is Update Cursor adding Object IDs incorrectly?

I am using an update cursor to add values in a try:except block of code using ArcPy. If the code is successful I log yes in the success field, if it reaches the except block I log yes in the fail ...
0
votes
1answer
19 views

ListFeatureClasses overriding ListRasters in ArcMap script

What is preventing the script from identifying the spatial reference for the .tif files? It appears that the script below lists the fc first, then gives the false spatial reference to the subsequent ...
1
vote
1answer
38 views

Arcpy: Using where clause in append_management

I would like to write a script where I select a feature class by attributes, add a field for a timestamp, and append the selected features to another feature class. My code is below; Do I need to ...
1
vote
1answer
31 views

Arcpy - handling intermediate raster files

I have 8,760 (24*365) GRID rasters in a directory. I'd like to use use FocalStatistics analysis to reassign cells to the maximum of a 5x5 window/kernel and extract the resultant values at points ...
2
votes
1answer
68 views

Making Python Add-In using tools built in ModelBuilder?

I have made a set of tools in a toolbox using ArcGIS 10.2 using the model builder. I would like to distribute them as a tool bar, and so created a ArcGIS Python Add-In I was hoping that I could ...
4
votes
1answer
85 views

Buffering Points Directionally

I have about 10,000 points that I want to apply a partial circular buffer to based on an angle, from -30 to 135°. A similar question for polygons seems to have been answered here, but I cannot make ...
0
votes
0answers
25 views

Python script can't find custom module in ArcSDE

I've been working on a python script for some time. Its working well but I'm having trouble running it in SDE. My main issue is that the python script, when run in SDE, cannot find any of the ...
1
vote
1answer
24 views

arcpy.GetCount_managment not returning result in dialog window

I am having trouble with GetCount to work in my script. It is not printing the GetCount arcpy.AddMessage in the geoprocessing window dialog; # Get the spatial reference spatialRef = ...
0
votes
1answer
50 views

Select by location-arcpy

i work with arcview 10.3 on 20 mxd's (each mxd has 25 layers) and i try to do select by location (with arcpy) and want to see a layers that are visible in the current map extent only. All Other layers ...
0
votes
1answer
42 views

Arcpy - Updating fields using time.localtime()

My objective is to change the values under field "DATE_IMPOR" which are currently set at to the current time using time.localtime function. I'm having some problems getting there, above all one line ...
1
vote
1answer
31 views

Clipping rasters

We are clipping one raster to another and our teacher gave us this hint for the 2nd parameter "Remember that the Describe function returns an object. The Clip tool will need the string representation ...
0
votes
0answers
31 views

Import addresses from an Excel file via Python for route optimisation

relative newbie here. Apologies if this is very obvious or basic! I have created a route optimisation model through ArcGIS modelbuilder, then exported the Python script. Within the model I had a ...
2
votes
2answers
35 views

Assigning Default Value Using ModelBuilder?

Task: add several new fields to a feature class table and assign a default value to one of the fields. Software/Environment: Using ArcMap 10.2 (Advanced License) and Python 2.7. Data is stored in ...
1
vote
0answers
31 views

ArcGIS/arcpy: add field to table iteration

I want the average precipitation for 50 regions in my country for each hour. To do this, I have built a arcpy script that performs 50.000 iterations (hours) over .nc files. The result of each ...
0
votes
0answers
22 views

Error when loading ST_Geometry into SQLite

I have created a new .sqlite database running the arcpy code in ArcGIS 10.3 (with Python x86): import arcpy sqlite_database_path = 'C:/Data/Counties.sqlite' ...
0
votes
2answers
57 views

Placing message in geoprocessing progress dialog?

I am after a way on using arcpy.GetMessage to achieve the following message in the geoprocessing dialog result window?; The above 4 datasets have been reprojected to: WGS Web Mercator (auxiliary ...
1
vote
3answers
58 views

Shapefile list gone missing in dialog window

I have updated my script in ArcGIS 10.3 to include the copyFeatures_management geoprocessing tool because I want to only copy the features that already have the same projection, not reproject them; ...
0
votes
0answers
5 views

Turn-off layers in Arcscene using python [duplicate]

I am trying to turn off the layers in ArcScene when a sxd file is opened. sxd files are not supported by arcpy mapping. Is there any other way to use python for the same? Previously I was doing this ...
0
votes
1answer
34 views

AttributeError: Result object has no attribute save (when trying to save output in separate directory)?

I am trying to convert more than 100 ascii files to raster using python code. All the lines (except Last two) in my code presented below is successfully converting Ascii to tif format in the working ...
2
votes
1answer
69 views

DBSCAN gives “AttributeError: NoneType has no attribute issparse”

I am running a Python script invoking the DBSCAN tool to cluster feature points. When I open ArcMap, load the feature layer, and run the script, it works the way I expect it to. But if I run it ...
0
votes
1answer
52 views

Using the mouse to select records in ArcPy

I am running ArcGIS 10.1 Basic license with Python 2.7.2. I have a two spatial files: the first listing vessel positions and the second activity on board. I also have a collection of reports in ...
2
votes
0answers
43 views

ArcSDE reconcile versions and keep edit version in its current state

Reconciling versions makes both target and source(s) point to the same state. I have an arcpy script that essentially will create a version from a parent of the db - in a state that is empty - adds ...
0
votes
0answers
15 views

Manually chosing a record in ArcPy [duplicate]

I am running ArcGIS 10.1 Basic license with Python 2.7.2. I have a two spatial files: the first listing vessel postions and the second activity on board. I also have a collection of reports in Excel ...
1
vote
0answers
30 views

Python Script to iterate numerous, single-band rasters for arcpy.CompositeBands

I have a large collection of single-band geotiffs (NIR, Green, and Red) that I would like to composite using a Python script. The goal is to iterate through multiple folders in a main directory, ...
0
votes
1answer
35 views

A script that only deletes fields within an attribute table specified by the user

I would like a script that will be executed in ArcGIS that only deletes fields within an attribute table that are specified by the user. As I understand it, this can be done in Modelbuilder but was ...
0
votes
2answers
67 views

Add in copyfeatures into script

I am having trouble with CopyFeatures in my script. The files went being copied to the output folder. Can someone please assist. Here's a snippet of my script for ArcGIS 10.3; #Loop through shapfiles ...
0
votes
1answer
33 views

Combine string and OBJECT ID

I would like to update the Map_Feature_ID field with a String " WP_" and then follow the "WP_" with the OBJECTID field. So I will end up with "WP_1", "WP_2" all the way to the end in the Map Feature ...
1
vote
4answers
154 views

Using Python new line (\n) with ArcGIS geoprocessing progress dialog? [closed]

I am currently using in my ArcGIS 10.3 toolbox script; # Get the spatial reference spatialRef = arcpy.Describe(template).spatialReference.name #Loop through shapfiles in folder and reproject for fc ...
-1
votes
1answer
84 views

Rewriting VB codeblock as Python for ArcGIS Field Calculator?

I am looking for assistance to rewrite my VB codeblock into Python. Im on Win7, Arc10.2 and Python 2.7 The code below works fine for me, I am simply looking to port it to Python so i can progress down ...
1
vote
0answers
52 views

Batch Convert GRID to TIFF with colormap and RGB

There are lots of questions on here regarding raster conversion, but I can't find anything specific to my needs (involving output as RGB and using a Colormap). I have a folder full of ESRI GRID ...
1
vote
3answers
77 views

Removing filepath from ArcGIS geoprocessing result?

This is my python script code in ArcGIS 10.3; projectResult = arcpy.Project_management(fc, outFolder + "\\" + fc, template) #Name of shapefiles re-projected arcpy.AddMessage(projectResult) ...
1
vote
2answers
55 views

Adding shapefile names in message to progress window/dialog of ArcGIS for Desktop from ArcPy?

How do you use python in a ArcGIS 10.3 script to list/print the shapefiles with a message from the result of a geoprocessing tool in the progress window/dialog box. For example; abc.shp 1234.shp ...
0
votes
1answer
40 views

MakeFeatureLayer_management where_clause input by the user

I want to convert a script into a toolbox and one of the parameters is selecting cities with a population > than 500000 hab. I'm using the function MakeFeatureLayer_management. How can I do to ...
0
votes
2answers
63 views

How to remove layers that are not in visible df extent

I am working on ArcMap 10.3 and I have a map with 50 layers in it. I am trying to check if layers are in a data frame. Unlike How to check if layers in a dataframe with Arcpy, I want to define the ...
0
votes
0answers
19 views

why when I use python to program the exact same command as netcdf make a table tool, the table is empty? [duplicate]

If I use the ArcGIS tool "create a table view from netcdf file" eveything works great, but I need to automate a marge larger program. When I use the exact same tool in python, the table it creates is ...
0
votes
1answer
56 views

Using Python parser of ArcGIS Field Calculator to populate values in one field based on those in another?

I am trying to populate a field with a sorting code that represents the value of another field. Example: EXPCODE|SORT| S4DNN2 |3.5 H2BNN2 5.0 EXPCODE is a field with a value like "S4DNN2." SORT ...
1
vote
2answers
54 views

Syntax error running script in PythonWin after success in ArcPy

I am building a script to automate a water outage map(I'm new to Python). In the ArcGIS Desktop 10.1 window the script runs fine. However in Pythonwin and IDLE I get syntax errors(In Pythonwin reads: ...
2
votes
0answers
69 views

ArcGIS python toolbox: GPFeatureLayer parameter “loses” symbology type

I'm pretty new at ArcGIS python toolboxes. Here is one problem I've been fighting with for a while. I want to create an output layer (GPFeatureLayer) with a specific symbology (GRADUATED_COLORS) and ...
1
vote
0answers
37 views

netcdf python error

I am basically copying and pasting the code provided on Esri's website and every time I try to run it in ipython, the program crashes and needs to restart the kernels. The code is below, does anyone ...
1
vote
3answers
67 views

Project only required shapefiles in folder

I have 8 shapefiles in a folder with shapefile 1 and 8 in the same projection and the others (shapefile 2-7) if different projections. Is there a way to use python to use shapefile 1 as the ...
0
votes
0answers
35 views

Progress dialog box of ArcGIS Python script tool stealing focus from TKinter GUI?

I created a script tool in the custom toolbox, it runs like this: But the default progress dialog keep stealing focus from the Tkinter GUI, that makes me so hard to move/resize the OpenFileDialog, ...
0
votes
2answers
104 views

Multiprocessing with arcpy and Solar Analyst (spatial analyst)

I need help getting multiprocessing to work with the spatial analyst tool - Solar Analyst. I have tested the multiprocessing bit and it works fine. This sample is passing it a file containing 2 lines ...
2
votes
1answer
52 views

Using a for loop to execute a query in arcpy

I'm trying to provide the breakdown of fire detection for an area by sorting of confidence levels. The dataset has 12 files (one for each month in a year) with fire records which all have a column ...
0
votes
1answer
67 views

Updating field in feature class using ArcPy cursor?

I want to update a field in my feature class. I tried to use a da.SearchCursor (code below) but was quickly reminded that tuples are immutable... I ran the code but it failed with a TypeError: 'tuple' ...
-1
votes
1answer
35 views

How do I create a point buffer?

I have a collection of points. The goal is to create a buffer around each point. The radius maybe different for each point and is based on a series of calculations. Some wells might have 10+ ...
2
votes
2answers
51 views

Clipping raster python script stops abruptly?

I have created a tool in ArcGIS based on a python script that will clip a large raster dataset into smaller tiles based on a fishnet polygon feature class. The script iterates through each feature in ...
2
votes
1answer
40 views

Multiple Ring Buffer in ArcPy Generates Single Ring

I'm running a simple multiple ring buffer using ArcPy. My goal is to generate a multi ring buffer for each pond in my dataset of 50,000. Here's the line of code: ...
0
votes
1answer
16 views

is it possible to export map as png without having the webmap JSON?

I want to export the image of a map from a page that I don't have a map available. In other words I need to call a service where I will provide the definition expression of a feature layer, retrieve ...