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

learn more… | top users | synonyms (1)

4
votes
1answer
319 views

Is it possible to run an arcpy execute SQL method without connecting to any database or server?

I want to simply process a layer by writing a tool script in a toolbox without having to connect any database, so I think I may have to set up a workspace environment in ArcMap, but I'm not sure if I ...
1
vote
1answer
595 views

How to use python to export ArcGIS Server Map Service Properties?

What arcpy module can I use to write a python script to mine for fields of my map service properties and export them to a .tx file? I assume we need to tap into GIS Servers within the ArcCatalog ...
4
votes
1answer
272 views

How to join MySQL data with GIS data using arcpy?

Here is my problem, I have a MySQL database with table in it that has 4 columns: ID, Owner, Address, Legal. And I also have an ArcGIS GDB that has a parcel layer that has in it a PID field. I am ...
3
votes
2answers
695 views

How to draw rectangle to clip layers using python addin in ArcGIS 10.1?

I want to clip rasters in data view using interactive rectangle (to define Area of Interest) and add them to current dataframe. Following is a piece of code which is not returning anything. Any ...
1
vote
0answers
227 views

Clipping .mdb in place and schema locks

I have an .mdb with a feature class that I want to clip in place - that is, I want to clip it with another polygon, and then store the results back in the original .mdb. I am doing this with arcpy. My ...
10
votes
2answers
5k views

How to export only certain columns to a CSV file in ArcGIS?

I've written a python script using arcpy which outputs a polygon feature class into a File Geodatabase. I have added a function to export the attributes to a separate CSV file. I am using the code ...
5
votes
5answers
426 views

How to divide a feature class into ranges?

I have a shapefile consisting of around 4000 polygons. The polygons are created from buffering around a similar number of islands somewhere in the Norwegian archipelago. Due to an error in the ...
2
votes
1answer
287 views

NEAR_3D function without the need for 3D Analyst, Arcpy

I am looking for a python script which would do similar as the ArcGIS 3D Analyst NEAR_3D function. Basically I would like to programatically in python find nearest points of one point feature class ...
4
votes
1answer
194 views

How to set page size in Arcpy?

It is possible to set Page size in arcpy, i'm looking for any tricky way to set the page size, using pure python or Arcpy. Thanks in advance
1
vote
1answer
348 views

pythonaddin button return value

I have asked this question a while back but within arcgis environment without using addin. Now i am trying to do the same task to get pixel value when user click anywhere on screen, to use in later ...
4
votes
5answers
827 views

Python loop Polygon to raster not working

I want to convert a large number of different shp polygons to raster in ArcGIS 10.1, using an existing field column "class" for the new raster classes. I am not very fluent in python but I thought ...
3
votes
1answer
163 views

Enabling ArcSDE Archiving with Python and C API using ArcGIS 10.0?

I have a script that does some register as versioned and updating privileges. How would I call into the c api for ArcSDE to enable archiving with python? ...
4
votes
2answers
1k views

How to get an extent for Raster using python

I have to get an extent of a given raster so that I can save it and use the same to clip another raster with that extracted extent. As of now I am stuck in the extent part. import arcpy from arcpy ...
6
votes
3answers
876 views

Arcpy's replaceDataSource Error

I've checked the other answers here and none of the answers worked for me... It's a "simple" matter of finding a layer by name in a map and changing it's datasource. Here's my script: #-- New ...
5
votes
2answers
371 views

Error 000725 message from output workspace when using Python (ArcPy) script tool?

I am having trouble running a script tool that I just created in Arc 10.1. The script runs fine in PythonWin, but when I create a script tool with it, the tool seems to not want to accept folders or ...
3
votes
1answer
623 views

Automate removal of duplicate polygon nodes from shape file in Arcmap

I have a whole lot of polygon shape files, many of which have got duplicate nodes. This makes processing difficult as almost all tools (erase, union, calculate area) do not work. I found that by ...
5
votes
1answer
80 views

