1
vote
0answers
19 views

Copying XY to clipboard using Python Add-In (ArcMap)

I am trying to create a simple tool to copy XY from where i click the mouse button. What i have done already is: create add-in files using Python Add-In Wizard create toolbar and tool inside it in ...
3
votes
3answers
40 views

Calculate field using variables as fields

When I calculate a field like this: field_0="field_name0" arcpy.CalculateField_management("Layer", field_0, '!field_name1! / !field_name2!', "PYTHON_9.3") It works! The field "field_name0" in the ...
1
vote
1answer
38 views

How to add IDs of the links composing a polygon?

I built up a polygon layer from a road network for finding roundabouts using the compactness factor of a polygon. Then I have to intersect the extracted roundabout polygons with the road network so ...
2
votes
0answers
41 views

Correcting addresses with Python or Model Builder

I am trying to make a script in Python (or Model Builder in ArcGIS) for correcting addresses. I have a point shapefile with the addresses (it has X and Y, and fields for "number", "street name", and ...
1
vote
1answer
36 views

Flip multiple vectors

I have thousands of vectors (out of several million) which I need to flip, for directionally purposes (Network Analyst). The vectors in question are annotated that their directionality has been ...
3
votes
1answer
96 views

How to convert polygon singleparts to multipart?

I am interested in converting a polygon featureclass created via Create Fishnet (Data Management) from singleparts to multipart. QGIS has a very handy tool called singleparts to multipart that does ...
2
votes
0answers
32 views

Nested conditional statement in ArcGIS on multiple rasters

I have a list of rasters in ArcGIS and I want to create a conditional (Con) nested statement based on all the rasters of the list. I want this to be reiterate through many lists (the number of rasters ...
2
votes
0answers
41 views

ESRI's arcpy.asShape Bug Workaroud

I've read a few questions\answers about converting a GeoJSON Shape into an ESRI Object. Unfortunately most of the answers pointed to decoding the dictionary's manually. Im a bit more lazy ^_^ The ...
0
votes
1answer
41 views

Arcpy MakeFeatureLayer won't loop

The arcpy snippet below is intended to generate a list of technicians scheduled to work, and then generates a unique feature layer for each one's stops. fcStops = "TaskRoute1016" with ...
3
votes
1answer
46 views

Track progress of running GP tools (in arcpy script) programmatically?

I am looking for a way to access a GP tool running in a Python script to be able to see how much of the job has already been done. I have found SetProgressor function, but this one is available only ...
1
vote
1answer
28 views

arcpy geometry difference method fails randomly, not reproducible

Has anyone used the arcpy geometry difference operator and seen unexplained errors like what I describe below? This is a weird one. I have a script that calculates wave fetch distance in the ocean ...
2
votes
1answer
48 views

Changes not persisting in ArcGIS server from ArcPy script

I have a ArcPy script (10.2) which connects to an ArcGIS server (10.0) versioned geodatabase, via an .sde connection file in the Database connections directory through direct connect on a Microsoft ...
3
votes
0answers
53 views

How to use Python's subprocess module in a for loop ArcGIS?

I am new to scripting with ArcGIS. Although this might be an easy thing for those that know Python well, I haven't figured out how to use the subprocess module in a script. I actually think I'm ...
2
votes
0answers
29 views

Validating whether PDF file Uploaded as part of Geoprocessing Service of ArcGIS for Server?

I'm developing a Python Script that will be a Geoprocessing Service in ArcGIS Server. The Script has a Button for Users to OPTIONALLY Upload a PDF. If the PDF is Uploaded it gets inserted into the ...
2
votes
2answers
57 views

Delete Files in a folder and disregard an existing folder

I did a lot of geoprocessing steps and now I like to delete all files including result, result, _join, _interand reclass in their name. I can do this with the following import glob import os for fl ...
1
vote
0answers
35 views

Clip Management won't work outside of ArcMap/Catalog

Okay so I have a short script that works great when copied into the python window in ArcMap or ArcCatalog, but refuses to work in an IDE for whatever reason. The error that is thrown is: Start Time: ...
0
votes
1answer
20 views

How do I define 'KrigingModelOrdinary'

How and where do I define the KrigingModelOrdinary Here is the code: rasterKrig = "run{}_Krig_{}".format(counter, field) outKrig = arcpy.sa.Kriging(Stations2010o3Data__2_, field, ...
7
votes
2answers
152 views

Calculate Date Field - today's date from datetime.date.today

I'm working on part of tool that will use arcpy.CalculateField_management to add the current date to the attribut table. I've wandered far and wide on the interwebs and can't seem to find the ...
1
vote
4answers
163 views

Arcpy: what tools are most suited for this job?

I'll try to be as much detailed as possible but please let me know if anything is missing: I'm trying to get the number of lines in layerA that intersect with each line in LayerB and stores that ...
4
votes
1answer
41 views

Installing scipy.spatial with ArcPy gives DLL load failed error on import?

I am running python 2.7.6 from an ArcGIS installation. I have tried to install scipy from the Python Exchange Packages here, using the scipy-0.14.0.win32-py2.7.exe executable. I get no error importing ...
1
vote
0answers
33 views

Esri Python Toolbox(pyt) corruption in ArcToolbox.dat

Symptoms: Open ArcCatalog and all tools within Python Toolbox(pyt) have a red-x error next to them claiming that "Arcpy module has no attribute Parameter" Close ArcCatalog Delete ArcToolbox.dat file ...
0
votes
1answer
37 views

Arranging elements horizontally in ArcGIS tool

Is it possible to arrange multiple check boxes horizontally in a tool and changing the parameters dynamically (adding/removing) based on user selection of check boxes?
2
votes
1answer
29 views

Cut polygon shapefile with 2 parallel lines to derive new inside polygon?

Using Python scripting: How can I clip a polygon shapefile with parallel lines (polyline shapefile) to derive new inside polygon?
3
votes
1answer
51 views

Trying to generate a PDF for each feature in a feature class based on an attribute with Python.

I have a feature class of points that represent storm water inlets. I am trying to automate a process that does the following. finds all of the inlets that have a field called "Marker" populated ...
1
vote
0answers
27 views

Error writing defaultdict values to feature class rows

I originally posted building dictionary from feature class field values, how can I ensure there are no duplicate values per key. The goal is to update another field with all the values per key, which ...
0
votes
0answers
56 views

Python trainings comparison

My employer provides me with a generous annual training budget and I'd like to use it on one of the following two Python courses. As a GIScientist, I would like to attend the course which will give ...
1
vote
2answers
44 views

building dictionary from feature class field values, how can I ensure there are no duplicate values per key

I found this code sample that builds a dictionary from two fields; the end result is a concatenation of all values per key to a new field. It's a great tool except that it doesn't account for ...
0
votes
2answers
33 views

Select Layer by Attribute: SQL and variable problems

I've had a good look around the site and haven't been able able to find any 'select by attribute' questions regarding string variables and how to integrate them into an SQL statement. In my particular ...
2
votes
1answer
34 views

ERROR 001243 preventing automatic publishing of geoprocessing service

I am trying to automate the process of publishing a geoprocessing service to ArcGIS for Server 10.2.2, using a python script: import arcpy result = r"C:\data\ContourLineFunction.rlt" ...
3
votes
2answers
49 views

How to calculate the a list of rasters?

I'm writing ArcPy code in ArcGIS trying to calculate a list of rasters. I get an error message that says: TypeError: unsupported operand type(s) for -: 'unicode' and 'unicode'. Here's my ...
2
votes
2answers
75 views

Use updatcursor to replace values in multiple fields

I have spent a couple days digging through forums here, ESRI help and elsewhere and each variation of the codes I have tried has not worked. As best as I can tell this is due to my attempt to loop ...
3
votes
0answers
32 views

Get value from Metadata in Python Script for attribute

I am working on a python script to create some feature classes from dbf tables. As part of the script I would like to pull two values (FGDC "publication date" and ArcGIS Spatial Reference ArcGIS ...
1
vote
1answer
30 views

Issues with FME and the ArcInfo licence

I have ArcInfo 10.2.1, Python 2.7 and FME 2013 SP4 installed on my Computer. I want to run a python script I exported from ModelBuilder (where it ran without issues) and imported in FME as shutdown ...
1
vote
2answers
38 views

How to provide a default value in an arcpy script?

How do I provide a default value like recommended in every Arcpy script? This script is exported from ModelBuilder where every output except the last one is set to temporary and managed. I want this ...
1
vote
1answer
27 views

How to Set Label Expression Using a Long Field Type in Toolbox

What I am hoping to be able to achieve with this Tool within my Toolbox is to allow the user to input a number of layers and to set all of the labels with the same font settings (font style, color, ...
0
votes
2answers
47 views

arcpy calculate string field: Any ideas what how to fix this?

I'm trying to store a string value obtained from a loop through a tuple into a field called ROW_1. The code goes like this: for creekclass in listOfClassTuples: (classname, Permanency, ...
3
votes
4answers
278 views

Having trouble with 'and' 'or' statements and negative numbers

I have set up a program that calculates the relationship between a point and the first point of a polyline. The aim of the program is to run this calculation and then copy the result to a certain ...
5
votes
1answer
48 views

PySAL natural breaks from Numpy array

I am attempting to extract natural break values from a raster using Python. The intended process goes: Arcpy raster object to NumPy Array (using RasterToNumPyArray) to natural break values (using ...
1
vote
0answers
34 views

User input and passing variables with ModelBuilder

I have created three modelbuilder tools that must be run in sequence. After running each tool, the user must examine several shapefiles and potentially change the input parameters of the next tool. ...
-3
votes
0answers
36 views

Exporting group layers from Table of Contents (TOC) to Folders of shapefiles?

I have some group layers in the Table of Contents (TOC). Each group of layers references a few shapefiles from different source folders. I would like to export each group layer name as a folder and ...
-3
votes
1answer
102 views

Exporting file geodatabase (GDB) to Folder of shapefiles?

I have a geodatabase with several feature dataset and feature classes associated with it. I want to export each feature dataset as folder and feature classes associated with each feature dataset will ...
1
vote
1answer
67 views

Importing file geodatabase (GDB) to table of contents (TOC) of ArcMap?

I have a geodatabase with several feature dataset and feature classes associated with it respectively. I would like to create a .mxd where the Table of contents consist of group layer and each group ...
2
votes
1answer
60 views

ListRasters based on filename using Arcpy

I am trying to create a python script for ArcMap which calculates the ndvi from two raster images for each RGB/NIR pair in a folder. However, I am unsure how to create two raster lists; one which ...
1
vote
1answer
42 views

How to ascertain if a cell/field contains a value in ArcGIS attribute table

I have done a bit of research on this but can't seem to find an answer. I am wondering if there is a way to identify whether a cell/field in the ArcGIS attribute table contains a value using the ...
0
votes
0answers
65 views

Looping through each specified layer and exporting PDF map showing shapefile and information taken from each attribute table?

I have been working on an automation script for the purpose of mass pdf exportmaps. I am required to export many pdf maps showing individual boundary files and client information. I believe the ...
2
votes
1answer
52 views

How to check shape length before running code in Python/ArcPy?

I am using a code to convert a polygon into evenly spaced parallel lines for point in range(0,numPoints+1): shortPoint1 = currentLines[firstLong].positionAlongLine(lineSpaceNum*point) ...
0
votes
0answers
50 views

Exporting table of contents (TOC) with group layers to file geodatabase (GDB) with feature datasets?

I have created a python code for exporting shapefiles from TOC from different source folder to a output folder. However, in this case, I have some group layers in the Table of Contents (TOC). ...
1
vote
1answer
57 views

Listing all feature datasets and classes from multiple geodatabase into CSV file? [duplicate]

I have a folder having multiple geodatabase and I am calling that folder “Multiplegdb” There are 3 geodatabase in a folder which are as follows: ABC.gdb UVW.gdb XYZ.gdb Each geodatabase have ...
1
vote
1answer
38 views

Creating multiple Feature Datasets from table/list using ArcPy?

How to Create multiple Feature Datasets from a table/list. I can create a single feature dataset in a geodatabase with this python code. import arcpy from arcpy import env env.workspace = ...
1
vote
1answer
45 views

select random rows with python in arcgis

I am new to using Python in ArcGIS, and I wonder: how do I select random lines (or every two lines) of an attribute table? I must select these lines and calculate them, so they are different from ...