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

learn more… | top users | synonyms (1)

3
votes
1answer
2k views

ArcGIS 10.0/10.1 - arcpy - automate projection tool with different datum or projection

I am getting stuck with a task that is slightly different from the posts I found so far on this same website. Assumption: all layers have a defined coordinate system Problem: I would like to ...
3
votes
1answer
1k views

getting the specified geographic transformation, or at least the GCS, of a data frame

First, the TLDR digest: I'm getting a bogus value from dataFrame.geographicTransformations on some machines; how do I get the correct value as shown in the properties dialog? and/or Given a spatial ...
2
votes
2answers
606 views

The name contains invalid characters

I'm having a problem with the following script. When listing parameters that are optional I've used the "" before, so I can't figure out why this isn't working. import arcpy import os ...
3
votes
1answer
191 views

shapefile batch clip and merge combined

I have two shapefiles, one is polyline, the other polygon. For each polygon I would like to clip the polyline vectors inside. Using arcpy I already found part of a possible solution: ...
1
vote
1answer
62 views

How to use in_field_map parameter of CreateCompositeAddressLocator_geocoding?

I would like to know if anyone who has worked with the CreateCompositeAddressLocator_geocoding method knows how the "in_field_map" parameter is formed?
1
vote
0answers
185 views

Table record counts change when using python tool

I have a python tool which investigates mxd files and clips/projects and exports all visible datasets. Recently I've found that the record counts (even on non-clipped data) is different. It's ok if I ...
3
votes
1answer
2k views

Creating empty group layer within existing group layer using arcpy.mapping?

Referencing this question, Add a new group layer with python ArcGIS 10, I'm trying to use python to add a empty group within a group layer. So far I'm able to add a empty group within the map ...
4
votes
1answer
646 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 ...
2
votes
0answers
148 views

Problem to transform events from one route to another

