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

learn more… | top users | synonyms (1)

0
votes
1answer
14 views

raster to point in batch mode using Python

I have a list of raster files in tiff format and I want to convert that tiff to point using raster to point conversion (tool of ArcMap). This tool will convert the raster into a point shape file. I ...
0
votes
1answer
9 views

Get Shape Type of Several Shapefile with If Statement

Can you loop over a series of shapefiles with a if loop and either copy them or not? Existing code... import arcpy import os arcpy.env.workspace = r'c:\Shapefiles' outWorkspace = r'C:\Output' ...
4
votes
2answers
64 views

Command syntax in ArcGIS python script

I'm in the process of learning to use python to automate some tasks in ArcGIS, and while I've done a couple of on line courses about python I'm still learning to use it within ArcGIS. I've had some ...
1
vote
1answer
43 views

Add layer to mxd files ignoring specific item- arcpy

I try to add layer (abc) to several mxd files with arcpy and ignoring mxd file which called "land use" . I work with arcview 10.3 : import arcpy,os,sys,string,datetime import arcpy.mapping from arcpy ...
2
votes
1answer
66 views

Alternative to an arcpy script for points to lines to polygons?

I'm relatively new to arcpy and python, so I feel like I could be missing something obvious in regards to tool options for what I'm trying to achieve. I have a script that creates triangular ...
0
votes
0answers
20 views

setting data frame extent set to a shapefile

I need to set the data frame extent set to a specific shapefile in my Table of Contents. I am not sure how to go about this. Some of the codes I have found deal only with zooming into a selected ...
0
votes
1answer
36 views

Creating Tkinter dialog box in arcpy?

I would like to create a dialog box which pops up when the user click on a button from a Python Add-In toolbar. The user will navigate to their preferred file and select any shapefiles they wish to ...
1
vote
1answer
40 views

Converting multiple File geodatabase (.gdb) into multiple Personal geodatabase (.mdb)

Individually I will Export the gdb to XML Workspace then import that into the personnel geodatabase and all Domains go over fine. But... Let's Say I have several file geodatabase in a folder and Each ...
1
vote
0answers
24 views

What is causing these streaks in my output tif using arcpy.CopyRaster_management?

This is the line of code that is creating these ... arcpy.CopyRaster_management(raster, fname, "DEFAULTS","0","","","ColormapToRGB","8_BIT_UNSIGNED") and I did have a colormap file with specifics ...
0
votes
0answers
18 views

Spline tool using arcpy

Trying to use an arcpy script to operate the spline interpolation tool in spatial analyst on point data that represents soil sample points. When background processing is enabled I get an error of ...
1
vote
1answer
27 views

Arcpy script- Update cursor error

This is a follow-up question to a previous post. For some reason the following script in Arcpy does not want execute the command. Please see fields and script below. (All credit to Aaron for the ...
2
votes
1answer
36 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
39 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
40 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
18 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
28 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
24 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
34 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
53 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
22 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
20 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
38 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
0answers
17 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
24 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
26 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
29 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
28 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
11 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
53 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
56 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
4 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
23 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 ...
0
votes
1answer
23 views

Using search/update cursor of features based on other values or feature [closed]

I have a workflow with the following scenario when consuming a web-service. This script runs every 5 minutes and I have a time variable to consume all data that has been added to the service between ...
2
votes
0answers
32 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
46 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
24 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 ...
1
vote
0answers
16 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
33 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
63 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
25 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
121 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
65 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
32 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
67 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
35 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
25 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
57 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
18 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
44 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
41 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: ...