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

learn more… | top users | synonyms (1)

1
vote
1answer
16 views

Saving each file in for loop gives ERROR 000872?

I am beginner to Python programming. I know, I am asking a really silly question. I am trying to extract DEM for each watershed from a bigger DEM. Therefore, I am using extract by mask. The bigger DEM ...
1
vote
1answer
91 views

Using Zonal Statistics As Table for overlapping polygons in ArcPy?

I'm using ArcGIS 10.2 for Desktop and would like to calculate the population within a specific distance from bus stops. My input layers are: census block (polygon) with population undissolved bus ...
0
votes
1answer
20 views

update cursor datetime if start date greater end date

I have 2 date fields in my feature class. If the start date is greater than the end date, I want to add 24 hours to the end date. I am getting a SetValue error. cursor = arcpy.UpdateCursor("PolyFc") ...
1
vote
1answer
52 views

Python - Projecting different shapefiles in the same folder

I have a few shapefiles in one folder with different coordinate systems but would like to use one of them as a template dataset. Is there a way to use python to filter out the shapefiles already in ...
1
vote
2answers
78 views

Using where clause to query date ranges in ArcPy

I would like to query a feature classes date range. For instance, if there is data within a 2 day range then I would like to print true or do something else. I thought arcpy.Exist would do the job, ...
2
votes
2answers
77 views

Accessing multiple shapefiles in folder using Python and ArcGIS for Desktop?

I have been asked to create a custom script to reproject shapefiles (different projections) from a folder, but can't contain values such as filenames and path names to access them. I have started ...
0
votes
0answers
16 views

How can I create text using Python in ArcMap 10.1

I am using data driven pages to create a map book and I want to create the neighboring labels. Is there a way to create the label with a background? And when there is a NULL value in the attribute ...
0
votes
2answers
74 views

Creating Python script tool?

I have ArcGIS 10.2 for Desktop and I have created code which does the following. Abstracts from 1st row 1st column 10, (1500-10) adds it at the second and then repeats A-=A where A= 1500. I want to ...
0
votes
2answers
75 views

How to change different projections of feature classes in geodatabase to one projection in new geodatabase?

I want to create a script that iterates through feature classes with different projections in a geodatabase and exports them into a new geodatabase, all with the same projections. What I want is to ...
4
votes
2answers
120 views

arcpy.da.SearchCursor ignores the where_clause parameter?

I'm trying to use arcpy.da.SearchCursor to go through records in a feature class stored in a SQL SDE database. I do so through a feature layer (created in arcpy) called "unit_lyr". When I run the ...
0
votes
1answer
42 views

Create Table from Selection

This is a continuation of a problem that was solved earlier this week. The code below performs a select by location and was originally intended to export all feature classes from the SDE database to ...
0
votes
0answers
24 views

Help how to return values from multiple columns to dictionary [migrated]

can anyone help with how to call additional columns to my dict below please? The example works fine for the return of one set of values (column) but I need to return values for 2 columns that are not ...
1
vote
1answer
39 views

Set GPLinearUnit type parameter default based on input spatial reference (Buffer Example)

Within a .pyt python toolbox I'd like to have a parameter of data type GPLinearUnit get a default value based on an input Feature Class (FC). The standard Buffer (Analysis) tool works as a great ...
0
votes
2answers
41 views

SearchCursor doesn't return entire SHAPE field, how do I copy a row containing a SHAPE field?

I imported a shapefile into a feature class using arcpy.CopyFeatures_management(). It works and when I look at the feature class in ArcMap and TOAD, I see all the data and the SHAPE field is populated ...
1
vote
1answer
19 views

How do I expand the .SDE file specified in my current workspace?

I'm storing my database connection in a .SDE file. When I output my feature class names in that database connection, I get the full path to the .SDE file. I want the details, like instance, for the ...
1
vote
1answer
45 views

Viewing pseudo node and dangle nodes using ArcPy?

We know that we require production mapping extension and ARCINFO license to view the pseude node and dangle nodes.We have to see these nodes without these functionality through python scripting,but I ...
1
vote
2answers
119 views

How to populate attribute table with sequential numbers?

Using Python, how can we populate a field in a feature class automatically in increasing order? The user must be able to provide the start number. For example, say he wants to populate values from 51 ...
0
votes
1answer
75 views