I have a road feature class layer containing parts like 1_10, 1_20. 2_10, 2_20... etc. 1_, 2_ is later used to create the route and _10, _20 is indicating the direction (the road feature classes were ...
2
votes
4answers
627 views

Error When Trying to Run Slope Analysis Script

I have written a script which is supposed to loop through all the rasters in a folder and perform a slope analysis on each raster and save the results in another folder. I keep getting the following ...
2
votes
1answer
195 views

Include Python Script with ArcObjects Addin

I'm building addin for 10.1 and need a method (ConvertToMSD) that's only available in ArcPY. I've figured out out how to execute a python script from an ArcObjects addin: Calling arcpy/python from ...
5
votes
2answers
540 views

Perpendicular lines at start and end of line in ArcGIS Desktop?

I have some lines. I want to draw perpendicular lines at the start and end of the lines, on both sides of the lines. Can somebody help me in Python? Also, what are the variable settings of the ...
6
votes
1answer
232 views

Add raster paths to shapefile with Python (ArcGIS)?

I have a problem and maybe someone is able to help me or give me some hints how to start. Situation: I have a lot of raster and of every raster I have the center coordinate. Out of this coordinate I ...
3
votes
3answers
516 views

Sorting polygons by latitude?

We have a set of polygons which we would like to sort and number according to their latitude. This will make it easier for local authorities to relate to the numbers of the objects. I have looked ...
0
votes
2answers
144 views

Using 3D Raster Domain to get polygon of raster - but stripping Z and M values

I'm trying to convert a number of large, floating point rasters into polygons so I can view overlaps etc. I've been using 3D Raster Domain sucessfully to do this. The only problem is that the polygons ...
6
votes
2answers
287 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 ...
3
votes
2answers
8k views

Read specific column and row value from a text file using Python [closed]

I have a text file as following: 1.25 177. 1.50 220. 2.00 272. 5.00 427. 10.00 556. 25.00 763. 50.00 916. ...
4
votes
1answer
301 views

Why is the Frequency Tool in ArcGIS so Fast and Efficient?

Why is the Frequency tool in ArcGIS is so fast and efficient? Is it possible to make my own Frequency Tool with similar performance (in python)? I tried to do some based on python dictionary and ...
16
votes
5answers
2k views

How to make a GIS inventory?

My office will be seeing a big change in its GIS section. This section has been operational since the 1980's and has a huge collection of GIS data (i.e., shapefiles, raster files, data, etc) but never ...
8
votes
2answers
599 views

How to create a solar intensity map for a garden plot?

I'm interested in creating a raster surface that depicts the average solar intensity per unit area for a small garden plot. I imagine the inputs into the model would be the following: Plot ...
4
votes
1answer
188 views

How to select points within polygon constrained by field?

I've created a polygon from a raster dataset: arcpy.RasterToPolygon_conversion(RasterInt, "C:/arc/poly_int.shp", "NO_SIMPLIFY", "Value") The 'value' field has numbers 1-37, which map to the ID ...
6
votes
2answers
488 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
1answer
193 views

What percentage of ArcGIS users are using version 10.1 already?

I'm planning on building an add-in using ArcPy, but some of the functionality I need is only available in 10.1. I want to distribute this add-in and was wondering if making it 10.1 only would limit ...
2
votes
2answers
2k views

rename feature layer fields

Guys and gals could you please provide me with a sample code as to how to rename a field name in a Feature Layer or Table. I've been trying to use the FieldInfo object to do so over the last couple ...
1
vote
1answer
2k views

Looping through multiple feature datasets and Intersect Files?

I am getting an error with a python script I have created. I have 1 geodatabase with 3 feature datasets. What I would like to do, is loop through 1 feature dataset (NB) to get a list of feature ...
2
votes
1answer
343 views

ModelBuilder: Multiple Iterators and Clipping

I have two separate polygon layers. One layer consists of voronoi polygons. The second layer consists of buffers, many of which overlap. I need to do is iterate through each voronoi, clip only the ...
5
votes
2answers
1k views

Using Custom Functions in Python Toolbox?

I am trying to put together a python toolbox (Arc 10.1) and would like to use a defined function in my code. The function is: 'sys' is imported at the top of the file def listdirs(folder): ...
2
votes
1answer
709 views

How to use arcpy.mapping to batch export layer to KML?

I am trying to export map layers from an MXD to KML using arcpy with the following code: import arcpy, os, sys, traceback arcpy.env.overwriteOutput = True mxd = ...
4
votes
2answers
351 views

Running python 2.6 and 2.7 in ArcGIS 10.0

I figure that there must be a way for me to run python 2.6 and 2.7 on the same computer. I've got a program that requires 2.7, but ArcGIS requires 2.6. I'd like to be able to run both programs at ...
1
vote
3answers
153 views

Applying rotation before FeatureToRaster_conversion?

I am converting polygon shapefiles to rasters. With arcpy I am using the function FeatureToRaster_conversion. gp.FeatureToRaster_conversion(InFeatures, InField, OutRaster, InCellSize) This function ...
4
votes
2answers
332 views

Getting junction id for roads in network dataset using ArcPy?

I have a network dataset with roads and junctions. I am wondering what class I can use in ArcPy to extract FromJunctionId and the ToJunctionId for each road segment in the network dataset.
2
votes
3answers
578 views

Field Type Date invalid when run in Python, but not in Model?

Using ArcGIS Desktop Advanced 10.1 and PyScripter When running the arcpy.FeatureClassToFeatureClass_conversion, I get the error that the field type of Date is not valid. However, when running this ...
0
votes
1answer
514 views

How to add a graphic table element in Python without Production Mapping extension?

I'd like to add a table in the Map Layout that includes only items visible at the current extent of the dataset. I know that the Production Mapping Extension lets you insert a Graphic Table Element ...
10
votes
1answer
413 views

Is there a way to use ArcPy and PyGRASS tools in the same Python script?

I´m trying to write a Python script, that includes different ArcPy / ArcGIS commands and want to combine it with GRASS geoprocessing tools. Unfortunately importing the GRASS libraries doesn´t work. ...
2
votes
1answer
339 views

Saving rasters in a Python for loop fails only on last iteration

I'm a newcomer to Python scripting and I'm having what's seemingly a very simple problem but one that's stumped me enough to send me posting to these forums for the first time. I'm using a for loop ...
2
votes
3answers
832 views

arcpy: get list of adjacent lines per line

I am working with polylines with hundreds of thousands of features, and would like to write a script that returns the OIDs of all lines adjacent (intersecting with) each line. I have been ...
3
votes
0answers
321 views

Make Graph (Data Management), Changing item names in legend [closed]

I'm having python produce a multi-series graph. How do you change the series name in the legend, the default being Vertical Bar, Vertical Bar1, Vertical Bar2.... ...
9
votes
1answer
1k views

How to prompt for user input during ArcGIS Python script tool execution?

I want to prompt for user input after all parameters have been specified for the script tool. I've seen many forum posts and stackexchange questions about this, and they all conclude that it's ...
1
vote
0answers
132 views

jagged edges in mosaic DEM

I encounter edge issues when trying to mosaic USGS NED DEMs in ArcGIS 10.0.0. After projection and aggregation, I attempt arcpy.MosaicToNewRaster_management(). I've reproduced the same results using ...
5
votes
1answer
225 views

parallelization of raster mosaic

I would like to create a raster mosaic of the national USGS NED 30m DEM (~50 GB). I'd like to leverage parallel processing using python multiprocessing module where possible. I'm using ArcGIS 10.0. My ...
0
votes
1answer
629 views

Invalid data source issue when trying to use lyr.replaceDataSource

When I run the following code in an open mapdocument, it executes and does what I want it to, replace the datasource of the Indianacounty_shp layer with the County_Boundary feature class. import ...
7
votes
3answers
2k views

python.exe has stopped working

A python script was written about 18 months ago by a person who has now left. It produced the required outputs then. I've been asked to run it again but with different (finer resolution) data ...
0
votes
1answer
1k views

Runtime error <type 'exceptions.TypeError'>: 'unicode' object is not callable

I'm working on a script to replace a layer datasource, and I'm getting an error I cannot figure out. When I run the following code in a python window inside ArcMap, I get a "Runtime error : 'unicode' ...
4
votes
1answer
467 views

Programmatically export to geotiff in different scales from ArcGIS Desktop?

I would like to programatically export geotiff files in different scales (e.g. 1:25000, 1:50000 etc) using arcgis10. As input I have some shape files and a DEM file as well as a corresponding style. ...
5
votes
3answers
2k views

Merge Spatially Coincident Features in the Same Feature Class

I need a way to programatically merge grid cells (polygon 15x15m) that are directly on top of each other and add together some of their attributes. I am working in ArcGIS 10.1 with the data stored as ...
0
votes
1answer
2k views

Data Driven Pages and exporting PDF using Python [closed]

I am able to zoom into map_index shapefile rows for a group of mxd documents in layoutview and export zoomed record as a PDF document at the same time. I tried to combine below codes to make the ...
4
votes
4answers
225 views

How to determine if all points on a map are identical in arcpy?

My eventual goal is to automate kernel density calculations for a large corpus of point data; however, if all points are identical (for example, if there are 7 points all stacked on top of one another ...
1
vote
1answer
531 views

arcpy JoinField_managment RuntimeError

My script is supposed to pull weekly flu data from a department of health website, parse it for that week, and then push the data up to our ArcSDE server so that it can be displayed on our Web Mapping ...
1
vote
1answer
1k views

Error code 500 at REST Endpoint of published geoprocessing service perhaps due to output parameter type?

Using ArcGIS 10.1 (Server and Desktop) I've been trying to publish a geoprocessing service based on a python script I wrote. Of course, it all works flawlessly from ArcGIS Desktop but I run into all ...
4
votes
1answer
169 views

Converting dbf into raster image using Python as way to add table to layout?

ArcPy does not have a function to add a table to a layout. I was thinking that maybe taking that table (e.g. a dbf), there may be some python script command to turn it into a raster (e.g. do ...