Is there an arcpy equivalent to IPixelBlock in ArcObjects?

Trying to figure out a way of doing this via arcpy, but don't see anything remotely related to this. My raster dataset is a GRID. 'pPixBlock is an IPixelBlock 'sets raster to be one column ...
2
votes
1answer
178 views

TileCache error when using import arcpy [closed]

I recently ran the 10.1 sp1 and my scripts stopped working. I can't even right click on the scripts and check properties without the following popping up: InitializeParameters Syntax Error: Runtime ...
3
votes
1answer
218 views

pair value comparison to generate new raster using arcpy/python

I want to write a function which takes in two arguments (from two rasters) and compare those 2 values against a set of hard coded pair values inside function. Then return a value which i want to use ...
3
votes
2answers
177 views

Error with publishing Sort tool on ArcGIS Server 10

I have a model that has one tool (Sort), works fine on desktop. When I try to publish get this error. Geoprocessing service initialization failed. Invalid parameter: Tool - General Sort : Parameter ...
5
votes
1answer
590 views

How to use a search cursor on a joined table in ArcMap?

I'm struggling to get a search cursor to work on a joined table view. I've used search cursors before, but never on data that has been joined. Arcpy keeps saying that some of my joined fields don't ...
5
votes
3answers
2k views

Table to table script using Excel sheets (not workbooks) arcpy

So what I'm trying to do is to create feature classes from the sheets in an Excel table. I can get it to work if I save each excel sheet as its own workbook, however this isn't really what I want. I ...
6
votes
3answers
1k views

Insert points into SQL Server?

I am collecting X and Y values from a web service (Twitter) via a python script. In the long run, this will run over a period of months and I intend on stopping at around the 6 million point mark. ...
5
votes
2answers
1k views

Describing a coordinate system in arcpy

I have a python script in ArcGIS 10.1 which takes in a few inputs from the user. One of the inputs is a coordinate system. I would like to test whether the coordinate system the user chose was ...
2
votes
2answers
334 views

How to calculate the 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 , ...
3
votes
2answers
1k views

Can't Select and Export from Python Script

I am a novice in python programming but I am trying to learn by doing. I got stuck with this function a while back and can't seem to find a solution or a workaround. I am writing a script that is ...
4
votes
2answers
2k views

Why is Layer missing from Export to PDF?

I am using the arcpy module to loop through a number of map features (community areas), zoom to them, title the map with the name of the community area, and export to pdf. The trouble is that while ...
3
votes
2answers
839 views

arcpy.SearchCursor row.var

In arcpy.SearchCursor for row in rows I can return row.fieldname statically, but if fieldname is a variable, I don't know how to return the row.value of that variable dynamically. for example: ...
2
votes
1answer
215 views

Cannot add layer to map in arcpy

This is related to my question ArcPy replaceDataSource, but can anyone explain to me why the following code fails to add a valid layer from a .lyr file, and I get the same problems as in that question ...
2
votes
1answer
217 views

Index for data driven page created atlas?

We have a parcel atlas created from a data driven page document where each page represents a particular 16 mile square township. I have created my own index of polygons instead of ArcGIS index ...
1
vote
1answer
241 views

Rectangle for Clip_management using arcpy

I want to draw an interactive rectangle on screen which should be used as the extent for clipping geometry for raster datasets. Any suggestion?
3
votes
1answer
2k views

ArcPy replaceDataSource

I'm attempting to replace a datasource in an outline map frame using ArcPy. The rest of the script seems to run OK, but after the script has run the datasource the datasource of that layer shows an ...
12
votes
4answers
2k views

How can one compare two geometries in arcpy successfully?

I am trying to compare two separate feature classes to identify differences between them (sort of a diff function). My basic workflow: I extract the geometries using a SearchCursor Save the ...
2
votes
0answers
292 views

How to Load a Record Set Parameter in a tool dialog

I am trying to create a tool that allows a user to update a table row without starting an edit session. I have a script tool set up with a record set parameter and I use this set up to add new rows to ...
3
votes
1answer
230 views

