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

learn more… | top users | synonyms (1)

4
votes
1answer
93 views

Arcpy error message: 'Layer' object is not subscriptable?

What the code does successfully so far, is gets a list of the layers in the first data frame of the current map. What it doesn't succeed in doing is, joining the layer names to the gdb location using ...
4
votes
1answer
130 views

How to stack rasters for ecological analysis?

The attached image shows two different forest openings. Each opening has the following layers associated with it: Point shapefile 1 = A red X which represent a large "legacy" tree in the gap Point ...
4
votes
1answer
2k views

How to find and delete identical points?

I recently performed Integrate on a merged point feature class in ArcGIS 10.1. I specified "1 meter" XY tolerance for the Integrate command. The resulting point feature appears to be what I want ...
4
votes
2answers
602 views

Arcpy remove invalid character

I've built a model that takes the name of the Excel worksheet containing xy data, and uses that name as the name of the output shapefile. ( Worksheet "massachusetts_sightings" in an xlsx becomes ...
4
votes
2answers
964 views

Field calculation- Arcpy

I am developing a script to calculate the values of two fields (C and D) based on value of field A (It is a Point feature): A C D 0.2 1 1 0.2 1 2 0.2 1 3 0.4 2 1 0.5 3 1 0.5 3 2 So the idea is n ...
4
votes
1answer
224 views

How to dynamically view Python script results in ArcMap?

I want to view the output of arcpy scripts (run in Python IDLE) in ArcMap. I tried refreshing the ArcMap data frame after I run the script. This does not work. Please advice me on this.
4
votes
2answers
797 views

Resequencing Legend Items in Python

I create various layers programmically with Python in ArcMap 10. I can adjust how the layers are sequenced using the arcpy.mapping.MoveLayer command. But I want to have the legend reflect a different ...
4
votes
2answers
128 views

How to transfer attributes to thousands of local points from ArcSDE feature class with millions of polygons?

I have a set of points and a huge feature class with topographic information (OS MasterMap for who knows it). I'm talking millions of polygons huge. I want to transfer attributes of the polygons to ...
4
votes
1answer
101 views

Arcpy Pythonaddins Equivalent of arcpy.GetParameterAsText

I've build a neat little search arcpy script. The user opens any mxd, zooms to a location, chooses a corporate fGDB, and runs the tool. The user gets a list of all the populated feature class that ...
4
votes
1answer
97 views

Is it possible to store a default symbology layer in an arcpy add-in?

Since arcpy is limited in how symbology can be manipulated, I was curious to know if a symbology layer can be stored in an arcpy add-in. Does anyone know if it is possible to store a .lyr file, or ...
4
votes
1answer
73 views

Convert linear polygons to lines

Hi I have some long linear polygons that I'd rather store as lines but I'm not sure how best to do this. Ideally I'd have a line goiung through the centre of the polygon lenthways. I have two ideas of ...
4
votes
2answers
283 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 ...
4
votes
2answers
655 views

arcpy.da.SearchCursor - unique value get second field value

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 = ...
4
votes
1answer
264 views

Good practices for storing connection info while deploying geoprocessing tool on Server

I have a geoprocessing tool written in python. It will be deployed on ArcGIS for Server 10.1 as a GeoProcessing Service and it's processing workflow includes some manipulations with data in SDE ...
4
votes
1answer
536 views

Why can't I multiply two string fields in the Field Calculator by converting them to int() and float()

I'm using ArcGIS 10 and new at python scripting. I have a string field that I need to calculate by multiplying two other string fields. I can do it in python using two arbitrary values... CINPT1 = ...
4
votes
1answer
653 views

How do you add a long list of rasters together in Python?

If you have produced a long list of rasters (lets say 50) and want to add them together, is there any shorter way to write in python rather than typing all the inputs, like so: outRas = inRas1 + ...
4
votes
2answers
724 views

Python script to implement a batch import of CAD files into Geodatabase

Please does anyone know where I can get a python script that can do a batch import of CAD files into a Geodatabase. I have one I wrote here, but it is only able to import one CAD file at a time. It ...
4
votes
1answer
716 views

