A site-package created by Esri to expose GeoProcessing from ArcGIS to Python.

learn more… | top users | synonyms (7)

1
vote
1answer
49 views

ArcGIS REST API: using /addItem with secure service

Using the code below I am adding 100's of Map Services to a portal instance. The script successfully runs and adds them however the services are secure so I would like portal to store the username ...
0
votes
0answers
30 views

Why does the Legend vanish when exporting MXD to PDF using ArcPy?

I try to export multi MXD files into pdf. The code run without an errors, but the problem is that the legend vanished from several pdf files: import arcpy,os import arcpy.mapping from arcpy import ...
1
vote
1answer
49 views

Optional Parameter becoming required in ArcPy?

I would like to make a python script (.pyt) where i have 2 input parameters: If the first parameter (which is a boolean) is set TRUE, therefore it is checked, the 2nd parameter should become required ...
3
votes
3answers
114 views

Multi MXD export excluding specific MXD using arcpy

I try to export multi MXD into pdf files, but i want to exclude specific MXD files from this action: import arcpy,os import arcpy.mapping from arcpy import env env.workspace = r"D:\desktop\Project" ...
0
votes
0answers
14 views

Selecting predefined ArcMap template using ArcPy? [duplicate]

i have managed to create script for search cursor which will replace the text element in one of the template from help provided from my previous question Replacing text.element from feature class ...
2
votes
2answers
85 views

Update cursor for joined field

I have a huge point vector data (around 3 million point; in a gdb) with attributes and I have table (created with Near analysis.). I want to copy one of the field values to data. So I joined the table ...
0
votes
1answer
47 views

Using Update Cursor to update all fields in a feature class based upon another feature class

I have perused GIS stack exchange to find an answer, but haven't quite found what I am looking for. Question: I am trying to update all the fields in a feature class based upon field values from ...
1
vote
1answer
46 views

Issue with arcpy.MakeFeatureLayer_management in tool

I have created a python toolbox that creates separate layers based on unique field values within a feature layer. For some reason arcpy.MakeFeatureLayer_management will create the layer but will not ...
4
votes
1answer
51 views

Making output table of Python script tool be intermediate file to another model?

I have created a Python script tool using ArcPy. It has a File Geodatabase Table as output. I want to add the script to a new Model in ModelBuilder in ArcMap. The Table output should be an ...
1
vote
2answers
36 views

ApplySymbologyFromLayer_management Overwrites Graduated-Color Class Break

My goal is to generate any number of MXD files with custom class-break-values using a consistent, pre-defined style. For example, in ArcMap (10.2.2 and 10.3.1), I have an MXD with a graduated-color ...
1
vote
0answers
29 views

Python's logging module not working with ArcPy [duplicate]

I have a Python script imported to an Arc toolbox. It uses Python's logging module for message recording. import logging import time import os, sys import arcpy ...
1
vote
1answer
60 views

Text field character length optimizer

I need to automatically optimize text field character length to their current largest attribute character count. For example the field "MyName" is 250 characters long, but has attributes that are a ...
1
vote
1answer
56 views

Clip analysis in ArcPy?

I have one shapefile that covers an entire city. I also have a list of 100 shapefiles which are buffers in different places in the city. Now I want to clip for each buffer from that city using ArcMap ...
1
vote
1answer
42 views

Using PyScripter with ArcPy: “import error, no module named _base”

