Tagged Questions

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

learn more… | top users | synonyms (1)

2
votes
0answers
133 views

How can I draw an ellipse filling the dataframe with ArcPy?

I need to modify one of my template scripts to draw a circle from the centre of the (inset) data frame to the edge of the data frame. This will then be used to clip the data frame to shape. I'm using ...
8
votes
4answers
1k views

How to split points by polygon?

I am looking for a way to split points by a county polygon feature class. The attached image shows two feature classes: one composed of points and the other a county polygon feature class. The split ...
0
votes
1answer
419 views

Parse attribute table value to export filename using data driven pages and arcpy.mapping

I'm trying to customize a data driven page looping statement workflow and want to set a better filename to the final export. Currently the file name uses the page index (pgIndex), but I would like it ...
4
votes
2answers
2k views

Create temporary files as intermediate output to be used as input in concatenation

Q_PART_I I need to merge many (MANY) tables in one unique output table by means of the arcpy.Merge_management. Anyway, I'd like to avoid the creation of tons of intermediate files as my script ...
1
vote
2answers
377 views

Cannot get arcpy.MosiacToNewRaster to work with list

Below I have a snippet of a much larger code that I cannot get to work and I am not sure why. It seems that I always have trouble using arcpy functions with rasters. Can anyone help me get this code ...
3
votes
1answer
84 views

> - operator and “Shape_Area” field in a geodatabase

this might be a pure python problem or a problem with arcpy. please help me out: min_area = float(GKPROZ_functions.min_of_field(out_name,"Shape_Area")) print area_max if min_area > ...
7
votes
2answers
996 views

Permanently replace/update server/service in each ArcSDE Layer in MXD?

Using the mxd.findAndReplaceWorkspacePaths method, if and MXD is updated and the path the the .sde connection file moves again all of the data sources will break again. Is there a method to ...
2
votes
2answers
1k views

Help with ListFields and CalculateField_management syntax

I need some assistance with the syntax for a CalculateField_management calculation as I have still yet to master all the python syntax rules. What I am trying to do is find the max value in a ...
6
votes
3answers
2k views

How can I select vector features that overlay raster in arcpy?

