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

learn more… | top users | synonyms (1)

0
votes
1answer
89 views

TypeError: 'NoneType' object is not iterable from Python Scripting for Geoprocessing Workflow exercise?

I am currently taking ESRI's Python Scripting for Geoprocessing Workflows. I have following their step by step however there seem to be a problem that I am getting an error. import arcpy #Set ...
2
votes
1answer
41 views

List File Geodatabase Topology

I'm trying to write a script that looks into a dataset and list all the elements in the dataset. The dataset comprises of Feature classes and FGDB Toppology. When I uses ListFeatureClasses, it outputs ...
0
votes
0answers
13 views

Is it possible to call a complicated query as a stored procedure within a geoprocessing service?

I need to implement a searching geoprocessing service. A part of the query should be very complicated and use oracle text. My service should support spatial search too. 1) I am thinking of ...
-1
votes
1answer
69 views

ValueError: Layer: Unexpected error from replaceDataSource()?

I'm trying to write a script that allows me to look through map documents and replace each layer's data source in each map document. Everything is working logically I believe, and all my loops are ...
0
votes
1answer
28 views

Layer still in map after running arcpy.mapping.RemoveLayer?

I'm trying to run a script that removes a group layer from a set of map documents, the code runs and the correct zone to be deleted prints out, However, when I check my map documents, the layer is ...
0
votes
1answer
28 views

AssertionError: Invalid MXD filename from arcpy.mapping.MapDocument()?

I'm trying to write a script that allows me to list the layers of each map document in a folder. However I keep getting this error after it displays the layers in the first map document: Traceback ...
0
votes
3answers
40 views

AttributeError: 'unicode' object has no attribute '_arc_object' from arcpy.mapping.ListLayers?

I'm trying to write a script that allows me to list .mxd files in a folder and then list the layers in each map document, however, I keep getting this error: Traceback (most recent call last): ...
0
votes
1answer
45 views

ArcPy saveACopy method saving copy of MXD to wrong path?

I have a script that looks through datasets in a geodatabase and copies a mxd document to a folder. The programs works, however it is saving the map documents to my desktop and not the specified ...
1
vote
1answer
27 views

Concatenating variable values in Python script for export DDP as mxd via saveACopy method?

i am building a script, most of which i found on here, that exports my data driven pages as mxds. I need it to save the mxd by a specific attribute in the shapefile and am running into an error when ...
0
votes
4answers
76 views

Python code executes but nothing happens [duplicate]

I'm trying to write a script that looks into a database and lists all the datasets that begin with zone. The script then enters into a for loop and copies a map into each on the datasets listed. The ...
2
votes
0answers
41 views

Arcpy script for summing pixel values in loop can't handle large number of rasters

I want to sum the pixel values of large numbers of rasters of different extents (ArcMap v10.2). 16GB RAM. I have the following code (with help from this site) which solves the different extent ...
0
votes
1answer
66 views

UpdateCursor stops after the first iteration

My arcpy script includes two updateCursor Objects. The first iteration of the "outer" coursor works fine, but the programm stops when it comes to the second iteration at updateRow(). Has somebody an ...
0
votes
0answers
54 views

Copy features to dataset in a loop

I'm trying to write script, that looks at the feature classes in a geodatabase and depending on what the feature class ends with, it creates a new dataset in the geodatabase and copies the file into ...
0
votes
0answers
15 views

ArcPy-generated string formats badly in map text element [duplicate]

I've got a script that's pulling a bunch of attributes and concatenating the information into a long string. text_description = "Address: {}\n\n".format(dictADDR[key]) text_description += "{} ...
2
votes
1answer
86 views

How to read X,Y from mouse click in Python

I am looking for some advice… I am trying to build a tool that will precisely (10digit, eg: AA1234512345) identify British National Grid (BNG) by clicking on a map. The ArcGis default tool can only ...
1
vote
1answer
39 views

Extent to xy coordinate- arcpy

I work with arcview 10.3, and i try to extent to xy coordinate with arcpy? I am using this code: import arcpy, os, sys from arcpy import env env.workspace = r"C:\Project" pnt = '178434 ,662446' ...
2
votes
1answer
53 views