I'm trying to use ArcPy in PyScripter. I don't have admin privileges on this computer (it's my work computer) so I have to use a portable version of PyScripter. I'm sure my boss would let me install ...
1
vote
1answer
34 views

Updating null values in appended feature class

I am creating a customized script tool that first clips out a line feature from one feature class, dissolves the fields of the clipped feature class so that just one feature is in it, appends the ...
1
vote
1answer
61 views

Deleting feature classes from a geodatabase using arcpy.ListFeatureClasses()

Following up on Using FeatureClassToFeatureClass from list to concatenated list? The error I get is "Parsing error SyntaxError: invalid syntax (line 10)". Using the methods from above I am unable to ...
7
votes
2answers
206 views

Installing an ArcGIS add-in on several PCs

I usually do my python scripts and add them to ArcMap in the form of add-ins. First I launch the ArcGIS Python Add-In Wizard, create a project, a toolbar and the tool. Then, every time I do an ...
2
votes
2answers
48 views

Arcpy 10.0 using update cursor completes but ArcGIS crashes

I'm using an update cursor to iterate through my feature class, create a selection and then delete the row if it meets the condition. It partially works - I get no error messages and the script ...
2
votes
0answers
32 views

Extracting Mean from Raster and Writing to Table in ArcPy?

I am simply trying to extract the mean of each raster within a geodatabase and write the value to a table. I have done this successfully with another set of rasters, but now I keep getting the ...
0
votes
2answers
30 views

Using FeatureClassToFeatureClass from list to concatenated list?

Have many feature classes in geodatabases and eventually want to run more complex processes on them. Having trouble with the basics - can anyone tell me what I am doing wrong with the following? If I ...
1
vote
0answers
30 views

How to parameterize query sent with arcpy.ArcSDESQLExecute class

I have been developing a geoprocessor which takes user inputs as strings to develop a dynamic sql statment sent to MSSS from an ArcSDESQLExecute class. The app will only allow for controlled input, ...
1
vote
2answers
46 views

IndentationError: expected an indented block

I am getting the IndentationError in arcpy. I understand this is covered elsewhere but none of the tips appear to be working, I cannot figure out the error. Here is my code; def getCoords(self): ...
2
votes
1answer
19 views

NAME is not defined when defining class arcpy

I am having an issue I have not had before creating a class with a method as below; class Points: def __init__(self, inFC, buffDist, sector): #Must have a set of points and a value to buffer these ...
1
vote
1answer
34 views

updating Z coordinates of points in polylines

I have a polyline feature dataset with Z coordinates. I'd like to change the Z values (e.g.) by adding 10 meters. I am trying the following code, but no changes happen. It seems the code is able to ...
-2
votes
0answers
28 views

How to define empty Raster object with arcpy?

How do I create a empty Raster object in ArcPy? The issue here is raster_sum = raster_sum + rasters[counts], how do I predefine raster_sum as a Raster object which is empty? >>> for x in ...
0
votes
2answers
31 views

CellStatistics is not defined error

Code : >>> import arcpy >>> ras1 = arcpy.Raster(r'D:\IMD\test_converted1961.img') >>> ras2 = arcpy.Raster(r'D:\IMD\test_converted1961_fliped_ud1.img') >>> result = ...
3
votes
1answer
91 views

Using Update Cursor, populate field

I am trying to write a script where you preemptively select features and then go to the tool which calls for the feature layer and it populates fields based on certain criteria which I will design of ...
2
votes
2answers
43 views

How to use loop to add georeferenced JPEGs from folder to mxd?

This is my first time using this site and I'm a bit new to ArcPy. I've looked around for a while but couldn't quite find the answer I was looking for. I have many folders with georeferenced topos in ...
2
votes
1answer
64 views

Transfer data from access mdb to personal geodatabase (OLE, Python scripting)

I am very new in Python. And I guess I need to use lots of Python here. I have MS Access 2003-2007 database (mdb format) and personal geodatabase (mdb). I created a tool in Access that imports data ...
4
votes
2answers
114 views

Incorporating several Python script tools into one tool and have user input determine section of script run?

I have a series of script tools created and work well in ArcMap 10.2.2 just fine. These tools generate a series of buffer features from an input feature class. I have these as separate tools each ...
2
votes
1answer
20 views

Error trying to call for raster file in gdb RasterToPolygon [closed]

I'm trying to convert raster to polygon. But I'm running into error. ERROR 000865: Input raster: C:/Juivy//python/python.gdb/test does not exist.. This is what I wrote: import arcpy workspace = ...
0
votes
1answer
25 views

Writing Where Clause for text field in arcpy.SelectLayerByAttribute_management()?

I am having problems writing WhereClause for my program. I am using 10.3 arcmap. My layer comes form a file geodatabase. I have this code: mlayer = arcpy.mapping.ListLayers(mxd, "1415_LGA_SpatJ", ...
1
vote
1answer
41 views

arcpy SearchCursor is creating a comma within a tuple

I am creating a list of tuples of coordinates of a feature class. Feature class is created as such: inFC = arcpy.GetParameterAsText(0) The inFC is a point feature class. I then have the following ...
3
votes
1answer
49 views

Importing arcpy in Spyder

I can't import arcpy in spyder but I don't have any problem when using PyScripter. The error that I get is: ImportError: No module named 'arcpy' I would prefer using Spyder, if I can solve this, any ...
2
votes
1answer
80 views

How to compute zonal statistics fast?

I have 12000 circles with a radius of 50 miles on a raster with 0.05 degree resolution. Global analysis. The raster is 32 bit float and I have to calculate zonal statistics for 20 different rasters. ...
1
vote
1answer
29 views

Arguments error when running LineDensity scripts in arcpy

I'm trying to use LineDensity tool on polyline features. The shapefile is small and includes some invalid geometries. The code I use is an adaptation of an ArcGIS Help script. Here is my code: ...
2
votes
1answer
56 views

Is it possible to append data to existing NetCDF file using ArcGIS or ArcPy?

There is a Raster to NetCDF tool for converting raster to NetCDF using ArcGIS. I need to append raster data as dimension to NetCDF? How to do that using ArcGIS or ArcPy?
3
votes
1answer
40 views

Cannot pass python string outputs as inline variables in modelbuilder

I'm trying to pass a couple of strings from python as parameters in the extract by mask tool in modelbuilder. Unfortunately it doesn't recognize them. When I type them in the parameters it thinks I'm ...
3
votes
1answer
42 views

Remove holes from polygons using geometry objects

I've written a script that should remove holes from polygons with use of cursors and geometry objects. However, holes remain even though I'm constructing new polygons from the vertices from the first ...
2
votes
0answers
51 views

Benchmarking ArcPy / ArcMap Performance on different computers?

This project came out of my need to build a justification for a faster work computer. Before asking for new equipment I want to be prepared to show the increase in performance by adding RAM or more ...
0
votes
1answer
51 views

Extracting channel banks from DEM and channel newtork

Currently I am working in project that require from me extracting channel banks. I have been thinking about the best method that I can use to come up with good function that extract the location of ...
0
votes
0answers
28 views

Python importing Arcinfo to Python 2.7.11 Script

I am having trouble getting an arcinfo license using a python script. When I try to call "import arcinfo", making sure it is my first line of code because of legacy issues, I get the following error ...
1
vote
1answer
26 views

Data Driven Pages ExportToAI Resolution syntax?

I'm fairly novice with code. I am trying to do a simple data driven pages export to .ai using arcpy. I need the resolution down to 150 DPI. Line 4 brings up parsing errSyntax Error: Invalid Syntax. ...
1
vote
1answer
50 views

Can arcpy.MakeXYEventLayer() cope with *xls files in script?

I am trying to create a point FeatureClass from an Excel-File using a standalone python-script. I am applying the method "arcpy.MakeXYEventLayer()" which works fine using *.xlsx files. However, I am ...
1
vote
0answers
33 views

How to display geoprocessing service results in an ArcGIS Online Map?

I am implementing a python script that filters features in a feature service. For this I used the following lines of code: import arcpy # URL with service, where clause and field parameter baseURL= ...
8
votes
3answers
166 views

“Greedy” clipping lines with polygon

I am wishing to clip a set of polylines (black lines in image below) to the outer boundary of a polygon. Any voids within the polygon should be ignored. My ideal output are the dashed yellow lines. ...
1
vote
0answers
28 views

How to transfer SQL variable back into ArcPy script?

I am trying to teach myself to access sql tables from an ArcPy script as part of a larger QC process. I am fairly certain that I have the sql statement correct (it works in SQL Server, albeit ...
0
votes
0answers
19 views

Using numpy.dstack() for merging two 3D arrays but losing spatial reference.

The code is as following: >>> temp = numpy.dstack((spi_negative,spi_positive)) >>> >>> temp.shape (16, 126, 294) >>> out_ras = ...
2
votes
1answer
44 views

How to create polylines from a point Feature Class linking all points using arcpy

I want to create polylines linking a bunch of points. Individual polylines must be created between every point. I started by reading the x & y cords and then created unique pairs as well as all ...
2
votes
3answers
59 views

Calculate line density in multiple overlapping polygons

I am working with two layers. One is polygons (animal locations buffered by 5 km), and the other is polylines (for example, roads). I would like to calculate the line density for each polygon, ...