I have two datasets: point feature class and raster (stored in file geodatabase). The spatial extent of the raster is smaller than the point dataset. Is there a way I could select (or create new, ...
1
vote
1answer
256 views

Project layer with custom projection

My ultimate goal is to know UTM and UTM Northing and Easting. The data can be anywhere in North america. I calculated UTM using arcpy tool (arcpy.CalculateUTMZone_cartography) and I tried to truncate ...
4
votes
1answer
333 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 ...
5
votes
4answers
2k views

Exploding overlapping to new non-overlapping polygons?

Given multiple polygons that overlap in multiple ways, I would like to export from these features all polygons that don't overlap with others, iteratively. The product would be a number of features ...
3
votes
3answers
2k views

How do I access a multivalue output parameter from a python script in modelbuilder in ArcGIS 10.0?

How do I access a multivalue output parameter from a python script in modelbuilder, in ArcGIS 10.0? That is, I have a python script that loops through several input layers (working through a script ...
2
votes
1answer
181 views

Import 3D Analyst Functions With ArcPy

This really seems like I should be able to do this, but I am running into some problems. I want to import 3D Analyst with python, in the same way I import Spatial Analyst, but it returns an error. ...
1
vote
1answer
237 views

AddLayer method does not add all bands of .tif image (3 bands total)

I am currently having trouble getting 3-band raster's to display correctly when I call the arcpy.mapping.AddLayer() method. It should be said that I am using a pre-existing mxd template to automate ...
4
votes
1answer
1k 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 + ...
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 ...
3
votes
1answer
558 views

Create a new Dataframe using Arcpy in 10.1

Does anyone know if there is a way to create a new empty dataframe in ArcMap 10.1 using Arcpy? Thanks
8
votes
2answers
3k views

Finding mid-point of line using ArcPy?

How can the mid-point of a polyline be calculated using the geoprocessing framework, e.g. in a Python script? The polyline.centroid property returns The true centroid if it is within or on the ...
2
votes
1answer
207 views

arcpy Tool works in debug mode but not in normal model

When I try to run the following simple script from arcmap it fails but when run using right--click debug and then F9 (debug) in python scripter it works fine. I don't understand why??? # Modified ...
0
votes
1answer
409 views

Failed to open raster - ArcGIS 10 SP2, Python 2.6.5, Windows 7

I have an arcpy / python script that is working fine with ArcMap 10 no Service pack (Build 2414) on windows XP, but consistently failing on using ArcMap 10 SP2 (Build 3200). Getting the ESRI 99999 ...
19
votes
6answers
7k views

Ways to Speed Up Python Scripts Running As ArcGIS Tools

This is a pretty general question. I just wondering what tips and tricks GIS programmers have used to speed up arcpy scripts that you import into the toolbox and run. I work most everyday writing ...
7
votes
3answers
4k views

How do I retrieve start and end point coordinates with Python/arcpy?

How do I retrieve start and end point coordinates with Python/arcpy for a polyline feature class? I expect to pass a segment identifier to a subroutine and have it pass back start and end coordinates. ...
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 ...
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 ...
0
votes
2answers
450 views

Why does TableToTable give ERROR 000732 when published to ArcGIS Server?

I have a python code that uses ArcPy command "arcpy.TableToTable_conversion" to convert a database table to a dbf file. arcpy.TableToTable_conversion The input table is from a SQL Server database ...
1
vote
1answer
70 views

LASToMultiPoint_3d

Trying to use the arcgis python command LAStoMultipoint_3d as seen here. I'm running the code snippet against one of my LAS files. It creates a .shp, sbx, shp.xml, shx and dbf file. However, the ...
3
votes
2answers
2k views

Using arcpy from the command line on ArcGIS Linux Server 10.1

We installed ArcGIS SERVER (not Desktop!) 10.1 on a RHEL (Red Hat) machine. ArcGIS Sever is supported for Linux. However, it appears they don't make it easy to script in python, from the command ...
2
votes
0answers
297 views

On using R data with ArcPy to make histogram in ArcMap

I am writing a tool in python which passes parameters to a R script, which in turn creates a DBF file. I read this DBF and want to make a histogram out of the data inside ArcMap as one of the results ...
5
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? ...
7
votes
1answer
443 views

Arcpy crashes in loop geoprocessing (general behaviour)

I have several standalone scripts that create a list of shapefiles to process (or coverages in one of the scripts). Sometimes my script crashes after it processes three files, sometimes ten, ...
1
vote
2answers
509 views

Script to extract UTM Zone using Range and Meridian information

Hi Everyone, I am looking for a phython or php script that will accept the Range and Meridian values of a location and use it to identify the UTM zone. I have a table that comprises of Easting, ...
4
votes
1answer
864 views

Is it possible to sort an arcpy.da.UpdateCursor()?

I have an ArcPy Data Access update cursor that I would like to sort before making updates to it. The cursor makes updates if I don't sort, but if I add a sort to the cursor I get an error, ...
2
votes
2answers
432 views

Using osgeo modules in ArcGIS10.1 and QGIS 1.8 python shells

This is related to an old question of mine - Issues with osgeo - qgis.core and arcpy modules Now in new versions of all the software QGIS Lisboa (1.8), ArcGIS 10.1 and pyScripter 2.5.3. They all use ...
5
votes
2answers
1k views

arcpy.UpdateCursor for multiple fields

I've hit a wall trying to loop through multiple fields with arcpy.UpdateCursor. I have a list of files (2) with multiple fields (10-15'ish) that have its own error check in SQL, and an error value to ...
3
votes
1answer
1k views

insert cursor “Row contains a bad value”

I'm having a problem copying data from a shapefile to a feature class using an insert cursor. Here is the part that is causing trouble: newRows = arcpy.InsertCursor(Target) sourceRows = ...
2
votes
1answer
364 views

How to write XML attributes from feature with ArcView license?

I need to generate xml of attribute data of a feature, but I have only Arcview license so, I can't use Export XML tool. What are my options? What is wrong with this code (after applying search ...
5
votes
3answers
5k views

Remove lock on feature class

When i try to delete a feature class , after or during the use of an Arcgis engine app which uses the same feature class i got an error concerning the lock , so i can't get ride of this lock until i ...
0
votes
1answer
417 views

Vector boundary generation -similar to Image Boundary

I want to automate the creation of boundary polygons from vector files. This is not footprint or extent creation (I already have scripts to do this). I want to create a tool similar to the QGIS, Image ...
4
votes
2answers
1k 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 ...
29
votes
2answers
2k views

Streamlining Python Code for Big Data

I have Python code which is designed to take point shapefiles through the following workflow: Merge points Integrate points, such that any points within 1 m of each other become one point Create ...
2
votes
3answers
268 views

Simple script in ArcPy to analyze building proximity to restaurants

I am trying to make a script that will go through buildings in a shapefile row-by-row and do a count of points within .25, .5,...1 mile of it. The other points are restaurants. import arcpy ...
0
votes
1answer
493 views

How to create a report of all feature classes in a geodatabase?

I am not getting any response from this script and no error displayed at all I am writing this script to help me display the feature classes in my geodatabase Here is my script import arcpy ...
1
vote
2answers
502 views

UTM coordinate conversion to Geographic coordinates

I have about 500 separate files containing GPS points in UTM coordinates from multiple zones. I am looking for a simple and fast python or Php script that i can use to carry out a batch conversion ...
0
votes
2answers
779 views

trouble with UpdateCursor where clause in arcgis 10.1

I'm trying to use UpdateCursor in arcpy, but the where clause I'm using seems to be causing trouble. However, when I open up the table in ArcMap and use Select By Attributes with the exact same clause ...
4
votes
2answers
1k views

arcgis python script to tool issue

I have a script to investigate mxd's and save them as lyr symbology/kmz and sld which works fine when run from the .py but does not run when used as a tool from arctoolbox. I have tried ...
2
votes
1answer
1k views

Building a Polygon from an array of points in Arcobjects and C#

I have seen this code in Arcpy which is used to create a Polygon from a string of Points(X , Y).Can you please let me know how I can us something like this which can generate polygon from an array of ...
1
vote
1answer
195 views

UpdateCursor to insert DDM values from a layer in WGS84?

I have a layer in WGS84 (Geographic, DD) that I need to label in DDM (Degrees Decimal Minutes). I need to calculate within an arcpy UpDateCursor, a label field with DDM in it. I saw that you can run ...
7
votes
1answer
492 views

How to simulate moving vehicles?

I have a point layer (stored in SQL Server 2008) that is being served up by a map service in ArcGIS Server 10.1. I am consuming this service in a web client. Lets say the points are boats out at ...
1
vote
0answers
49 views

Remove a Layer using Arcpy [duplicate]

Possible Duplicate: How can I remove a feature layer in an Arcpy Script This question could seem too stupid, but i'm struggling with it, and it cannot work. I have an mxd file containing ...