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

learn more… | top users | synonyms (1)

1
vote
1answer
20 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
28 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
136 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
98 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
81 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
29 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
94 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
71 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
40 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
55 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
189 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
150 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
55 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
90 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
156 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
94 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
127 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
153 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
296 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
77 views

Removing grid and graticule layer 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
97 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 ...
2
votes
0answers
94 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
59 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 ...
5
votes
1answer
172 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
163 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
109 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
311 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
2answers
109 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
69 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 ...
2
votes
2answers
82 views

List all feature layers

I will often create many temporary layer files with MakeFeatureLayer_management. I was wondering if there was a means to list the temporary layer files I've created. I've tried setting the workspace ...
0
votes
2answers
242 views

UpdateLayer with arcpy

I am trying to use updatelayer in three mxd's. Each mxd has 3 data frames. I am getting an error, can anyone help? import arcpy,os,sys,string import arcpy.mapping from arcpy import env env.workspace ...
0
votes
2answers
199 views

How to check out arcgis 10.2 desktop license using arcpy?

Referring to ArcGIS help it seems possible to check out advanced desktop license. But typing arcpy.CheckOutExtension('ArcInfo') gives Unrecognized extension code ArcInfo
1
vote
1answer
58 views

Calculating centroid latitude in ArcMap throws error in Arcpy

I can create a centroid latitude field in ArcMap10.1 using "Calculate Geometry..." in the attribute table, but when I try the same thing using: arcpy.CalculateField_management(bins_WGS84, "cent_lat", ...
2
votes
1answer
105 views

Access ArcCatalog Window through ArcPY

I want to create a button in ArcCatalog that takes the metadata from the selected file in ArcCatalog and prints it to a text file. The metadata extraction part is done, and I have succssfully tested ...
2
votes
2answers
140 views

How to print selected page from Data Driven Pages using ArcPy?

I am looking to print DDP (Data Driven Pages) to a printer through a Python (arcpy) script which I will create in Arc Catalog. In other words, I would like for the script to have the following ...
2
votes
2answers
132 views

Output raster from IDW interpolation tool is from 3.40282e+038 to -3.40282e+038 in ArcPy

I am not familiar with Python in ArcGIS, so I used ModelBuilder first to set the environment and put the tool in. The model worked right and the output raster seemed good. Then I exported the model ...
0
votes
1answer
93 views

Can not SET a Value in table using Python?

I'am trying to set values in table, the code run good, i don't got errors, but nothing is done ! I'm using Arcgis10.1, arcpy and Python This is the code : import arcpy import math import arcview ...
1
vote
1answer
128 views

Creating Self Executing Python Script (*.py)?

Trying to figure out how to create self executing python scripts with using the ArcGIS python window. I'm ok (generally) when developing and running scripts inside the python ArcGIS windows but ...
1
vote
4answers
849 views

NameError: variable not defined even though set multiple times

This code original worked when run through the python command window in ArcCatalog. After I added the script to a toolbox I have had all sorts of troubles. The most frustrating error has been: ...
3
votes
1answer
135 views

Help with Python script to query feature server

For the purpose of saving the data locally from a feature server online I have written code below: import arcpy fcout = r'C:\Forum\Hydrants\test01.shp' url = ...
2
votes
1answer
120 views

Find and replace text based on feature class attribute

I've been struggling with this problem for a few days. It seems to be more programmatic than geospatial in nature, so I'm open to suggestions to redirect this elsewhere. I have a text file ...
0
votes
0answers
28 views

Meaning of AttributeError: 'module' object has no attribute 'da'? [duplicate]

error is : AttributeError: 'module' object has no attribute 'da' Code is below: import arcpy import os from arcpy import env # Set local variables inWorkspace = "Q:\\NHD project\\Connection ...
2
votes
1answer
146 views

Do I need to set arcpy.env.workspace at the beginning of my python code?

I am new to Arcpy and have been doing simple tasks such as AddField_management and updateCursor. However I have been getting error msgs, such as errors 99999 etc. The errors I get are related to ...
2
votes
0answers
322 views

arcpy.Intersect_analysis() returns empty result, but Intersect tool in ArcMap is succesful [closed]

I've got two large feature classes that I'm trying to perform an intersect on. Using the following python code, I get an empty output feature class: arcpy.Intersect_analysis(["Schools","Zips"], ...
2
votes
1answer
49 views

MakeFeatureLayer_management wrong output

I have a huge database with Sightings from whales and dolphins from 1995 till today. So I want to sort the database with python. Till now I can make FeatureLayers for each year for ...
2
votes
1answer
45 views

arcpy cursor not accepting float(Inf)

I have a vector layer in which I have added some fields of type 'float' using arcpy.AddField_management. I'm performing simple calculations between those fields using update cursors but the problem is ...
2
votes
3answers
425 views

How to change properties of an item in a legend in ArcMap 10.2 using python

For many of my projects I use a single mxd to create multiple maps using a python script to switch on/off various raster layers before exporting to pdf. Before beginning the exporting process I ...
1
vote
0answers
67 views

Custom error message with 'Error Code -1' in ArcGIS script tool

I have a script tool in ArcGIS 10.2 and I have altered the tool's validation code to show my custom error messages using setErrorMessage method. It works but when an error message is displayed it ...
2
votes
1answer
88 views

Subtracting columns (that include null values) in ArcMap Field Calculator

I’m desperately trying to run a very simple command where I subtract one column with others. However the problem is that some rows have NULL values, therefore the result of subtracting is also NULL. ...
1
vote
1answer
25 views

MakeFeatureLayer_management parsing error (for loop)

I want to make a Feature Layer for each month in the table "Sightings1995-2014". Why doesn't it work? for month in range (01,12): ...