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

learn more… | top users | synonyms (1)

1
vote
1answer
94 views

How to retrieve the year from a date format?

I'm attempting to retrieve the year from the following date format: 1/1/1988 I've tried the following but it does not work str(1/1/1988)[4:] and I've also tried str(1//1//1988)[4:]
0
votes
1answer
87 views

ERROR: “Can't save to disk (check for space, write permission, or name)” while creating TIN in memory

I get the following error while creating TIN in memory : ERROR 999999: Error executing function. Can't save to disk (check for space, write permission, or name). Failed to execute (CreateTin). I ...
1
vote
1answer
284 views

How to create a feature class in memory?

I am trying to create a feature class in memory but I am not sure how to use the syntax. My code looks like this: FC = arcpy.CreateFeatureclass_management("", "in_memory/FC", "POLYGON", "", ...
1
vote
1answer
131 views

How to batch split feature classes using Arcpy?

I want to bath split analysis tool using Arcpy . I have some feature classes in a feature dataset.I want to Split All of feature classes uisng a shapefile but after split two feature classes, the ...
0
votes
0answers
55 views

Using arcpy.GetRasterProperties_management gives strange results

I have a loop which goes through folders and do some raster operations. Inside this loop I checked for a raster properties using arcpy.GetRasterProperties_management with NODATA parameter. And then ...
1
vote
0answers
72 views

Why might ArcPy, TableToTable, MakeQueryTable and ArcSDE have performance issue in IDLE?

I have written a Python script tool to do: Make Query Table Table To Table (with fieldmapping). The code is nothing more than arcpy.MakeQueryTable("table1;table2;table3", ...
1
vote
1answer
112 views

Select a single entry using SearchCursor and create variable

I am trying to select a single entry of a floating point entry in a dbf table that contains 9 entries (sampled from a raster image), some of which is NULL using SearchCursor. I want to select one of ...
0
votes
0answers
66 views

Compare cell value of a row

How can I compare the cell value of row(n) with cell value of row (n+1){where n = 1, 2, ...} import arcpy arcpy.env.workspace = "C:\RG\Kings County\Test.gdb" inFC = arcpy.GetParameterAsText(0) inFC ...
2
votes
1answer
52 views

arcpy array: trouble with reassigning inf to 0

I've converted rasters to arrays via arcpy.RasterToNumPyArray() then divided them by 1. Some resulting values are zero and I need to reassign them after the division to zero. The array types are ...
1
vote
1answer
67 views

Field does not get updated with Geoprocessing Service

Can anybody tell why the field gets updated when I run this script in ArcMap but not when I run a geoprocessing service? Thanks #Import modules import os, sys, arcpy, traceback, arcgisscripting gp ...
0
votes
1answer
155 views

“shutil.rmtree” doesn't get rid of my intermediate folders

I have a script that works fine, but now I'd like to remove all the intermediate folders I created therein in order to save memory and to be clean. I've been trying using the "shutil.rmtree ()" ...
1
vote
1answer
107 views

Problem in saving a file in a specific output folder

I have a very simple script that I'm testing. It has always been working so far, but now I'm running in an unexpected error. When I try to save my files in a folder different than the environment one, ...
2
votes
2answers
50 views

Is there a way to replace just a specific character in a variable? [closed]

Here is an example township = township[3].replace("0", "") My goal being that if 10.0 is the current value for township I want to remove the zero after the . but not the one after the 1 with the ...
0
votes
1answer
199 views

Arcpy CalculateField using formatting syntax

I have 2 feature classes (FC) that I am merging together and then performing some field calculations on. The 1st FC has 100k+ records in it, and the second FC is a blank FC that I'm using as a ...
0
votes
3answers
215 views

Arcgis CopyFeatures tool extremely slow when exporting to SDE

I have about 10 points in a file gdb that I am attempting to copy over to an sde feature set. In arcpy and in model builder it takes about a minute to execute. Do you know of any tips to speed this ...
1
vote
1answer
51 views

Why does the ArcMap exported KMZ always show my local path information when displayed in Google Maps API?

I used ArcMap (arcpy) to export shapefiles into KMZ and then display them via Google Maps API v3. It looks fine initally: But when I hover my mouse above the KMZ and click it, it will alway show my ...
6
votes
2answers
190 views

What technology is used behind arcpy cursors?

I'm using ArcGIS Server 10.0. I have a geoprocessing using arcpy search, update and insert cursors. I'd like to know more about the technology behind these cursors. Does it use any driver or pool to ...
1
vote
0answers
131 views

merge_management

Here is the edited code: import arcpy import os from arcpy import env set the environment settings env.workspace = "C:\RG\Kings County\Test.gdb" fcs = arcpy.ListFeatureClasses("Sub_NVF_*") ...
6
votes
1answer
120 views

How to access current job id from geoprocessing script running on esri server?

I want to programmatically access the current job id of a geoprocessing script running on ESRI 10.2. The script is what needs to know the job id, not the caller of the script. While searching, I ...
0
votes
1answer
114 views

Problem with converting rasters to arrays and adding them to main array, then converting to raster via NumPyArrayToRaster : output is NoData values

I have a process that aims to loop through a list of rasters (testing with only 3) covert each raster to an array, add the array to an existing 'template' array, then save the final array back to a ...
3
votes
1answer
381 views

Getting the name of the mxd using python

I have a python script which reads through all the mxd's in a folder and changes their properties from relative file paths to absolute file paths. I now want to add a bit to the script to change the ...
1
vote
1answer
121 views

Python Field Calc for Document Hyperlink

I am trying to create a script that will hyperlink to a .tiff or .pdf. These files are stored in one folder on a shared server. I want the script to look in a field: 'PLAT_IMAGE', which has the plat ...
6
votes
1answer
158 views

Draw middle ordinate perpendicular to chord, out to curve, with arcpy

I've been assigned to find the radius of road curves. My boss found this article describing a pretty straightforward method of doing so: find the start/end points of the curve; create a chord; ...
3
votes
2answers
111 views

How can I generalize “field name” variable?

Here is my code: import arcpy import math arcpy.env.workspace = "C:\RG\Kings County\Test.gdb" fcs = arcpy.ListFeatureClasses("NVF_*") try: for fc in fcs: rows = arcpy.UpdateCursor(fc) ...
2
votes
2answers
250 views

How to select specific filenames nested within several folders?

I have hundreds of shapefiles that are stored in separate folders, which are nested within several other folders. Among the shapefiles I only need the ones that are named 'POINT*.shp' How do I get ...
5
votes
1answer
145 views

Does arcpy have a method for accessing related records within a cursor?

I have a line feature class that represent sampling segments. I have a data table of field notes in the same Geodatabase that is connected to the feature class with a Relationship Class. Is there a ...
1
vote
0answers
72 views

Import related CSVs to geodatabase without losing foreign key relationships

For various reasons I understand it is poor practice to rely upon OBJECTID fields to relate different tables together using a relationship class. Therefore, I have a series of several tables related ...
1
vote
2answers
116 views

How to query a data table embedded in ArcPad AXF file package using VBscript?

I would like to ask for some help on writing some VBscript (Supported in ArcPad) in a user form Command Button where the user activated the form with a unique feature ID(hence named COA_ID) already ...
3
votes
1answer
322 views

How to export a mxd to a image with transparent background

I cannot get ArcMap 10.0 or 10.1 to "Export Map" to a png or gif with a transparent background -- no matter what I set the background and transparent colors to. Thus, I created the following script, ...
1
vote
1answer
112 views

Copy specific cell value from one feature class and append to another feature class

I want to copy specific cell value from one feature class and append to another feature class. I have the following code, however, when I run this, it does not produce the results, nor shows any ...
1
vote
1answer
447 views

Calculate coordinates of centroid in arcgis using python

I have polygon features and want to calculate coordinates of it's centroids in arcgis using python - all goes fine, but it gives me coordinates in meters and not in degrees as i want. Here is the ...
1
vote
1answer
75 views

How to add ArcPy Feature Layer to ArcMap automatically?

With Python, how do I get either the MakeXYEventLayer_management or the MakeFeatureLayer_management layer that is temporarily created added to ArcMap automatically after the tool is ran, without using ...
2
votes
0answers
30 views

Generating composite values ( MAPFID numbers) for previously duplicated vales based on 2 different fields

Good day everyone! I have lurked around here for info preiously, but this is my first post, so please be gentle if I commit any faux pas. Okay, let me try to break this down so we can all ...
4
votes
2answers
282 views

Focal statistics to calculate saddle points from DEM

I have a conundrum with Focal Statistics and kernel files. I am been trying to identify saddle points in DEMs. I am attempting to rewrite this (thanks whuber) in a python script for 10.1. I have ...
0
votes
1answer
95 views

How to filter shapefile using definition query?

I have a point shapefile which I want to interpolate using IDW interpolation. However, I want to interpolate only those points which satisfies a certain condition. I need to do it in python and I ...
3
votes
1answer
177 views

How to exclude stations from IDW interpolation?

I have the following problem: I need to calculate an average precipitation amount on a catchment using an IDW interpolation. The interpolation is performed in a loop since each precipitation station ...
0
votes
1answer
68 views

NameError: name 'finalPdf' is not defined

Could you please help me with this error: Traceback (most recent call last): File "C:\DDPeX\Export_GroupPDF.py", line 19, in finalPdf.appendPages(tempPdf) NameError: name 'finalPdf' is not ...
2
votes
1answer
149 views

Change label next to symbol in TOC

I'm trying to write a script to change the label next to the symbol in the TOC so it appears in the legend. Arcpy has a way to change the name of the layer, but I can't seem to find a way to change ...
1
vote
0answers
158 views

How to compare files in two folders? [closed]

I'm pretty new user of ArcGIS. My intention is compare files (csv) from one folder with files in another folders. In those folders exist files with the same name but in second folder files have ...
2
votes
0answers
43 views

Building Arc add-ins without needing to restart Arc [duplicate]

One of the things that annoys me the most with trying to use the Arc add-in wizard is that I need to restart Arc every time I want to test something. This is especially annoying if I've got syntax ...
3
votes
0answers
216 views

Is “Python scripting for ArcGIS” book a good reference? [closed]

I'm thinking of purchasing the Python Scripting for ArcGIS book. I haven't seen any reviews on the book. I was wondering if anyone here has read or flipped through it that can make any suggestions
1
vote
1answer
59 views

ArcGIS, Edit Layer Extents with Python script

I would like to read and edit the Extent Values of each Layer in a MXD-file. My code: import arcpy mxd = arcpy.mapping.MapDocument(r"D:\Work\myInFile.mxd") for lyr in ...
1
vote
1answer
226 views

Copy features from feature class to an existing feature class with arcpy

I see CopyFeatures_management, but this creates a new feature class. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000035000000 Is there a way to copy features from a feature ...
1
vote
1answer
151 views

Read layer symbology class color with ArcPy

I am using ArcPy within ArcGIS 10.1 and attempting to read symbology from a *.lyr file created by a raster dataset within ArcMap. My goal is to be able read out the RGB (color) values assigned to the ...
2
votes
2answers
64 views

Accessing features via arcpy

i try to use arcpy to accessing the features of a shapefile. I tried to use a searcheCursor, like that: cursor = arcpy.da.SearchCursor(Points, ["SHAPE@XY"]) for row in cursor: x, y = row[0] ...
2
votes
0answers
174 views

How to programatically set default Geodatabase and Workspaces for a map document?

I have a QC process that has a bunch of models that need to be sequentially run, and then the results manually inspected between each model. I know how to manually set the default GDB for the Map ...
2
votes
1answer
112 views

How to check if a shapefile is empty with arcpy

I have a bunch of shapefiles in a folder. But some of them are empty, i.e. there are no rows within the shapefile. Is there a simply to find those empty shapefile out?
1
vote
0answers
117 views

New python GIS Programmer : Fundamentals of the Python Language for ArcGIS [closed]

I am new to programming and I'm trying to learn "Fundamentals of the Python Language for ArcGIS" and then I've been trying to compile an example code but python GUI keeps throwing throwing this error ...
2
votes
0answers
64 views

Convert absolute file path to raster databaset [closed]

I wrote a simple python script that outputs an absolute path as string to a GeoTiff file. So this file can be treated as Raster. In a Model, the GeoTiff file is to be the input raster of a CopyRaster ...
0
votes
1answer
419 views

Problem adding a join to a table via Python using addJoin_management

I am currently building a script for a script tool that will join data from a multitude of tables into a single table based on a common join field. Now, I have attempted to use ...