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

learn more… | top users | synonyms (1)

6
votes
2answers
251 views

Python scripting- compute statistics

I'm new to Python but I've heard is a good way to automate tasks. I have thousands of point shapefiles and need to extract the maximum value of each one and put them in a new table. I'll appreciate ...
6
votes
3answers
1k views

Why is an extra field necessary when creating point shapefile from csv files in Python?

I have a Python script that creates a point shapefile from a csv file within a Python script. This script gives me a ValueError for the longitude field (LON) if there isn't an extra nonsensical field ...
6
votes
1answer
3k views

In an arcpy script, how do I convert ArcGIS date value to a string reading in mm/dd/yyyy format?

I am writing an arcpy tool script in ArcGIS 10.0. In a fGDB feature class, I have a Date type field. I gather that the values in the Date field are stored as long integer dates, but they display in ...
6
votes
2answers
2k views

Is it possible to access ArcGIS's table operations “Summarize…” and “Statistics…” in python?

ArcGIS has a few nifty table tools, including Summarize and Statistics. Is there a way to access them through arcpy, or will I have to hack my own methods via math and lists?
6
votes
4answers
722 views

How to optimise and speed up Python code? [closed]

Again my lines of surface runoff... I made a script, solving the issue when lines cross other lines. Something like generalization. Like on the picture below. The problem is that I have to solve 30 ...
6
votes
5answers
184 views

How to access adjacent rows with cursor?

In the attached screenshot, the attributes contain two field of interest "a" and "b". I want to write a script to access the adjacent rows in order to make some calculations. To access a single row, ...
6
votes
2answers
471 views

How to create an oriented buffer using arcpy?

I would like to create an oriented buffer for every polygon in my shapefile using arcpy. By oriented I mean that I have two angles a1 and a2 that constraint the direction of the buffer. This is ...
6
votes
1answer
430 views

Are there any distinct advantages of creating a Python Toolbox over a Custom Toolbox?

I enjoy making different geoprocessing tools to practice Python and to become more familiar with the arcpy modules. I've just been using a Custom Toolbox and then importing the Python script and ...
6
votes
1answer
1k views

Counting number of points in a point shapefile - ArcGIS 10.0 / arcpy

I assumed this would be an easy thing to do. I'm loading a point shapefile into a map like this: layer = arcpy.mapping.Layer(file_name) Is there a way to get the number of points in the shapefile? ...
6
votes
3answers
3k views

Insert Raster to MXD using arcpy.mapping (ArcGIS 10)

What i want to do seems simple. But again i can't even find a workaround... I have got a lot of Raster-files (ESRI-GRID) which i need to insert into a layout mxd-file and then export the map to ...
6
votes
2answers
298 views

How to replace a cyrillic symbol in an attribute table using python?

I've tried searching for an answer and I've already seen some similar themes here, but I still haven't been successful in replacing Cyrillic symbols in an attribute table, which is why I'm asking for ...
6
votes
2answers
701 views

How to refresh the ArcMap display using ArcPy?

Was trying to replicate a RePast Agent Analyst simulation using just Python and arcpy. The script was about urban expansion. The script just changes the values of a column in a shape file. ArcMap's ...
6
votes
3answers
2k views

Does ArcPy have a spatial search function for geometry?

My problem: Using ArcPy I want to loop over buffers and select geometry_features inside each buffer and do something (update) only the objects found within that specific buffer. The code below ...
6
votes
4answers
2k views

Efficient arcpy method of points in polygon

Coming from a background of Mapinfo and Manifold, I frequently find myself frustrated with the ArcGIS SQL toolset. In both these former programs it is trivial to write a query asking, for instance, ...
6
votes
3answers
3k views

Writing world file when exporting TIFF using ArcPy Mapping?