ArcPy performance issues with an UpdateCursor when sorting

I'm hoping that someone will be able to help me here. I have written a short ArcGIS Python script (mainly cobbled together from other examples) that sorts a feature class ascending based on two fields ...
4
votes
1answer
253 views

How To Calculate Height of Point B?

I have a survey point data which has coordinates X,Y, Height, Angle(Dip),Azimuth, and Depth(Distance). for Example, point A: Easting: 290694 Northing: 715927 Elevation: 1060 Angle: 65° ...
4
votes
2answers
3k views

Arcpy - How do I specify the precision and scale of a new field?

I'm wanting to create a field with a maximum of 1 decimal place and then calculate a value into it: (I know that all my values are < 10) arcpy.AddField_management('C:/shapefile.shp', 'myField', ...
4
votes
3answers
1k views

arcpy join field tool is not licensed

I am using ArcGIS and arcpy to process some shapefiles. When I try to use the function arcpy.JoinField_management() the program stops and Python says that the tool is not licensed. This confuses ...
4
votes
2answers
608 views

How to use Matplotlib in Python 2.6 installed by default ArcGIS 10.0 installation?

I am wondering if anyone has successfully run Matplotlib with the default installation of Python 2.6 that comes Arcgis 10.0. It does not seem to work with the python version installed by Arcgis 10.0. ...
4
votes
2answers
749 views

Dynamically change zoom level of overview map to fit with current extent in DDP

I am using DDP pages in a large mapset with pages ranging from 1:7500 to 1:130,000 and the overview map is zoomed out to far to see some of the smaller zones. Is it possible to set the overview map to ...
4
votes
1answer
1k views

ArcGIS License - ArcInfo level license set during python script execution vs via Desktop Administrator

We have an ArcInfo floating license available. Can I check out an ArcInfo level license via arcpy. Here, from the arcgis help, it says you can import a license level for stand-alone scripts. If a ...
4
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 ...
4
votes
3answers
2k 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 ...
4
votes
2answers
506 views

Issues with osgeo - qgis.core and arcpy modules

Is it possible to have the python shell from either qgis or argis to load (import) both qgis.core and arcpy? I am developing a metadata creation tool and have completed the core functionality using ...
4
votes
1answer
277 views

Can I delete only tables, or only objects sharing a string of text, from a geodatabase?

I've got about 1000 tables in a geodatabse that I need to delete. They are named IntersectedBuffers_1, IntersectedBuffers_2, etc, and they're the only tables in the database. Could someone please ...
4
votes
2answers
333 views

Finding Band Count in Rasters using ArcPy

I'm having troubles finding the band count for my raster files using ArcPy. I need to first list all the raster files in a directory, and then display the band count for each file. I am able to list ...
4
votes
4answers
611 views

Unable to save selected layer by attribute for ArcGIS Geoprocessing

I am troubles using the SelectLayerByAttribute() function for arcgis geoprocessing. I have a layer and I want to select everything that matches on a particular attribute. I call MakeFeatureLayer() ...
4
votes
3answers
924 views

How to automatically create 2D-point features from addresses in an SQL database

I currently have an SQL-Table which contains our buildings. I already added the table and now want to create features ( 2D-Points ) from that information. The biggest problem I have is that the ...
4
votes
1answer
180 views

Finding duplicate records in a field via Python in field calculator

im looking for duplicate records in dbf files based upon the attribute called 'ID'. I have various dbf files from 500,000 records to 1.5 million and I know there are a host of duplicates. I would ...
4
votes
1answer
162 views

How to generate overlapping polygons from lines output from Table To Ellipse tool?

I have a feature class of line-based ellipses generated by the Table to Ellipse tool that looks like this: What I want is polygons of the individual ellipses, however tools like Feature to Polygon ...
4
votes
1answer
611 views

How to reduce time for 'Export to PDF' (or any other alternative to print maps) in Python?

For my work, I designed a tool to create PDF maps with large amount of data, intersected with 5 buffer rings using ArcPy. The job involves intersecting points, selecting points, generating Elevation ...
4
votes
2answers
205 views

