A site-package created by Esri to expose many ArcObjects to Python.

learn more… | top users | synonyms (1)

1
vote
0answers
31 views
+50

Moving a Map Service Group Layer out of a Group Layer with ArcPy

I am struggling to move web services (tiled basemaps) out of group layers into the data frame. I've used arcpy.mapping.ListLayers to compose a list of layers, then I've ascertained what is a group ...
1
vote
1answer
188 views

Export Multiple Raster Data with custom Cell Size

I Have 172 Raster, and need to change the cellsize. So I use Export Data from TOC and change the cellsize manually (example I want to change it to "3") I tried using this python script to ...
0
votes
3answers
49 views

Writing Python script to populate fields of layer with underlying info from another layer?

I have layers of points and lines that have to be updated regularly. It needs to have the intersecting attributes from another layer stored in its fields/attribute table. IE. towns, school districts ...
3
votes
1answer
114 views

Arcpy.da.UpdateCursor, Error - Sequence size must match size of row

I am trying to use an UpdateCursor fill in a field but I keep getting an error, can anyone tell me what I am doing wrong? My code is below: import arcpy fc= "C:\Users\Keri\Desktop\GEP_690\Project ...
1
vote
2answers
290 views

Insert.da.Cursor, Error - Sequence size must match size of row

So I'm working on this script which creates a table within a geodatabase. It then grabs the unique values from a list and attempts to insert them into the table using an Insert Cursor. I get the ...
1
vote
1answer
396 views

Why am I getting “sequence size must match size of the row” error?

I'm trying to use an Insert Cursor to insert a point geometry into an existing point feature class. I'm finding the coordinate and appending them to a list called rowValues, ex: ...
5
votes
1answer
630 views

“Sequence size” doesn't match row in Python?

Essentially I am trying to calculate a value for a couple of fields after adding them. Below you can see how I am adding the fields and then an example on how my "for" statement is looping through the ...
1
vote
1answer
243 views

How to use InsertCursor to add points to a point feature class?

