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

learn more… | top users | synonyms (7)

0
votes
0answers
20 views

How Show shp Selected [duplicate]

I need help with code to know if a SHP a MXD this selected or not. I have the following code which only shows me all shp'sy layers are in the layer , I need a list if there is a selecionado shp, ...
1
vote
2answers
84 views

Replicating Summary Statistics tool with case field using own calculation within ModelBuilder?

I thought this would be a simple problem to solve, by my googling hasn't provided the answers so far. I have created a near table (Using the 'Generate Near Table' in Arc) comparing two sets of ...
0
votes
0answers
35 views

Using ArcPy Insert Cursor with NEXTVAL of Oracle sequence?

I have the need to be able to set a value of a gdb table to the NEXTVAL of an Oracle sequence. I have to be able to do this through an ArcPy function that will also handle setting the ArcPy OBJECTID ...
0
votes
1answer
40 views

Arcpy processing pairs of shapefiles

I have a problem I need to figure out but don't have idea how. I have two separate directories with shapefiles. In dir 1. shapefile names are like 1.shp till 1000.shp. And in dir 2 W1.shp till ...
0
votes
0answers
87 views

using arcpy.UploadServiceDefinition_server to publish to portal

I'm using arcpy.UploadServiceDefinition_server() to publish SD files to a server that is federated with portal. Using this ESRI Documentaion I am able to publish the service to a specific folder on ...
0
votes
1answer
42 views

function in update cursor

I have az update cursor loop, in which I'd like to use the function written earlier. Function: def TL (): addlayer = arcpy.mapping.Layer(r"gk25.shp") arcpy.mapping.AddLayer(df, addlayer, ...
2
votes
1answer
70 views

How to properly handle a multi-column value table in an ArcGIS Python toolbox?

I am building a relatively simple python tool for ArcGIS 10.3 which will automate the process of generating summary statistics for multiple raster datasets, for polygons in a polygon dataset, using ...
0
votes
0answers
50 views

Dissolve in python script not working correctly

I have a python script that merges 12 shapefiles into 1 shapefile with about 75k total records. I want to dissolve the latter shapefile on a particular field, and SUM another field, so my final ...
0
votes
0answers
42 views

Python toolbox - get lat and long from tables

The objective of the python toolbox is to convert a bunch of tables to point feature classes. The user selects the tables (parameter 0 - multivalue). The user selects the output workspace where the ...
2
votes
1answer
59 views

Updating ESRI mxd definition query variable via python?

we use definition queries to filter data to field users. We have up to 40-50 MXDs that are identical except for 1 variable in the definition query that allows the data for that MXD to be unique. ...
1
vote
1answer
30 views

Documentation on “Analyzer errors” codes?

As noted here, when you receive an error of the form 001272 : Analyzer errors were encountered (codes = <value>). this means that the attempt to stage and publish a service failed. The tool ...
0
votes
0answers
30 views

Creating multiple dropdown lists in Python script tool?

Can anyone tell me how to create drop down lists? I want 'Area Name Field' to be a list of fields from the shapefile selected in 'Area of Interest' and 'Name Value' to be a list of field values ...
2
votes
2answers
51 views

Sequential attribute field calculations with null values using Arcpy

I have a series of x,y co-ordinates converted from a .ply file. I was able to extract the file into a suitable x,y format for arcmap, the issue I have is that they are co-ordinate points representing ...
0
votes
0answers
35 views

Convert raster to polygon then join attributes

I'm trying to convert IMG files to shapefiles, then joining the attributes of the IMG file to the new shapefile. I got the conversion part to work, but am a stuck on how to join the tables. I have ...
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
45 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
54 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
61 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
79 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
136 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
56 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
415 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
126 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
56 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
92 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
89 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
248 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
108 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
71 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
55 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 ...