Moran's I z-score in ArcPy

I have a ArcPy script to calculate Moran's I several times (50 to be precise). However, I am not interested in the Moran's I value, what I need is the z-score returned by the tool. Even though the ...
4
votes
1answer
691 views

How to merge many shapefiles in different folders?

Directory structure is basically as such: county\City\prep\POI\Completed\C1, ...C2, ...etc\ I'm trying to write a script to go through the *\Completed*\POIS.shp and merge them all together, at a ...
4
votes
2answers
361 views

ArcGIS Conflation Tool Recommendation or Custom Script for Comparing Points

Can anyone recommend conflation tools for ArcGIS Desktop (10 or 10.1, paid or free) or a scripting outline / procedure (or just a script) to have a technician efficiently process the following rules? ...
4
votes
1answer
267 views

Access Metadata from ArcSDE-tables using python

Is it possible to access the metadata of a feature class in a ArcSDE-data, using arcpy / python (on Arcgis 10.0). I suppose I could export the metadata to xml and parse the xml, but is there a more ...
4
votes
1answer
93 views

How to detect densely labelled areas?

I'm trying to detect densely labelled areas for a given scale like explained below. so dense labelled area is the area having high rate of overlapping labels. I'd like to detect densely labelled ...
4
votes
3answers
1k views

Why does arcpy.ImportToolbox() not work in ArcGIS 10 (SP5) when calling custom model for topology?

I have an arcpy/python script using ArcGIS10 and using a custom toolbox and model. The toolbox has an alias of defaultTopo and my model within the toolbox is called AddRuleToTopologyModel. This model ...
4
votes
2answers
2k views

clipping a raster by multiple datasets or polygons

another newbie question from me. I would like to clip a DEM using a grid of polygons. It's probably easier to use multiple polygons in one shape file, but I haven't managed this so I'm trying to use ...
4
votes
1answer
564 views

Getting a constant background color for transparency

I am creating a series of tif files at 1:10k scale over a vast area (760 tiles) using arcpy.mapping.ExportToTIFF and then stitch them together to create a single ecw. The output looks ok but when I ...
4
votes
2answers
1k views

arcpy overwrite files in a geodatabase file

I'm writing a python script, I've got an mxd and its workspace is a geodatabase file with all the files I need into. The problem I'm encountering in testing and writing code is that, despite of the ...
4
votes
1answer
262 views

String format for geodatabases in ArcPy scripts

Several ArcPy functions take strings as geodatabase identifiers. I've looked through the ESRI docs, but can't find a good reference for the various acceptable formats. I'm looking for examples of ...
4
votes
2answers
2k views

How to create reports in ArcGIS using Python?

Does anyone have experience in creating reports from your ArcGIS data (geodatabase, map exports) using a python reporting engine? In my current project, we are using Jasper Reports in the following ...
4
votes
2answers
2k views

Arcpy Insert Cursor not inserting all rows

Good morning all, I have a script here that takes data from a cross-tabulated non-spatial dataset where monthly values are stored in a single table row for a given year and linearizes those data so ...
4
votes
3answers
3k views

Select Layer By Attribute using loop

I have 273 features in the feature class and i want to select them one by one and use the statement in the following code. At the line: *arcpy.SelectLayerByAttribute_management ...
4
votes
2answers
854 views

arcpy: check for same record in cell above and below

After using the find duplicates in arcmap 10, I want to check if the feat sequence ("find duplicates" marks all records with the same attributes with the same number [in "feat_seq"] and creates a ...
4
votes
1answer
2k views

How to add field in attribute table by python

I have research on the question (How to add an attribute field to an existing Shapefile via Python) but could not implement it. If you can give me examples on how to add field name in attribute ...
4
votes
1answer
594 views

Can I change the font type in all Text_Elements in a page?

I want to change all the font styles in a number of mxd's from "Lucinda Sans" or whatever the current one is to "Arial" without changing the font size. I wrote a simple script to find/replace text ...