FieldMap in Arcpy Merge for Selected Fields Only

I am trying to use FieldMap in arcpy to merge only a few of the same fields from 8 feature classes. There are many different fields in all of the different feature classes, but I have identified the 9 ...
1
vote
2answers
40 views

Arcpy wildcard to represent specific number of characters

I have a bunch of feature classes that are labeled in this pattern CL25_E6_5_4_3 CL266_E6_5_4 CL266_E6_5_4_2 CL4_E6_5 I want to make a list in ArcPy that contains all feature classes with the ...
1
vote
1answer
36 views

How to Compact geodatabases in multiple directories using ArcPy?

I am trying to write a script to walk through all folders in my workspace and find and compact all geodatabases in my workspace. I feel like I'm on the right track but I am stuck. import acrpy, os ...
0
votes
0answers
26 views

Create .lyr file from a raster and add to display

I'm working with rasters, there are 3 folder (input, query, result). In the input folder are the basic rasters. The user can choose between these rasters, the code can collect the rasters into the ...
1
vote
1answer
17 views

The updateCursor doesn't update all the cells in the shp, just some of them

Dont know for sure what is happening, but when i use arcpy.UpdateCursor it only write some of the lines not all the lines. The code is: cursor = arcpy.UpdateCursor("FInal1a1.shp") for row in cursor: ...
1
vote
0answers
14 views

The 3D polygon generated by skyline in arcgis has no Z value

I used the skyline tool to generate the skyline in a certain scenario, when the visible angle is less than 120°, the skyline is right, as the pic below: When the visible angle is bigger than 120, ...
2
votes
2answers
61 views

Select Layer By Attribute to be used in for loop

I'm trying to iterate through a feature class and select each feature one by one by using the OBJECTID field. When I use a single value, the SelectLayerByAttribute works, but how do I compare the ...
0
votes
2answers
68 views

User interaction with Python tool midway through script running? [duplicate]

I need to design a Python script that will take a CSV input, search for a matching polygon in our SDE data for each line, and then extract certain information about data that intersects with the ...
0
votes
1answer
33 views

Publish geoprocessing service on ArcGIS for Server?

I am following the instructions described here and I have some enquiries about publishing a GP service. First of all, how should I publish a GP service on a production environment where the database ...
0
votes
0answers
17 views

Reconcile Geodatabase with geoprocessing service

Basically I am trying to publish the reconcile version tool to a geoprocessing service so that from a web map, when a user clicks a button, it will reconcile a desired version of the geodatabase with ...
0
votes
2answers
39 views

Construct sql expression with python tool and pass it as argument to Select tool

I am trying to construct an sql expression using python and afterwards pass it as an input to the arc catalogue select tool. As shown in the following image I am passing a station_ID as a string to my ...
2
votes
2answers
30 views

Error 000358 or Error 999999 invalid SQL

i've been searching arround all the answers in the questions of Error 358 and beyond, but i doesn't fix my problems, i tried every post and so on the problems stills there. I make two options in my ...
0
votes
1answer
27 views

combine two FOR LOOPS (MakeFeatureLayer_management)

I want to combine two FOR LOOPS but I have no idea how. It should give me in each TYPE Layer "under" Layers, where are new Layers for each MONTH (see picture) The two loops in itself works. # ...
1
vote
1answer
40 views

Arcpy delete rasters in a folder

I'm working with rasters, there are 3 folder (input, query, result). In the input folder are the basic rasters. The user can choose between these rasters, the code can collect the rasters into the ...
1
vote
1answer
88 views

Updating row in list of feature classes using dictionary in Python?

I have a list of feature classes (fcList) that I would like to do the following. - add a field (fire_dis) - update row from a single value from a dictionary(fcnaDict) - more specifically I am ...
2
votes
2answers
52 views

arcpy.da cursor : iteration not started

I am trying to convert cursors written in 10.0 to use the new arcpy.da module in 10.2.1. If I step through the code in debug mode, it steps into the for loop; however, when I attempt to run the code I ...
0
votes
1answer
36 views

ArcGIS Server security settings via script