According to documentation, the options are: Syntax ExportToTIFF (map_document, out_tiff, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {world_file}, {color_mode}, ...
6
votes
2answers
2k views

Getting XY map coordinates on mouse clicks as input variables into a python script

This is my first time coding in python, so bear with me. I wrote a script to calculate an analytical solution to find the orientation of a plane based on three points. I'm using ArcGIS 10.1. # Input ...
6
votes
2answers
1k views

Getting unique value of second field using arcpy.da.SearchCursor?

I have a feature class and using arcpy.da.SearchCursor I'm getting unique values of a field (e.g. Name). How can I use this method to get the associated row value of a different field (diff field = ...
6
votes
1answer
230 views

How to call arcpy.RefreshActiveView() every 5 seconds using ArcGIS Python?

I have an Excel macro that generates random values after every 5 secs and I am reading it in ArcGIS for Desktop... to refresh the view I have to press f5 and the view gets updated. Now I want to ...
6
votes
1answer
186 views

How much database bloat is reasonable?

I use personal geodatabases to hold all the data for my projects (probably around 10-20 feature classes across 2-4 datasets on average). I use the personal gdb because I like being able to hook into ...
6
votes
1answer
398 views

Counting Files with a Spatial Reference using Python

I need to display a list of feature classes with an unknown spatial reference, and the number of feature classes with a spatial reference. I think I have the first part right, but having troubles with ...
6
votes
1answer
681 views

How to do a separate Python installation with ArcGIS?

I see a lot of threads asking how you can have a separate Python installation (e.g. the Anaconda or Python XY distribution) and get it to work with arcpy, while not 'breaking' ArcGIS at the same time. ...
6
votes
4answers
1k views

How to check via Arcpy if ArcMap is currently in an edit session or not?

I've created a Python add-in button that helps speed up my coworkers workflow by copying one feature class attribute to another. It uses the arcpy.UpdateCursor function to update a row in the target ...
6
votes
2answers
365 views

Possible to Call ArcPy Script From AddIn in ArcGIS 10.0?

Is it possible to call an ArcPy script from a Java/.Net addin in ArcGIS 10.0?
6
votes
3answers
3k views

need to clear cache memory using python

I have looked at several posts here and on other sites but have not found a solution to the problem I am having with this python script. In this script I use 2 nested 'for' loops to extract a series ...
6
votes
1answer
180 views

Pull Data from Specific Excel Cell into ArcPy

I am new to Python and ArcPy, and wish to create a short script that pulls in a value from one specific Excel worksheet cell (namely, A2) and then performs an 'if' statement, whereby if the value of ...
6
votes
2answers
227 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 ...
6
votes
1answer
315 views

Why does tool take longer to run when in Python script?

I have written a python script that does some euclidean allocation. For that I use arcpy.gp.EucAllocation_sa() method. Now, my python script takes 30-40% extra time than spatial analyst euclidean ...
6
votes
1answer
1k views

Is it possible to convert graphics to features in ArcGIS 10 using arcpy?

Apologies if this is easy but I cannot seem to find the answer. Is there a way to convert a graphic to feature, i.e. use the "Convert Graphics to Feature" tool on the toolbar, within arcpy? I need to ...
6
votes
1answer
3k views

Setting Output Parameter in ArcPy for Server Tool

I have published the following script tool (which is wrapped in a model, i.e. just the script tool and all of its parameters) to ArcGIS Server 10. The GP service succeeds when run, but I cannot ...
6
votes
1answer
1k views

Get shape filename in attribute field using field calculator

I apologize for crossposting against the ESRI geoprocessing forum, but it seems like this one gets answers. I'd like to have a modified append tool (ArcToolbox) that takes multiple shapefiles with ...
6
votes
4answers
520 views

accessing the output of a python script tool dialog ArcGIS 10.1

Hi I have a a fairly simple script tool dialog which has been setup to get 6 parameters from the user and return them as the tool output as a list. the aims is that the out put would then be used ...
6
votes
1answer
172 views

Python in ArcGIS: How to add a space between upper and lowercase letters in TOC

I'd like to use python to update the TOC by adding a space (white space) for layer names that are like this: "BoundaryBuffer" or "WaterEdge" and replace them with "Boundary Buffer" or "Water Edge". ...
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. ...
6
votes
1answer
381 views

Algorithm to fill the gaps adjacent to parcels

I would like to find a way to fill the gaps between the road and its surrounding parcels, like described in picture below: I have different parcels like A and B , i want to fill the gaps by adding ...
6
votes
1answer
5k views

issues importing arcpy in Python IDLE

Hi I would want to use arcpy in my python code. I am able to import it through the ARCGIS desktop python console. But I am not able to import it into Python IDLE. I get the following error Traceback ...
6
votes
1answer
570 views

Is there anyway to make GPModels with python scripts execute faster?

I do not know if anyone else has this problem but my GPModels that include simple python scripts seem to take way too long to execute. One example is a model I built which is a simple select feature ...
6
votes
1answer
239 views

Is it possible to interrupt Select Layer By Location when first feature selected?

I´ve got a point feature class with some 7.000.000 points and I´m trying to check if any of these points is simply intersected by several polygon feature classes using 'for' loop and ...
6
votes
1answer
383 views

ModelBuilder: How to extract data by date, export to separate tables and interpolate tables to rasters

I've been using ArcGIS for a couple years, but when it comes to model builder I've only worked with very simple models. I'm hoping someone that is much smarter than myself can help me in building a ...
6
votes
3answers
224 views

Are there any open source Python modules compatible with arcpy that will allow complex SQL queries?

I am trying to handle string (non-geometry) duplicates in a large attribute table of a shapefile without having to convert to gdb and back or connect to a postgres db. I need to be able to use a count ...
6
votes
3answers
837 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 ...
6
votes
1answer
626 views

Why are results from Python tool not in Results window?

I am relatively new to ArcPy 10. and I want to return the list of feature class from a dataset. I can see them through the message, but cannot see them from the result window. Actually there are only ...
6
votes
4answers
2k views

How to interpolate points along a line in Python for ArcGIS 9.3?

I am building a Python geoprocessing script for ArcGIS 9.3. In the script, I have a simple LINE feature class with one row, one line. How can I use a linear referencing system to interpolate a point ...
6
votes
1answer
698 views

With arcpy, how do I detect relationship classes in a file GDB (or can't I)?

I would like to be able to detect relationship classes in a file GDB. Because users of my script might have only an ArcView level license, they would not be able to manipulate the schema of a feature ...
6
votes
2answers
1k views

Is anyone successfully using arcpy.ExportMetadata_conversion?

I don't know if it is a bug or my lack of python skills, but I keep getting 'ERROR 000816 The tool is not valid' in my python script when I call ExportMetadata_conversion Initially, I was attempting ...
6
votes
2answers
253 views

Can a folder connection in ArcMap Catalog window be added using Python?

I have created a set of general scripting tools for map automation, etc. In one of my tools a geodatabase is created in the workspace folder the script points to. Just out of curiosity, is there any ...
6
votes
1answer
104 views

Is setting the env.workspace var necessary for python add-in buttons in ArcMap?

I made a custom add-in for ArcMap (10.2 in my case) and was reviewing my code with a colleague. We're not sure if the setting the workspace is required in the code since the button's script is only ...
6
votes
1answer
371 views

How to draw shapes with highest possible decimal accuracy

I am trying to read input of lat and long to draw the shape based on condition.The input is standard array of lat and long with 15 decimal accuracy. I am realizing - I am loosing some decimal accuracy ...
6
votes
1answer
227 views

Is it possible to install ArcPy on a server for use in a geoprocessing web application?

I have a website on my intranet and would like to add some geoprocessing tools to it with Python. Many Users will not have Arc installed on their machines, so I think I need to have the scripts set ...
6
votes
1answer
3k views

Lidar - Automated building extraction (Improve Process)

I have the following process for automatically creating building outlines/footprints from Las files and was wondering if anyone can help improve it or has suggestions for other processes to use? ...
6
votes
2answers
2k views

Installing ArcGIS 10 with Python(x,y)

EDIT 10/20/2011: The problem I was having below was caused by trying to install Python(x,y) after ArcGIS 10. I got a new machine yesterday and instructed IT to install Python(x,y) 2.6.5.3 (has ...