Problem with addιtion abstraction in Field Calculator

I want a bit analytical respond for the mistakes I have done in my code cause I am new to programming. I am using ArcGis 10.2. and I must process a field with distances in an attribute table I have. ...
1
vote
1answer
86 views

Using Python add-in wizard with ArcGIS 10.3 for Desktop?

I'd like to create an add-in for ArcMap (ArcGIS 10.3) using Python. Unfortunately, the wizard does not seem to have been updated for 10.3, which is the only version Esri provides for download at ...
1
vote
2answers
46 views

SaveToLayerFile does not properly save symbology

I'm trying to save a symbology from a layer, but any way I try to do it, it just gives me a unsymbolised feature shapefile when I try to add the newly created .lyr file. Anyone have any idea why this ...
0
votes
2answers
37 views

How to use SQL within python in ArcGIS Labels

I'm trying to create labels across a one-to many relationship and have tried a simplified version of this method. My version looks like this: def FindLabel ( [NAME_V2] ): import arcpy ...
2
votes
3answers
73 views

Select by Location and extract features using arcpy

So I'm fairly new to arcpy and have been trying to figure out a relatively simple select by location/extract features to new layer automation in ArcMap. What I am trying to do is select features from ...
5
votes
2answers
158 views

Avoiding Python version confusion when using IDLE with ArcGIS Pro and rest of ArcGIS for Desktop?

I have just started to work with Python 3.4.1 which comes with ArcGIS Pro 1.0.0, on my laptop, which also has Python 2.7.8 which comes with ArcGIS 10.3 for Desktop installed, and I would like to ...
2
votes
4answers
152 views

Using Loop function with arcpy.Exists()?

I have a code snippet using elif that checks if a file exists and continues to check through the letters of the alphabet (for example _A, _B, _C etc). All works fine but I think there must a better ...
4
votes
1answer
87 views

How to write to a single table via Python multiprocessing

