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

learn more… | top users | synonyms (7)

0
votes
1answer
35 views

Merge several .lyr files that contain a raster photo column

Shapefiles do not support raster files, so I created a geodatabase and made feature classes of the points. I then added a column titled "photos" and added the photo as a raster to the point. I now ...
0
votes
1answer
50 views

Using variable in SelectByAttribute_management [duplicate]

I am new in Python. I was trying to use a variable for selecting a feature instead of giving a direct input. My code sample will explain it better: import arcpy from arcpy import env ...
0
votes
0answers
40 views

How to extract cross pattern in point data based on heading field, automated using ArcPy

I'm trying to automate a process to identify and remove a cross pattern in point data, as seen below: This picture shows the points colored by heading (degrees from North), with the exception of ...
0
votes
1answer
44 views

arcpy script tool: creating a point feature from user input XY coordinate

This part of my tool is giving me issues. I want to create a new feature class based on the user's input workspace, then generate a new point feature within that feature class based on the user's ...
1
vote
1answer
43 views

Datatype and filter for a SDE connection parameter in a Python toolbox?

I have a tool in a Python toolbox. As a parameter, I want to let the user select an existing (or possibly create a new) SDE connection. What value for datatype should I use for this? I have tried ...
1
vote
1answer
39 views

How to interpolate only cells in a raster that are adjacent to existing cells with a value

I have raster data of a continuous field. I need to calculate zonal statistics on that data for some polygons (e.g polygons A and B in the image). It is essential that I have as complete as complete ...
1
vote
1answer
53 views

Using Python script to create map from external source via ArcGIS for Server?

