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

learn more… | top users | synonyms (8)

3
votes
2answers
199 views

ArcGIS python “add field” and “calculate field” workflow

I am new in Python and I am creating a Script. I've crafted a functional code, but I'd like to know if there is an easier way to do it, just for curiosity (And learning new ways!). The purpose of ...
2
votes
0answers
57 views

Determining EPSG code for coordinate transformation using ArcPy? [closed]

I am trying to write a Python script which will identify the EPSG code for the coordinate transformation. I am familiar with the dataFrame.geographicTransformations function, however this returns a ...
1
vote
0answers
32 views

A mesh points for each polygon: how to create function?

I want to use function for creating a mesh point for each polygon, but I am new in python. what is wrong with the function: def creatingPoints(minX, minY,maxX,maxY,number): while minY < maxY: ...
1
vote
1answer
30 views

Something Wrong with The size of the Converted Shape File (arcpy.PolygonToRaster_conversion)

I currently have a python script to process some vegetation data, while using some specific shape files. The first step is to build a geo lookup table which needs to convert the shape file from ...
6
votes
1answer
61 views

How to recursively get all lyr file properties from a group layer on disk

I'm writing a python script tool that will recursively search through a folder and all subfolders and find all .lyr files. Ultimately, I'm writing a CSV file which contains the path of the .lyr file, ...
2
votes
2answers
90 views

Check-out XTools Pro with arcpy

I have an arcpy script that uses a XTools Pro geoprocessing tool, which works if I run it from ArcMap (with the XTools Pro extension enabled), but if I run it outside of ArcMap I get an error. Tool I'...
3
votes
3answers
78 views

How to generate a list of unique years from date field?

I have data that was collected over many years and I'd like to be able to run a python script tool in ArcToolbox (ArcGIS 10.1) to get a list of unique years from the date field. I found an example of ...
1
vote
2answers
58 views

Printing MXD files name using ArcPy gives AssertionError: Invalid MXD filename?

I try to print all the MXD files name. The MXD files located in one directory (which is divided into folders and sub folders). Also in the sub folders there are MXD files. I work with this code: ...
1
vote
1answer
95 views

Reclassify variable in ModelBuilder?

I want to reclassify a raster (variable) in model builder in two classes. First class ist 0-treshold = NoData and second is treshold-max value = 1. It works fine if i use an existing raster file as ...
0
votes
1answer
148 views

RuntimeError: cannot open <shapefile> from ArcPy search cursor? [closed]

import arcpy from arcpy import env env.workspace= "C:/Esripress/Python/Data/Excercise08" fc = "rivers.shp" cursor = arcpy.da.SearchCursor(fc, ["SHAPE@LENGTH"]) length =0 for row in cursor: length =...
0
votes
0answers
92 views

Error 000628: Cannot set input into parameter out_layer when executing MakeFeatureLayer

I have a script that runs fine in ArcMap and when published to ArcGIS Server: it runs fine when using folder workspace i.e GDB database. fails when using ArcSDE workspace to connect to a RDBMS. ...
1
vote
1answer
38 views

Change anchor point using ArcPy

Is it possible to changed the legend element anchor point using arcpy? This is the default anchor point: and i want this anchor point loaction: I know how to changed the legend element position ...
2
votes
1answer
46 views

How to get specific version (renedered with) of a feature layer in arcpy

Is there any way to get version of a layer loaded using arcpy.MakeFeatureLayer_management in arcpy with mssql server connection. There are tools that be used for several types of version related tasks ...
1
vote
1answer
65 views

What would cause a geoprocessing service to say “Cannot Open 'FeatureClass' Failed to Execute”?

I have a really basic geoprocessing script that's published to ArcGIS Server 10.2.2. It basically just reads in a json object that's passed in as a parameter. The json just has attribute names and ...
3
votes
1answer
58 views

How to slice a list based on row values? [closed]

I'm working with python 2.7 (quite a beginner). I have a list, and I have a feature class with : A = a field that contains values that I would like to use as the start of the slicing B= a field that ...
0
votes
0answers
23 views

Geodesic replacement of coordinates [duplicate]