I am struggling with a very simple task of inserting "SHAPE@XY" into a point feature class. Following is what I have: xy = [(361087.15436001675, 198747.07296730898), (361530.56426259346, ...
0
votes
3answers
41 views

How to use Select Layer by Attribute in ArcPy

I want that one variable takes input from the user and then we compare the value to the attribute. val = input("Ask user for something.") arcpy.SelectLayerByAttribute_management("Sample", ...
0
votes
0answers
24 views

Porting Arcpy script to linux cluster machine?

I wrote a series of arcpy scripts, and I am wondering how I can port the feature to Linux cluster machine? I found that ArcGIS server 10.2 runs on Linux machine, does that means I can theoretically ...
0
votes
1answer
28 views

Draw polygon with GUI

I'm looking to make a python add in tool for ArcMap to draw a polygon. Eventually I want the tool to also calculate the area and a bunch of other things but for now I would be happy just drawing an ...
0
votes
2answers
243 views

How to add multiple feature classes from TOC as input by Model Builder?

I am tasked to create a tool using Model Builder. The tool requires input of multiple feature classes that are added in the Table of Contents of ArcMap. The user will then be able to select multiple ...
0
votes
1answer
43 views

Create a Loop for Arcpy

I am looking for help to write a loop a arcpy.CalculateField_maagement process where the User is asked with the 'raw_input', prior to the tool running "Do you need to change a field value(yes/no):", ...
1
vote
1answer
43 views

Graph/Network building and analysis of linked polygons in ArcGIS 10.2

This is more of a follow-up question to Divide polygons into *n* number of groups of equal counts with ArcGIS 10.2 and grouping village points based on distance and population size, particularly the ...
6
votes
3answers
382 views

Finding centerline of peninsula?

Given a peninsula stretching north south and the two coast lines connecting in the south, I want to find out which is the place, or rather line, which is furthest away from both coastlines on the ...
1
vote
1answer
871 views

ArcMap “One or more layers failed to draw: An invalid SQL statement was used”

I created a model involving the tool Make XY Event Layer because I want to plot latitude and longitude points in CSV file columns. The model runs without errors and appears to have plotted the points ...
2
votes
2answers
165 views

Debugging ArcPy ImportToolBox AttributeError: Object: Tool or environment <ConcatenateRowValues_AA> not found?

I am trying to use the ConcatenateRowValues tool provided by ESRI. My overall code for my script is working fine except when it tries to use the ConcantenateRowValues Tool. I start by importing the ...
4
votes
3answers
2k views

Create an ArcCatalog OLE DB Connection using Python

Is it possible to create an OLE DB connection (*.odc) to a database in ArcGIS 10 , but using Python instead of the ArcCatalog GUI wizard? I don't need to necessarily create a file on disk, just make ...
1
vote
1answer
541 views

Defining multiple projections inside a file gdb [error 000289 failed to alter spatial reference]?

I am importing multiple shapefiles into a filegdb in ArcGIS 10, and using the following code to define the projection of the feature once imported, to the .prj of the original .shp file. Here is my ...
-1
votes
0answers
21 views

Automating Viewshed Analysis for 100+ points in ArcGIS for Desktop or QGIS? [on hold]

I am looking to create a script or some sort of work flow to analyze the viewshed of 100+ points (in a .KMZ file) using either ArcGIS 10.3. I can also download and use the most recent version of QGIS, ...
0
votes
1answer
220 views

Optimizing ArcPy code to cut polygon?

There is a lot of nested loops and wondering of ways I could speed up this code? Any ideas? Note: This requires ArcMap 10.2 def cut_geometry(to_cut, cutter): """ Cut a feature by a line, ...
2
votes
2answers
139 views

Can we no longer reference an ArcMap layer to get the spatial reference?

I'm currently using ArcGIS 10.2.1. In previous custom geoprocessing tools, I've used the following code to create a feature class in-memory, and set the spatial reference using an existing layer in ...
0
votes
1answer
306 views

Spatial ETL Tools won't run “AttributeError: 'module' object has no attribute, etc.”

I have a python script that runs 5 Spatial ETL tools that I wish to run as a scheduled task. Each of the tools will run successfully from ArcCatalog and also from the ArcCatalog Command line. If I ...
3
votes
2answers
78 views

Accumulated value from many rasters python/arcgis10

I need to calculate an accumulated value of temperature (as an additional raster) from many rasters. Is there any option to do this in ArcGIS 10 or any hints for a python script?
1
vote
0answers
20 views

How to correctly input complex multiband functions in Raster Calculator?

I'm trying to compute a MTVI2 (Modified Triangular Vegetation Index - Improved) and EVI (Enhanced Vegetation Index) from Landsat 8 imagery. My formulas are as follow (I'm using ModelBuilder): MTVI2= ...
1
vote
1answer
102 views

Error Creating Feature Layer from Parcel Fabric, Error 000732

Currently I am writing a python script that creates a feature layer from our parcel fabric and then appends that data into a different SDE feature class. The problem is that when executing ...
1
vote
1answer
749 views

Why does copying ArcSDE datasets and features in Python give ERROR 000732 & 000735?

I keep getting a kick back that says this: ERROR 000732: Input Features: Dataset 'Database Connections\Wyoming.sde\Supporting_MT_DBO_Geology' does not exist or is not supported Failed to execute ...
2
votes
2answers
442 views

CopyRows_Management in ArcPy gives ERROR 000732?

I get the following error when running a CopyRows_Management with Python (ArcGIS 10.1): ERROR 000732: Input Rows: Dataset \MyConnection.odc\MyTable does not exist or is not supported Here is the ...
5
votes
1answer
419 views

Error using con in Map Algebra in Python script

I am experiencing a painful problem in the middle of a Python script I am writing. When I get to a Map Algebra function, I have tried two different options and both return a different error. At first ...
1
vote
1answer
34 views

How to select layer of .shp format by attribute using ArcPy?

I have to first load a vector layer (in .shp format) in arcmap and then it should select to specific attribute (the name of attribute is taken as input from user which i have done). and only selected ...
4
votes
1answer
71 views

Automatically create new layers from a single dataset using definiton query for unique values in a field

I would like to automatically display a featureclass as different layers based on a specific field. I've seen a few tools online and on XToolsPro under the category of Split by Attributes, but they ...
1
vote
1answer
33 views

Update Cursor with Date Issue [on hold]

My dates (maxDate, minDate, avgDate) all print out with the correct datetime format, but I am unsure if the problem is how the loop is written to update the cursor. Error: line 102, in updateRow ...
1
vote
0answers
41 views

Python script changing ArcSDE data source not updating all MXDs?

We recently made significant changes to our ArcSDE database setup by splitting our original database into five databases and renaming most of the feature sets. Right now I have a script that opens all ...
1
vote
1answer
26 views

Using WK ID's when using CreateSpatialReference tool

I recently found out how to create specific spatial reference objects and add them to my arcgis python standalone script. ...
3
votes
1answer
78 views

Match features that are spatially similar with ArcGIS?

I'm hoping there might be a way to match features from one feature class to features of another feature class that are the most spatially similar. I have two datasets representing the same thing but ...
2
votes
2answers
31 views

How to calculate field as a substring of another?

I have a text field, field1, that's populated with 14-digit identifiers, like "01234567890123". I create a new field, field2, that I want to show the first four digits of field1. I would like to do ...
0
votes
0answers
46 views

MS SQL table with geometry field to feature class

I have a table in a native SQL database (no geodatabase, dc_geobank_public.sde in the code) with cca. 300 000 records and 18 fields. Two of the field contains projected X and Y coordinates, and one ...
2
votes
1answer
22 views

Parameter to script tool gives Invalid expression ERROR 000358?

I have created python script tool in arcgis 10.1 as below. I am trying to take input parameter and passing to select statement. There is error when i execute this tool. import arcpy from arcpy ...
1
vote
1answer
99 views

SQL within Python Script to get only part of the expression by GetParameterAsText

I was wondering if anybody could help me. Im trying to create a tool within ArcMap using a python script. Within the script i've been trying figure out how to change it so that I only need to get ...
0
votes
0answers
75 views

Select By Attribute sql problems [duplicate]

Having trouble with this python code. I keep getting a ERROR 000358: Invalid expression" code for the select layer by attribute management statement towards the end of the code. Moved the data to ...
1
vote
2answers
39 views

Getting number as parameter to use in SQL expression leads to ExecuteError: ERROR 000358?

In my script I am using the Select tool (arcpy.Select_analysis) and in the SQL expression, I want to use a number that I call in as a parameter. I have trying to script it like: subsize = ...
2
votes
2answers
154 views

Trying to use an integer in a WHERE clause

I'm trying to use an integer value in a WHERE clause (looking at an integer field). expression = "'SERVICE' = 'Service' " expression = expression + 'AND ' expression = expression + "'GPS_TIME_TOTAL' ...
1
vote
1answer
78 views

Debugging ERROR 000358: Invalid expression from SelectLayerByAttribute?

I'm creating a script tool and using the SelectLayerBy Attribute function (below), arcpy.SelectLayerByAttribute_management("cities_lyr", "NEW_SELECTION", '"CRIME_INDX" <= 0.02') However, I keep ...
0
votes
2answers
887 views

What causes ExecuteError: ERROR 000358: Invalid expression Failed to execute (SelectLayerByAttribute) on shapefile? [duplicate]

My script runs perfectly for feature classes, but not shapefiles. It crashes at the point of selection, provided there is a query. gp.Workspace = "C:/someworkspace" fc = "featureclass.shp" query = ...
3
votes
3answers
764 views

Runtime error : ERROR 000358: Invalid expression using SelectLayerByAttribute in ArcPy?

I cannot for the life of me persuade SelectLayerByAttribute to work (I need to automate this for a complex script). Working in ArcMap's python console on already loaded shapefile, the format below: ...
3
votes
1answer
110 views

How to iterate through all geometries using a search cursor?

I would like to use a python add-in which uses a button click to iterate through each selected polygon one by one. The following code manages to zoom only to the first polygon. How can I adapt it to ...
2
votes
1answer
25 views

Automating update of network dataset in ArcGIS Server

I am trying to set up an automated process that does a nightly extract of the network dataset from SDE and publish to: ArcGIS Server 10.3 as a network service fGDB as network dataset It seems ...
0
votes
0answers
38 views

Using Arcpy to Update Data Source Does Not Update Related Tables

I have a python script that updates the data source of mxd's from staging to production. Here is an example of the code: import arcpy mxd = arcpy.mapping.MapDocument(r"C:\Project\MyMap.mxd") for lyr ...
0
votes
1answer
32 views

find all the null records for all fields in a shape file

I figured out that I can use field calculator on a single column in arcgis 10.3 attribute window as follows: def RemoveNULL(x): if x is None: return '' elif x == '': return ...
2
votes
2answers
380 views

Calculating surface using Lambert correction?

i'm using lambert conformal conic , so we have distortions along any given parallel , i would like to get the area used to solve this distortion. I have calculated the area using Shoelace formula , ...