Is it possible in ArcGIS Server to write a python script to pull features from a third party database in real-time? Essentially I want to create a service where I can pass in filter parameters (BBOX, ...
0
votes
0answers
17 views

using import ogr in Arcgis python [duplicate]

I need to use import ogr in my python window provided by ArcGIS 10.2, but i can't configure ogr and gdal on my system. Please tell me how i can fix this issue and import ogr in my python window ...
1
vote
1answer
60 views

How to merge two point feature classes based on spatial location using ArcPy?

I have two point feature classes, each containing about fifty points. These 2 point feature classes should be merged, or the points of feature class 2 added to feature class 1, as feature class 2 does ...
0
votes
1answer
25 views

OD Cost Matrix (arcpy) Layer Not Added

I'm trying to create a OD Cost Matrix layer programmatically. The problem that I have, however, is that the layer doesn't get added to my Table of Contents. If I manually run the Network ...
0
votes
3answers
76 views

SetNull in Python script “Value < 0”

outSetNull = SetNull(outRas2, outRas2, "VALUE < 0") When I try to run the SetNull tool using the expression: "VALUE < 0" the output returns a min = 9.53674e-007 Consecutive run with exact ...
1
vote
2answers
42 views

Passing value from GetParameterAsText to row.getValue()?

I am trying to build a simple tool that concatenate values from two fields, and recording it in newly created field - everything within the same table. This tool should work with any shapefile, ...
4
votes
1answer
135 views

How do you check if two feature classes have the same spatial reference?

Using arcpy, how do you check if two feature classes have the same spatial reference? Just checking if the two are equal doesn't work: >>> import arcpy >>> fc1 = ...
1
vote
1answer
55 views

Export legend element using arcpy.mapping

I'm working on an ArcGIS JS API web application that requires a heavily customized PDF report. When a user submits their desired extent to our reporting function, we need to convert their webmap to ...
6
votes
2answers
411 views

How can I turn a python list into a table?

I am trying to create a table of coded values so each textual description has a numerical attribute. The order of numbers is not important - they just need to be unique. What I have so far is a ...
2
votes
1answer
64 views

Print rasters count in Python

I'm trying to print raster batch count number in PyScripter and ArcGIS 10.3 I'm using the next code: import arcpy carpeta = arcpy.env.workspace = r"C:\Base_de_datos\Cuencas_raster" for raster in ...
5
votes
2answers
125 views

Find lower left corner of a rotated polygon

I am currently struggling with a mathematical problem and can't seem to get it solved. I have a bunch of rotated rectangular polygons (solution should also work for non-rectangular polygons) in ...
0
votes
0answers
39 views

Iterate through all line features to find adjacent lines with matching identifier

I have a polyline layer, and I would like to iterate through each feature to assess which lines in the same layer are adjacent (i.e. touch) to it. If one line touches another, AND has the same ...
1
vote
1answer
55 views

Deleting polyline vertices coincident with points in ArcGIS?

I'm looking to take a shapefile of points and a geodatabase feature class of lines as input and delete the vertices from the lines coincident with the points. I found a similar question already asked ...
0
votes
1answer
47 views

I want to clip a raster image with vector layer but the output area is mismatching why?

I using arcgis10.1 extract by mask tool to clip bkgha1 raster with rubber2012 vecotor layer,clipping process is successful and the result is bkgha file.The next process is i want to reclassify the ...
1
vote
2answers
71 views

What is the life cycle of arcpy script in arcgis?

In the code below just before the arcpy.AddMessage("Finished!") statement I have used a selection Query. The problem is that the newly created shape file Testing1 in which am firing the query is ...
5
votes
1answer
90 views

need to find max value among fields AND PRINT FIELD NAME

I have a Census dataset that contains eight fields with percentages. I would like a python script that finds the highest value between the eight fields, but also tells me which field the highest ...
1
vote
0answers
88 views

Automate multiple repetitive ArcGIS 10.2 Table Relates?

I have a situation where multiple users will be creating many file gdb's in ArcGIS 10.2 using just the basic license. The data format is standardized and will have a feature layer with point data and ...
0
votes
3answers
77 views

Compress - ERROR 000837: The workspace is not the correct workspace type

Getting an error with a very simple compress script. This script works perfectly fine within arcmap, but I want to make this into a scheduled recurring script. import arcpy from arcpy import env ...
10
votes
1answer
246 views

Is there ArcPy tool for polygon resizing like Scale tool of Advanced Editing toolbar in ArcMap?

I am writing a python script for ArcGIS 10.3. I know about Scale tool in ArcGIS interface but I can't find such arcpy command. It exists? As you can see on the picture the Scale tool works different ...
0
votes
1answer
107 views

Setting CopyFeatures_management output to newly created folder in Python script?

How do I set the output of the copyfeatures_management so that the shapefiles go into the new folder I created? Currently, they are being placed in my set workspace at the beginning of my code. ...
2
votes
2answers
42 views

Setting Python Toolbox Parameter to None without making current selection value unselectable thereafter?

I'm making a python toolbox and it has an input parameter of type GPFeatureLayer. Let's call it my_param. In updateParameters when my_param.altered, its value is added to a value table. Then I'd ...
0
votes
1answer
81 views

Python code to select streamlines within selected watershed

I'm trying to calculate total stream length for multiple, overlapping watersheds (i.e., each watershed contains the watersheds upstream of it). I have a flowline layer that I've run through the ...
1
vote
1answer
70 views

Looping through records to create ArcGIS reports

I am using ArcGIS 10.1 Standard with Python 2.7. I am trying to loop through records in a feature class using a Search cursor and for each record, run a custom ArcGIS report. I have created the report ...
6
votes
1answer
152 views

Programmatically check if service pack is installed

Is there a way to check with arcpy whether or not a specific ArcGIS for Desktop service pack is installed on the local machine? More specifically, my script can only work with ArcGIS 10.1 with SP1 ...
1
vote
0answers
53 views

Defining spatial reference for multiple raster files [closed]

How do I define the spatial reference for a bunch of *.JP2 files? import arcpy from arcpy import env arcpy.env.workspace = "C:/Ortho" lrs = arcpy.ListRasters("*","JP2") for rs in lrs: print ...
1
vote
1answer
145 views

How to check in Python if a model has been successfully executed from a toolbox?

I have created a Toolbox (alias: mytool) and a model (name: mymodel; and it takes 2 parameters which are 'this' and 'that') with ModelBuilder. I need to execute this model from a Python script. ...
0
votes
1answer
60 views

Code error - remove layer using python

Continuously to How to remove layers that are not in visible df extent i try to remove layers that don't appear in the data frame with this code: import arcpy,os from arcpy import env env.workspace ...
0
votes
1answer
62 views

'Result' object has no attribute 'GetMessage', ArcGIS Example

i'm using the following ArcGIS example to calculate the surface and volume of a raster. I added the script to my toolbox: ...
1
vote
1answer
43 views

Making lookup table for performing Lookup(inRaster, lookupField)?

I want to replace the Digital number (DN) values in a raster file with some other values which are present in a text file;in the text file, I have a table which it's first column are all possible DN ...
0
votes
1answer
46 views

Creating new layer from selection in ArcPy? [closed]

arcpy.SelectLayerByAttribute_management() helps in selection but I am unable to create a new layer from the selection arcpy.MakeFeatureLayer_management() for generating new layer file but it gives an ...
1
vote
0answers
37 views

Changing label symbology in ArcPy?

I'm trying to change the default symbol (font, halo etc) for labels of a layer that I am adding to an mxd. Below is what I have so far, but the template layer font style didn't show up in the map. ...
2
votes
4answers
89 views

IF else statements arcmap, using python

I have a shapefile with a number of fields. I have one field (let's call it Field A) that I need to populate based on another field (let's call it Field B). If Field B is greater then 0 I need it ...
1
vote
1answer
43 views

Problem adding feature name to field in attribute table

I have a small script that should take the name of the file and add it to a newly created field in several shapefiles. import arcpy arcpy.env.workspace = r"c:\users\athom\desktop\timber\New4" ...
3
votes
1answer
70 views

Using ArcPy to export individual mxds from data driven pages?

I'm trying to generate individual mxds for each page in my data driven pages (which I have set up already). I have 38 pages in total, so I would need to generate 38 mxds. The pages are named according ...
3
votes
0answers
31 views

Why does my Validation Script continue to run when adding the result to the map?

I am in the process of developing a python script that creates a list available imagery for our project areas that would then allow the user to choose which imagery source they would like to add to a ...
1
vote
1answer
214 views

Arcpy getCount_Management doesn't match row count with Cursor

I have some troubles to understand the behaviour of my code below. Obviously, GetCount_Management doesn't match the rows in my layer selection. This code is part of a long for loop. I have hidden the ...
2
votes
3answers
92 views

How to calculate Statistics of an attribute field to use it in another calculation

I want the statistics of an attribute field to use in another calculation, i can view the statistics using the field properties menu I want these to normalised the data of field 'Ia' using the ...
1
vote
1answer
56 views

How can I create custom projected coordinate system in arcpy?

I want to create my own projected coordinate system based on one of geographical coordinate systems and set custom values to properties as longitude, scaleFactor etc. I found SpatialReference class. ...
0
votes
0answers
16 views

How to ApplySymbologyFromLayer but autogenerate unique color?

I am trying to write a script that will allow me to change all the layers within a selected group layer to a particular symbology. For example, we often want to change our point data to all display ...
0
votes
1answer
85 views

Using python and ArcPy to read multiple files, apply a function and write into new a directry

I haven't used python yet; I want to read multiple GeoTiff files and resample them based on another single file, and be able to write all the files in a new directory. I can use R raster package to ...
1
vote
1answer
39 views

Problem replicating ArcGIS Grouping Analysis 'grouping effectiveness' statistic results

I posted this question over on Esri's GeoNet, but have not yet gotten an answer. Using ArcGIS v10.2.1, I have been using the Grouping Analysis tool to generate a range of clusters from my data. I ...
2
votes
1answer
33 views

Calculating the area of groups based on intersect of several shapefiles using ArcPy?

I have 5 shapefiles. There are 72 possible groups of 'land cover+top-rock+subrock+soil drainge' in each watershed. I want to get the area of the different groups of 'land cover+top-rock+subrock+soil ...
1
vote
1answer
20 views

Create Separate Layers by Category

I'm trying to create a layer for each county (based on a layer of all counties) and join only those census tracts located in that county. However, the result I'm getting is a layer named for each ...
0
votes
1answer
29 views

Arcpy - (Error 999999) Table Already Exists Project Management

My code is supposed to clip features within a temporary directory, project them and place them into a specific feature dataset within a geodatabase. Then the code goes back and deletes the temporary ...