A python API created by ESRI to perform geoprocessing and layer management.
4
votes
2answers
343 views
How can I have ArcGIS not automatically add raster clip output from Python window to the current map
I have a collection of rasters that I'm writing code to automate clipping based on a user defined shapefile. I am currently doing this in the Python window using the following as the main processing ...
4
votes
1answer
336 views
Determining ESRI File Geodatabase release version?
Is there any method in Python, ArcObjects, or the File GDB API for determining the release version (9.3, 10.0, etc.) of a file geodatabase? There is a need to find all of our shared 10.0 version file ...
4
votes
1answer
39 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
2answers
135 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?
4
votes
1answer
99 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
2answers
328 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
742 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
189 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
2k views
Modify raster layer display and symbology properties programmatically with arcpy or ArcObjects
I have over 1500 NITF files that I need to be able to modify the layer display and symbology of programmatically from within ArcMap. I need to set the properties outlined in red below:
I've looked ...
4
votes
1answer
120 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
315 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
259 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
340 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
372 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
189 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
1answer
470 views
Copy a polygon geometry in Arcpy
This to me sounded very simple so I am probably missing something basic here.
What I need to do is to create a copy of a polygon shapefile to a new shapefile with slightly different attributes.
Where ...
4
votes
1answer
1k views
How to programmatically add shapefile to data frame in Arcmap
I have a toolbox with python script which creates a shapefile from JSON txt file, but it does not show the generated shapefile in arcmap, i have to add it from the output location. What code shall I ...
4
votes
2answers
408 views
How to check if domain already exists?
I am trying to check the existence of domains in my file geodatabase which contains 4 domains (automatically populated after I created some annotation feature classes). My code is as follows:
import ...
4
votes
3answers
898 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
1k views
How to clip a vector feature to the extent of an existing raster dataset using arcpy
I have a clipped raster dataset with polylines (from the contour tool) overlayed (see attached). I am trying to clip the polylines to the extent of the raster dataset, which seems simple enough, but ...
4
votes
1answer
679 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
759 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
2answers
411 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
182 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
242 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
1answer
1k views
Create a definition query for groups of layers: Is it possible?
I have a large number of groups created, with each group having many layers. I have looked for a way to set a definition query for all the layers in each group but haven't found anything. Is it even ...
4
votes
3answers
797 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
5answers
118 views
ArcPy - Can Radio buttons be added to a Script tool?
I have 3 Point shapefiles for 3 species that contains the accession points of each.
The user needs to specify only one species at a time. I need to write a script tool for adding the selected Point ...
4
votes
1answer
113 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
63 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
488 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
1answer
296 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
348 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
173 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
915 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
1k 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
2answers
418 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
3answers
2k 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
1k 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
1answer
1k 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
465 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 ...
4
votes
3answers
944 views
Need to create a collection of polygons from a collection of points
I have a set of points, which are spread over a wide geographical area. I need to be able to create a set of polygons which best represent the clustered points.
In parts, some points may simply lie ...
4
votes
1answer
44 views
Using matplotlib to create and export graphs automatically from ArcMap
I am going to start a project soon where, after the data has been processed in various ways, an output jpg showing a graph of the data should be produced. The workflow is as follows:
1. A feature ...
4
votes
2answers
90 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
94 views
Slow performance on splitting a shapefile by attributes
I've tried to develop some workflows with the ArcPy module for splitting a shapefile based on the unique values in a specified field. The code works as expected except one thing I am not able to ...
4
votes
4answers
276 views
Arcpy add and calculate fields for features in a list
I have a script I am working on and am hitting a runtime error. I am attempting to create a list of all of the shapefiles within a root directory, then add a field to each shapefile and calculate it ...
4
votes
1answer
257 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 ...
4
votes
2answers
405 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
2answers
357 views
ArcGIS Spatial Join Options Missing
The ArcGIS SpatialJoin online help page has a long list of match_options when joining data spatially, including HAVE_THEIR_CENTER_IN.
However running the arcpy.SpatialJoin_analysis tool in Python ...
4
votes
3answers
473 views
Using threading module with Arcpy: Manager/Worker architecture
I asked this question on Stack Overflow on how to setup a manager/worker scenario.
But I am getting some error when trying to use threading on my Python install with ArcGIS 10 (just the python ...



