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

learn more… | top users | synonyms (1)

7
votes
2answers
1k views

How to keep spatial reference using arcpy.RasterToNumPyArray?

I am using ArcGIS 10.1, and want to create a new raster based on two preexisting rasters. The RasterToNumPyArray has a good example which I want to adapt. import arcpy import numpy myArray = ...
-2
votes
0answers
22 views

How to set NULL value by arcpy.da.InsertCursor on date column?

How to set NULL value by arcpy.da.InsertCursor on date column? I try insert "NULL", None, '', 0 dictIN= [{'field1':"test1",'date1':'01-02-2015','date1':''},\ ...
3
votes
1answer
393 views

mosaic raster to file geodatabase yields missing raster sections

Since upgrading to ArcGIS 10.1 (SP 1) from 10.0, I've been encountering an issue when running the arcpy.MosaicToNewRaster_management() tool with output to a file geodatabase. I'm principally working ...
1
vote
2answers
25 views

Inline variable substitution in Model Builder using python code

I have an inline variable substiution which I would like to import into my Python script. Is that possible? I am trying to make a parameter within my path. My path currently is ...
5
votes
2answers
739 views

Problem with the where clause in ArcGIS when dealing with variables

I am writing a python script for ArcGIS. I have an input feature class which contains multiple pipelines which is saved as a variable InputPipeline. I would like to iterate through the pipelines and ...
3
votes
1answer
48 views

More efficient way to get the start and the end points of a line (arcpy)?

I am collecting start and end points for a large polyline feature class in a file geodatabase. I am using arcpy, ArcGIS 10.3, Python 2.7.3 64-bit and a 10.3 compressed file geodatabase with just one ...
2
votes
1answer
185 views

Creating relationship class with ArcPy using GlobalID?

I'm trying to create a relationship class with Python using a GlobalID. When I use Python it gives me the error: Failed to execute. Parameters are not valid. ERROR 000800: The value is not a ...
1
vote
2answers
34 views

SplineWithBarrier (Spatial Analyst) - different results between model builder and external python script

I'm puzzled by different results I get from application of SplineWithBarrier (Spatial Analyst) using Modelbuilder and by external Python scripting: import arcpy points_shp = "pointShape.shp" ...
2
votes
1answer
1k views

How to create multipart line and polygon with interior ring in arcgisscripting?

My objective is to swap X,Y coordinates of feature classes using Python and arcgisscripting. Based on help examples, I managed to write script which reads and writes all geometry types. The problem ...
1
vote
2answers
96 views

Adding/updating field to polygon feature class that lists bordering (neighbor) polygons?

I have a dataset of zipcodes. I want to add a new field "NEIGHBORS" that includes bordering polygons in a comma delimited manner such as attached image:
5
votes
2answers
100 views
+50

ArcPad Checkout from python command line

I have been developing a script to automate my ArcPad checkin/checkout processes. My problem is that I am having trouble getting arcpy to recognize the ArcPad tools from the command line. From the ...
2
votes
1answer
269 views

Converting standalone script to ArcGIS tool?

I am currently trying to make my (working) standalone script into an ArcGIS tool so I'm not the only person in my office that can use it. It selects all the data within a specified location and ...
2
votes
2answers
44 views

How to get cell value along Flow Direction

I have: a flow direction raster where I took off (assigned NoData value) the cells that overlayed the river network (from flow accumulation). a perfectly overlapping raster where I asigned a ...
4
votes
2answers
5k views

Change Symbology of layers from within ArcMap

In an active ArcMap session - I want to change the symbology of a layer which is repeated multiple times in the mxd. Can I do this? The basic code I have for getting the layers is below. This is ...
1
vote
1answer
16 views

Using Python Script to change Pie Chart Symbology

I am trying to change the symbology for Pie chart in ArcGIS. I have a feature class which is joined to a table and I will like to symbolized as a pie chart. I will be symbolizing it a lot thus I am ...
3
votes
1answer
174 views

No placement inside feature dataset using arcpy XYtoLine?

When I run the following code with the outFC creation path set to a feature dataset inside a file geodatabase... arcpy.XYToLine_management(tempFC, outFC, "POINT_X", "POINT_Y", "NEAR_X", "NEAR_Y", ...
0
votes
1answer
27 views

Calling An ArcGIS Webmap's Scales

I am composing an Arcpy tool to help users cache their current mxd's webmaps (our own services). I want to know a way to call the ArcGIS Web Map's scales with ArcPy. Once I have the web maps scales, I ...
5
votes
3answers
105 views
+50

Issues Adding MapServerCache Raster Layers to Mxd

I have created a data consolidation tool. It consolidates a users mxd's vector and raster data into a project structure. It also allows the user to optionally cache our companies ArcGIS Server Web ...
2
votes
2answers
637 views

Python scripting for ArcPad Checkin

I can use ArcGIS Desktop model builder to leverage the ArcPad Check In Tool. When I run the model it executes successfully. When I export the model as python I get this code: import arcpy # Local ...
7
votes
3answers
1k views

python script error- with GetParameterAsText

I have a seemingly simple code which iterates through a list of feature classes and calculates an ID field in the attribute table that is equal to the first 5 characters of feature class name. The ...
2
votes
1answer
164 views

Optimizing arcpy script to batch generate OD cost matrix in road networks

Following the question I asked in this thread, I wrote a python script designed to compute an OD cost matrix given a road network and origins/destinations locations. I am completely new to python, so ...
0
votes
1answer
33 views

Pythonic way to recalculate feature extent in ArcGIS 10.2

I am creating a tool that will automate a tedious process of data standardization. One of the steps is to recalculate the feature extent of a SDE file. Surprisingly I cannot find anything useful in ...
1
vote
1answer
37 views

ArcGIS geometry update from table XY

I am trying to update the geometry of a point FC stored in a FileGeodatabase using ArcPy. I got this Python script to compare the values of the SHAPE@X and SHAPE@Y and change the Geometry if not ...
5
votes
2answers
402 views

Split one field into 3 fields?

I need to split the values in a field according to what they represent to be able to do a join on the data. As seen above I have a ID field that needs to be split into the following: The ID consist ...
1
vote
0answers
32 views

Arcpy.Exists Fails On Existing Layers

I am running into an issue where the arcpy.Exists() function returns a false for a known good layer in the python interactive window. We are using a map document template for the layers set up in the ...
0
votes
2answers
54 views

Set arcpy command line parameter same as Tool parameter

I have a python script that works correctly when used in a toolbox but not from the command line. How do I duplicate the toolbox magic that happens when specifying a parameter Data Type? There is ...
1
vote
1answer
23 views

How do I insert a date string into the database as a date?

I'm using an InsertCursor to insert rows into a feature class. One of the fields in the source data may contain a NULL data value. The destination feature class requires a date - it is not nullable. ...
-1
votes
2answers
134 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, ...
2
votes
1answer
122 views

Remove all default values on multiple feature classes

I would like to remove default values from all fields used by all feature classes in an SDE geodatabase. I do not see a geoprocess for removing the default value, only setting it. So I am trying to ...
0
votes
1answer
21 views

Accessing “valueField” property of layer's symbology using ArcPy?

This has been really hard to debug, as I had no idea where to look at first, but I have made an attempt to access the "valueField" property of a layer file. This layer file is of the UNIQUE_VALUES ...
2
votes
2answers
63 views

Using lists in Python functions [on hold]

I have some code in a function that uses a list, which works, but is there a way to write a list outside of the function and use it within the function code? For example in my code below I have a ...
0
votes
1answer
16 views

How to troubleshoot “RuntimeError: The field is not nullable [Column_Name]”?

I have a python (arcpy) script that extracts data from a database table, processes it, and inserts into a feature class. It works in my development environment but not in production. I recently ...
2
votes
1answer
133 views

AttributeError with unicode object with data frame in python script

I'm running a python script from arccatalog and it works, however, I am trying to add layers to an mxd and need to declare the data frame. I keep getting this error message. type ...
0
votes
1answer
217 views

Spatial ETL Tools won't run “AttributeError: 'module' object has no attribute, etc.”

I have a python script that runs 5 Spatial ETL tools that I wish to run as a scheduled task. Each of the tools will run successfully from ArcCatalog and also from the ArcCatalog Command line. If I ...
2
votes
1answer
26 views

ArcGIS Python Toolbox Parameter Filter.List ValueList Delete/Remove for Reconciling Versions

Does anyone know if and how you can remove a value from a parameter filter list? In my case, I am using a python toolbox in ArcGIS 10.2.2 and want a drop down list of all the versions for the person ...
2
votes
0answers
18 views

Is it possible to add an ArcGIS attachment to a row in Oracle/SDE using oracle stored procedures?

So far I have been able to attach files to features within a featureclass using the python tools and ArcObjects. Within Oracle I have been able to add features with geometries using the ST_Geometry ...
5
votes
1answer
188 views

How can I exclude a field on a table from being copied?

I have a query "layer": >>> r = arcpy.MakeQueryLayer_management(r'C:\path\to\connection\file\connection.sde', 'TEST', 'SELECT T.ID AS OBJECTID, T.* FROM MY_TABLE T WHERE T.SOME_COLUMN = 1', ...
1
vote
2answers
146 views

Why is my cursor empty?

Yesterday I set up a Python script using a cursor on a layer. Today I've tried running again and no matter what I run it in, the cursor is empty. I've tried removing the query on the layer, tried ...
1
vote
1answer
36 views

How to print a list of Tools from their respective Toolboxes with arcpy?

I would like to print a list of Toolboxes as listed in my Python code, however I would also like to print the tools in that Toolbox under neath the Toolbox name like so; Analysis Tools(analysis) ...
2
votes
2answers
406 views

CopyRows_Management in ArcPy gives ERROR 000732?

I get the following error when running a CopyRows_Management with Python (ArcGIS 10.1): ERROR 000732: Input Rows: Dataset \MyConnection.odc\MyTable does not exist or is not supported Here is the ...
1
vote
1answer
2k views

Looping through multiple feature datasets and Intersect Files?

I am getting an error with a python script I have created. I have 1 geodatabase with 3 feature datasets. What I would like to do, is loop through 1 feature dataset (NB) to get a list of feature ...
0
votes
0answers
51 views

Problem exporting ecw project- arcpy

I work with arcview 10.3. Every time i export maps with ecw raster format , python (version 2.7.8) get crashed and i see: I use this code: import arcpy,os,sys,string import arcpy.mapping from arcpy ...
2
votes
2answers
51 views

Export ArcGIS Metadata as a .pdf

I've been asked to automate the exporting of metadata from ESRI feature classes into .pdf files. We don't want the .xml files, rather a .pdf version of what you see in the Description panel in ...
3
votes
2answers
167 views

How to specify units when using SelectLayerbyLocation_management WITHIN_A_DISTANCE?

Can anyone help by suggesting how to specify the units when using the SelectLayerbyLocation_management tool. I am selecting by "WITHIN_A_DISTANCE" and the ArcGIS resources do not suggest how to do ...
7
votes
1answer
222 views

Why is matplotlib installed with ArcGIS?

Today I upgraded to ArcGIS Desktop 10.2.2 as well as the 64-bit background processing tool and noticed that both numpy and matplotlib were installed with Python. In fact, in the "What's New?" section ...
6
votes
1answer
773 views

How to automatically generate useful scales for data driven pages in ArcGIS desktop

I have been tasked with creating several hundred maps of properties that intersect a long pipeline. The maps will zoom to the part of the property which shows the intersection. The lengths of ...
5
votes
2answers
1k views

Describing a coordinate system in arcpy

I have a python script in ArcGIS 10.1 which takes in a few inputs from the user. One of the inputs is a coordinate system. I would like to test whether the coordinate system the user chose was ...
15
votes
5answers
2k views

How to make a GIS inventory?

My office will be seeing a big change in its GIS section. This section has been operational since the 1980's and has a huge collection of GIS data (i.e., shapefiles, raster files, data, etc) but never ...
2
votes
1answer
216 views

What is the word for “Bar” progress and write it in python script?

I am a beginner in python and have written a few scripts and I am wondering if there is a term for python to call and show the progress of the bar telling you from start to finish like you see in ...
1
vote
2answers
470 views

How to List Tables from current map document (mxd)?

We have many maps containing Feature Classes and Tables in a Personal Geodatabase that need their information updated. Is there a function to List Tables from the current map document like mxd = ...