A site-package created by Esri to expose ArcGIS for Desktop (and ArcGIS Pro) geoprocessing, mapping, etc, to Python.

learn more… | top users | synonyms (8)

1
vote
1answer
59 views

Using ArcGIS Feature Compare in ArcPy?

I am trying to write a script partially in ArcGIS ModelBuilder and adding an if statement on my own. It uses the Feature Compare tool in arcgis and I want to use the result.getOutput in an If ...
0
votes
1answer
50 views

Broken Project Data Source

I have built a Script Tool (from a modelbuilder model) in ArcGIS 10.2 which works perfectly fine in ArcGIS. However, I am getting the following error message when I try to publish this script tool ...
3
votes
2answers
139 views

Creating Feature Class in ArcPy gives RuntimeError?

I am new to Python. I am trying to create a new Feature Class within a long script but before I do so, I am running it separately to make sure I have the syntax correct. The code below mimics the ...
0
votes
0answers
39 views

How to test if a point shapefile is in a raster in ArcMap using Python?

I have a shapefile where the features are points. It should be about 500 points. All of this points are on top 5 different rasters. Some points are in one raster, but some others are not. I need to ...
0
votes
2answers
61 views

Iterating field calculations in arcpy

I was successful in adding multiple fields but had trouble running multiple field calculations in a loop. Now what I want is loop through these existing fields listed in mult_fields variable and fill ...
0
votes
1answer
114 views

Writing shapefile field values to txt file using SearchCursor? [closed]

I'm having trouble finding a way to write the output of a SearchCursor function to a txt. file. I can print it just fine in a format that is desirable. I just don't know how to get from there to a txt....
1
vote
2answers
169 views

Speeding up Python code to convert multiple csv to shapefile?

I am trying to work with some crime data from https://data.police.uk/data/ The data is organised in several .csv files, one for each month and each crime is geocoded with Lat and Long. As the file ...
2
votes
1answer
138 views

Accessing selected features in the sublayer output from tracing geometric network

I have a geometric network setup with stream lines and water users. I am trying to use arcpy to automate tracing downstream of each node/junction in my geometric network to get userIDs for all ...
0
votes
1answer
49 views

Listing geodatabases in local SQL Express Workgroup ArcSDE using ArcPy/Python? [duplicate]

I would like to create a list of the multiple geodatabases that sit in my local SQL Express Workgroup SDE server. I have set up a connection using the "Database Connections\Connection to ...
4
votes
2answers
692 views

ArcGIS Python Script Tool Field Name Drop Down?

I have a python script that checks file path names for corresponding files in a drive location. All of the inputs were originally hard coded, and it works well enough: import arcpy import os ...
0
votes
1answer
66 views

Parsing error with in ArcPy code

I have the following code in Python for a tool I want to build. For some reason I viewshed don't exist in the folder I have chose (out). Also when I am trying to define the output workspace every time ...
2
votes
1answer
97 views

Determine the number of fields of a certain field type there are in an input feature class

So I am wondering how to get the number of field types "String" by creating a custom function? Can anybody point me in the right direction? I have a shapefile named streets and there are 73 field ...
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
147 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 points,...
0
votes
0answers
60 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
42 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 W1000....
0
votes
0answers
176 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
70 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
138 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
107 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
51 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
158 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. ...
2
votes
1answer
194 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
53 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 from '...
2
votes
2answers
64 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
68 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
43 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
65 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 env....
0
votes
0answers
42 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
99 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
62 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
51 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
86 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
99 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
35 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 Analyst->...
0
votes
3answers
168 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
49 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, ...
5
votes
1answer
180 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 = r"C:\Users\e1b8\...
1
vote
1answer
98 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
612 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
96 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
207 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
49 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
97 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
51 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
82 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
288 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
97 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 ...