Can anyone point me to a method for setting a service, folder, or the site root security setting to public via script? It can be using one of the admin tools (e.g. ...
1
vote
1answer
27 views

Scripting creation of cogo polylines including curves

Is it possible to create polyline features from cogo type text files? I have some files that have survey type coordinates in them and they contain straight line segments as well as curves (defined by ...
1
vote
2answers
56 views

Changing variable name in for loop

I am trying to run a simple python script that changes a feature to a polygon. However, I want the outputted polygon to have the same name an the inputted feature. The code that I ran, outputs the ...
0
votes
1answer
49 views

Understanding desc.fields

First time poster so I hope I did this right. I'm relatively new to Python scripting and am trying to understand the error I'm getting. I have the following simple code and what I don't understand is ...
0
votes
1answer
60 views

Use arcpy to query by date field in ArcGIS for Desktop?

I have an ArcGIS table in a file geodatabase that contains a date field. I would like to write a python (arcpy) function that creates and returns a table view for a date-range given a starting and/or ...
2
votes
1answer
57 views

ArcGIS Script Tool/Problems/Issues

I currently have a python script which will replace the data sources on a MXD with broken links. The code seems to work fine as I have run the code a handful of times using relative paths to indicate ...
0
votes
2answers
96 views

How to concatenate row values with Python?

I want to concatenate a row who have the same src_Refname value ! like in the picture and get like this : is there any easy way to do it ? on using the tool described in the link, i try to ...
0
votes
1answer
48 views

Remove grid and graticule using arcpy

I work on arcview 10.3. How can i remove grid and graticule by using arcpy? i have this code: import arcpy,os,sys,string import arcpy.mapping from arcpy import env env.workspace = ...
2
votes
0answers
57 views

Error when running Python script to replaceDataSource of multiple layers in multiple mxd's

I looked on all of your sites and did not find a solution to my problem. Almost all of our data has been copied to an SDE and now most of the layers in all of the mxd's need to be redirected to the ...
-1
votes
0answers
49 views

Replace data frame with arcpy

I work on arcview 10.3. How can i replace an existing data frame in mxd with another data frame by using arcpy? I started write this code but i don't know how to do it: import arcpy,os,sys,string ...
2
votes
0answers
69 views

How to get an ArcGIS custom tool to run fom the command line?

I have been experimenting with ESRI's CalculateArea custom tool and it works fine running within ArcGIS from a toolbox. Then I wanted to see if I could run it as a standalone script from the ...
0
votes
1answer
52 views

Search layer in MXDs

I work on arcview 10.3 and i try to find layer called "ways" in several mxds. i try this code but it does not work. anyone know how to do it?: import arcpy,os,sys,string import arcpy.mapping from ...
4
votes
1answer
83 views

How to add Attributes to a polygon with arcpy

I have a question about arcpy. I want to create a polygon FeatureClass with attributes. The code below is just test-code that generates some polygons for speed testing. I want to add some additional ...
1
vote
2answers
26 views

Opening table from a geodatabase in Arcpy

I have tables in a geodatabase. I want to open and work with them in my script. The first step I appear to have to do is scripted underneath. My result of this script is all names of all tables in my ...
4
votes
2answers
90 views

Performing a 'far analysis' using ArcGIS for Desktop?

I would like to perform an analysis that is the inverse of Near_analysis for ArcGIS. Instead of my result being NEAR_DIST and NEAR_FID, I'd like each feature to have a FAR_DIST and FAR_FID populated ...
1
vote
2answers
109 views

Calculate Date field in ArcPy

I'm trying to use arcpy.ExtractValuesToPoints() to get raster values to a points feature class for several raster files (8760). The goal is to get a time-slice view of how the values at certain ...
1
vote
1answer
75 views

How to checkin ( release, make it free) arcgis 10.2 desktop license using arcpy?

There is a way to do this using AcrGIS license Server Administrator, but I need a command to use it in arcpy scripting.
2
votes
1answer
37 views

Converting geographic units with ArcPy

I am trying to compare a set of point features to the centroid of a single feature polygon using ArcPy. The problem is that the polygon generates a set of XY coordinates in meters, whereas the set of ...