How can I put coded domains into a list to be created in python script?

I have a large list of coded domains. They are numbers like: 01.6530.01, 05.7991.08, 05.7991.01, 05.7991.06 The code will be the exact same as the description. I've tried to make a list using: ...
3
votes
2answers
229 views

Process every 100 records in list

An arcpy merge process is failing due to the size of the datasets and I need to just merge every 100 tiles before it goes on to the next 100 tiles. I wrote the following snippet but it is just ...
5
votes
3answers
320 views

What's the centerline of a 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 ...
0
votes
1answer
798 views

How to use VBA in the field calculator, to copy the last 7 characters to a new field?

Im using ArcMap 9.3. Im looking for a VBA code to use in the field calculator to make a new field of the last 7 digits of a "pin" field. For example. my pin is 00-00-999-999 and i want it to ...
4
votes
1answer
680 views

Python console vs Toolbox script in ArcGIS

My question is similar to this post: Adding Layer in current session using ARCPY . My script works in ArcMap python console but not as a script in toolbox.I am running ArcGIS 10.0 SP4. The script is ...
2
votes
1answer
66 views

create folder with random number for each session using arcpy

I am processing data and it is required to have same name of outputs [standard names] for different geographical regions. Therefore it is necessary to save outputs in different folders each time. Is ...
5
votes
2answers
695 views

Problem with the where clause in ArcGIS when dealing with variables

I am writing a python script for ArcGIS. I have an input feature class which contains multiple pipelines which is saved as a variable InputPipeline. I would like to iterate through the pipelines and ...
2
votes
1answer
778 views

Layers not appearing when updated with UpdateLayer in arcpy

I have a script that calculates kernel density for several sets of points, adds the output to a base map, updates the added layer to use the same color scheme and resampling function of a template ...
4
votes
2answers
342 views

Keep nonintersecting polygons during clip

I am using ArcMap 10. I have two datasets, one of which consists of many small contiguous polygons, and one which has many small non-contiguous polygons. The first dataset is census blocks, and the ...
2
votes
2answers
384 views

How to get easting & northing of cell in raster using ArcPy?

It might be very simple task. But I would appreciate if someone can comment on How I can get easting and northing of a single cell raster using arcpy as this value is used for in further steps. ...
4
votes
1answer
2k views

Append, Insert or load Data into geodatabase table field

I am attempting to calculate point stationing (footage) along a pipeline at a set interval via python script, thing is I'm just now learning to code in Python, I come from a VBA programming ...
5
votes
1answer
1k views

How to update shapefile data source in multiple dataframes and mxds using lyr.replaceDataSource and Python dictionary?

After reorganizing the file structure for some of our GIS base data files I need a script to update the data sources for ~ 100 shapefiles in about 50 mxd files. Some of the mxds have multiple data ...
1
vote
1answer
241 views

Removing/adding values in symbology window with arcpy

I'm using arcmap 10.1 and have one shp with many polygons with different typeID. I want to make a serie of maps showing each typeID on an individual map. Since I have many typeIDs I want to use arcpy. ...
2
votes
1answer
283 views

Convert a List to a file list to use in an arcpy tool

I just can't figure out how to feed a list of files into an arcpy tool... I have List_tif.append(os.getcwd()+"\\Stage1\\"+name+"\\GeoTif\\"+name+"_"+str(ddp.pageRow.PageName) + ".tif;") That ...
2
votes
2answers
148 views

How to use model-builder iterator with a custom bit of arbitrary code?

How do I integrate a in-line variable from modelbuilder into a python script? Specifically, I'm using an iterator, and I'm trying to include the 'name' variable in a python script. I believe the ...
5
votes
3answers
1k views

How integrated can an IDE get for arcpy scripting?

I am looking to develop arcpy scripts (ArcGIS 10.1) in an IDE that is more "integrated" than Pythonwin. I would like an experience that is analagous to programming ArcObjects in Visual Studio ...