With a updatecursor I can move vertex to a new location and modify polygons. For a simpele example I tried to move the world, see image. The black lines are the 'edges' of world (180,90 -180,-90 ,-...
4
votes
3answers
191 views

ArcPy.da.UpdateCursor error The requested operation is invalid on a closed state

Hello I am getting an error when trying to use the arcpy.da.UpdateCursor(). The error I am receiving is as followed The requested operation is invalid on a closed state I am in the python ...
4
votes
1answer
48 views

Access to graph properties in arcpy

I am using data driven pages and arcpy.Graph() object to automate production of synchronised map/long-section series similar to this: I'd like to keep vertical scale for long-section part. In order ...
3
votes
1answer
44 views

Can a Relate within an MXD be detected programmatically using ArcPy?

I would like to know if it is possible detect relates in an MXD using arcpy. Similar problem as the question below, but for relates instead of joins. Can Join be detected programmatically by ArcPy? ...
3
votes
1answer
51 views

Managing Leaders for Extent Indicators of Insets using ArcPy with Data Driven Pages?

I am working in data driven pages that need insets on some maps (not all). I found and have successfully managed to use this code below. However, I need to have leaders. Any ideas on how to manage ...
1
vote
4answers
206 views

How to modify a cell value in a raster under certain conditions (ArcGIS)?

I have a DEM raster with some negative values. After overlying other shapefiles, I realize that the negative values are for bodies of water (mainly lakes and bays). I want to replace the negative ...
5
votes
1answer
55 views

Using findAndReplaceWorkspacePaths in one directory (divide into sub folders) using Python?

I try to use 'findAndReplaceWorkspacePaths' function on MXD files using ArcView 10.3.1. The MXD files located in one directory (which is divided into folders and sub folders). Also in the sub folders ...
1
vote
1answer
65 views

Shapefile buffer assigning to each buffer a different length

I am new to ArcGIS and Python. I have drawn a set of lines (corresponding to a network) in a shapefile. I would like to buffer them, but each line has a different buffer length, so I thought to do it ...
0
votes
1answer
34 views

Outside ArcMap session, script fails to add/save layer to mxd file

The following code generates an layer output, but fails to add and save it to the specified mxd. There are no other layers in the mxd, and is just a 'ghost' / placeholder for running the script ...
0
votes
1answer
40 views

Run standalone python script against mxd, not outputting layer file/package

The bulk of the code used in my script for reading this is from @RHB located here. His block of code runs fine with a current map open. Need it to open without an ArcMap session open. I tried as ...
1
vote
1answer
58 views

ArcGIS Focal Statistics Returns Out-of-Bounds Result

I am trying to compute a moving window maximum on a raster, such that the output is the max within a 5 mile radius. This should result in an output grid where the maximum is equal to the maximum of ...
2
votes
1answer
55 views

Field Calculator is not calculating selection from Make Feature Layer in arcpy

I am trying to use field calculator to calculate 3 different fields in python from a Make Feature Layer variable. It calculates the first field (MATERIAL_T) but then it doesn't calculate the second ...
1
vote
1answer
43 views

Export footprints of an unmanaged raster catalog with arcpy

Is there a way to access the "export footprints" function for an unmanaged raster catalog with arcpy? It can be done through ArcMap when a raster catalog is added to the map as seen below. The ...
0
votes
1answer
44 views

Converting geodatabase public lands to a shapefile

Can a whole geodatabase be converted to a single shapefile? This is my code, not sure what I am doing wrong... # Import system modules import arcpy # Set environment settings arcpy.env.workspace = "...
0
votes
0answers
69 views

Understanding behavior of ToolValidator class and checkboxes in ArcPy?

In trying to simulate a pair of radio buttons in a ToolValidator class using checkbox parameters (yes, this subject has been discussed before), I find that I do not understand what exactly is the ...
1
vote
1answer
58 views

How to find the sum of many raster files in arcmap?

I have a list of 576 raster files for which I need to find the SUM. Obviously using raster calculator one by one would be tedious. Any easy script in Arcpy to do this?
0
votes
1answer
20 views

ArcGIS Calculate Near by looping through and matching .shp names from two different directories

I have several thousand shapefiles in one directory (direct1) and several thousand other shapefiles in another directory (direct2). The files in direct2 will have a match in direct1 and will have the ...
2
votes
0answers
69 views

Select by location not selecting all features in ArcPy [duplicate]

I am having an issue with the "select layer by location" tool in my ArcPy script, that may be due to a hidden memory error. Using one feature class with 281 polygons, I would like to select all of the ...
1
vote
1answer
51 views

Graph preview in Python toolbox

I need to create a toolbox in python, which will be used for making graphs. I need the parallel preview window during the graph creation. Half of the screen will be used for settings the parameters ...
1
vote
1answer
55 views

Calculating centroids without adding field to table using ArcPy?

I haven't been able to find any bit of code that does this successfully. I need to delete some fields in a table that I'm modifying using a script I'm writing. I don't want the fields to be left on ...
3
votes
1answer
62 views

ArcPy SearchCursor row format

I set up a script to print some statistics about line segments. The "logfile" is basically the same as "print", but to a textfile instead of on screen only. LogFile("Feature {0} has a length of {1}...
3
votes
0answers
32 views

Mask out values in a raster based on standard deviation

Does anyone know (in Modelbuilder or python) how I can remove any values of a raster that outside of the range of three standard deviations? I have a lot of rasters so it would be quicker than ...
2
votes
1answer
102 views

arcpy.UpdateCursor updates every row

I would like to update a field with new values. With the code below it assigns the value '2' to all the rows and not just if the field == 2. But by 'print i' and 'print "it is 2"' everything looks ...
3
votes
0answers
20 views

How to get rid of layer created by Make Feature Layer (Data Management) [duplicate]

I like to run some scripts from mxd. Very often I am using Make Feature Layer tool to facilitate queries. Tool help says: “Creates a feature layer from an input feature class or layer file. The layer ...
3
votes
3answers
231 views

Can a feature class be stored as a shapefile?

This is a general question about how a feature class is stored or can be stored using python/arcpy. Can a list of created points (a feature class) be saved as a shapefile or in a shapefile, or to ...
1
vote
0answers
75 views

Replicate elevation profile extraction (from 3D Analyst toolbar) with Python [closed]

I'm looking to take Python (v2.6.0) control of some ArcGIS (v10.3) toolbar functions in 3D analyst, so I can modify and automate these operations. If the answer is that I need to do this from scratch, ...
5
votes
1answer
211 views

UpdateCursor gives Too few parameters Expected 1?

Can anyone tell me why my script isnt working? I cant figure out where I went wrong. I am working with an access personal geodatabase. Adding a field, then updating that field with yes if the field ...
1
vote
2answers
102 views

Updating firstPoint and lastPoint using ArcPy cursor?

I want to update a Line feature's start and end. I got Point of first and last. BUt, I can't update them. What is wrong ? (I'm using ArcGIS 10.2) rows = arcpy.UpdateCursor(srcFile) feat = row....
1
vote
0answers
62 views

Looping spatial join in arcpy - order problems

I developed a python script where the user inputs a polygon shapefile multiple point shapefiles and within the script the polygon shapefile is divided into 1000mx1000m grid cells and the point ...
1
vote
1answer
57 views

ArcPy: Geoprocessing for the data with specific variable [closed]

Imagine if we have dataset like this: +------+------------+ | City | DistrictID | +------+------------+ | A | 001 | +------+------------+ | B | 001 | +------+------------+ | C |...
1
vote
1answer
33 views

Value Table in Python Script not displayed correctly?

I am trying to implement a Python Script tool where I need a table to input shapefiles and corresponding names for new created fields. I found out that there is the Value Table provided by ArcGIS, ...
4
votes
2answers
130 views

Python script that creates polygon feature class with given coordinates

Write a script that creates a new polygon feature class containing a single ( square ) polygon with the following coordinates: ( 0, 0 ), ( 0, 1,000 ), ( 1,000, 0 ), and ( 1,000, 1,000 ). ...
2
votes
1answer
84 views

arcpy.Clip_management throws 999999 error. Running from toolbox works fine

I want to clip multiple rasters to my study area, so I'm writing a script that's using the arcpy.Clip_management tool. However, the tool throws an 999999 error with no explanation when executing. I ...
4
votes
1answer
44 views

Using findAndReplaceWorkspacePaths to change picture path element- ArcPy

Picture element, in 60 MXD files, disappear and there only blanked rectangle instead. I know one way to solved it, by go to the picture properties-->picture tab. But i try to find a way do it with ...
3
votes
1answer
39 views

Using findAndReplaceWorkspacePaths to change datasource for CAD files- ArcPy

I try to use "findAndReplaceWorkspacePaths" in order to change datasource for CAD files. This code works fine but when there no cad layers to work with, despite this the code will print '...