A comment in the post Can multiprocessing with arcpy be run in a script tool? got me thinking, as I often need to do exactly this: Just beware of deadlocking situations (two Insert cursors in the ...
0
votes
1answer
28 views

Export DDP to MXD based on Raw_Input?

I am running ArcGIS 10.2.2 Version 10.2.2.3552, using ArcMap. I have searched and haven't found anything on this or if it is even possible. I'm trying to add something to my script that allows the ...
1
vote
1answer
62 views

Using Update Cursor?

I am currently trying to get my update cursor to populate every row in each attribute table for 175 different feature class fields. I have written the script and it is populating the first row but all ...
1
vote
0answers
56 views

Is there PostGIS equivalent to arcpy.sa.Slice() function?

I have an existing system built on an 8.3 PostgreSQL database which uses a ArcGIS - Spatial Analyst for a couple of raster operations. The system is moving to PostgreSQL 9.2 and I'm evaluating if the ...
0
votes
2answers
57 views

Convert jpg raster format to tif format

I have 120 rasters( jpg format ) and i want to convert them to tiff format to folder called "OtherFormat" in env.workspace with arcpy. In my code i try to convert all jpg file I read ...
0
votes
0answers
48 views

Calculating distance from PointGeometry object to polyline in arcpy

I created a PointGeometry object on ARCPY and I'm trying to measure the distance from that point to the closest point on a polyline table.. The PointGeometry object has an easy function for that ...
0
votes
2answers
35 views

Update Multiple Columns within One Update Cursor

Are you able to update several fields within an attribute table at the same item within one Update Cursor command. Code Example: with arcpy.da.UpdateCursor (fc, fields) as cursor: for row in ...
1
vote
1answer
36 views

Iterating through a point layer to create & sum distance rasters

I'm writing an Arcpy program to process data in a layer of several hundred points ('ptsLyr', from file 'ptsFile'), each of which has its own ID ('RecordID') and an associated value, 'radius', that I ...
0
votes
1answer
47 views

Using pymssql to create a table using python ArcMap 10.3

I am using ArcMap 10.3 have a my data in a geodatabase (MS SQL Server Express) and I am trying to write a python script that does a bunch of spatial and non-spatial data manipulation. I need to dump ...
1
vote
1answer
52 views

In ArcPy, How to call specific columns of attribute table?

I'm trying to figure out how to spline specific columns of a shapefile attribute table, but my question is intermediate to this-- how do I select a range of columns, e.g. the 20th column to the ...
1
vote
1answer
39 views

How do I enumerate the messages in arcpy.GetMessages()?

Messages are present in GetMessages() but it's a formatted string. I want to add some of my own newlines and alter the content on a per-message basis. How do I access the individual messages in ...
1
vote
1answer
25 views

Create Multiple Feature Layer and Add to MXD

I am really stuck with this one and cannot seems to get the code to execute. Every time I do so, I get the error: Input Features: Dataset [u'Test1'.....] does not exist or is not supported. My guess ...
4
votes
1answer
118 views

Can multiprocessing with arcpy be run in a script tool?

I have been tinkering around with the multiprocessing module to resolve some processing of data in ArcMap 10.3. I have created a script which works fine if I run it in IDLE. I see all my cores max ...
0
votes
1answer
34 views

Exporting list of tables contained in *.mdb with ArcPy gives Indentation Error?

I'd like to export to excel each of the tables in a .mdb database as separate .xml files. The code works until the last line which gives an unexpected indentation error, and I'm also struggling with ...
0
votes
0answers
113 views

Help with python, import update csv values to feature class fields

I am trying to update a bunch of field values from a csv file where there are existing (incorrect) values in my featureclass. After searching I came across a similar post (Help with Python Update ...
1
vote
1answer
40 views

Concatenating fields while also replacing values within certain stings [closed]

I am trying to use python to concatenate multiple fields in a polygon layer. Specifically, I am attempting to combine the values of four fields into one: EXPCODE = !MATRIX! & !PLANT! & !PCT! ...
0
votes
1answer
71 views

trying to build world file for images based off extent rectangle generated from centroid in python

I have centroids for map images which I would like to georeference quickly and rougly via python script, using arcpy. I know the dimensions of the images, the dpi, scale, rotation and the coordinate ...
1
vote
2answers
37 views

Running Select results in error 000210

I'm trying to run SELECT in order to extract specific features under "CLASS_NAME", but continue getting "ERROR 000210: Cannot create output". I've searched though other questions with the same ...
0
votes
2answers
35 views

Arcpy reclassify label display issue

I have been looking for about 2 days and I can't seem to figure out or find a work around for the symbology labels after a reclassify when trying to automate maps. I run the following code and it is ...
-1
votes
0answers
45 views

Error importing ArcPy after Python upgrade?

Why i cannot import my arcpy in ArcGIS 10.2 python window after i updated my python 2.7.3 to 2.7.9, but i can use it after i run my ArcPy on python interpreter shell (outside ArcGIS), is there any ...
0
votes
1answer
48 views

Alter Fields in multiple feature classes in multiple workspaces

I have 22 geodatabases all in one folder. Each gdb has two feature classes. For each feature class, I need to rename a few of the fields. I've had success with this code, but it only works for each ...
3
votes
0answers
29 views

Automate Exporting of Rasters Using Renderer in ArcGIS

It is possible to export rasters in ArcMap by right clicking the layer-> Data-> Export: You can then click 'Use Renderer' check box to ensure the image you export uses the current ...
1
vote
2answers
71 views

Referencing layer in Table of Contents using ArcPy?

I'm looking for the best way to reference a layer in the TOC using arcpy and, if it is possible, that is different than the following: mxd = arcpy.mapping.MapDocument("CURRENT") df = ...
0
votes
2answers
42 views

Exporting gdb tables to excel in folder containing gdb?

So i have several folders which each contain a gdb. Now, I export the attribute tables of polygon feature classes using the following code (probably could use some optimization): folder = ...
0
votes
0answers
22 views

Failed to execute (ExtractByMask)

I use ExtractByMask of arcpy to isolate to subset the provinces of the Philippines. I do it with this code. import arcpy from arcpy import env from arcpy.sa import * ...
2
votes
2answers
239 views

Running Python script in Task Scheduler— Script will not run

I have a script which I wish to run on a regular monthly basis without me needing to open and run the it. I have referred to every web page I can find on Windows Task Scheduler and followed their ...