Python is an open source interpreted programming language used in many GIS programs.

learn more… | top users | synonyms

67
votes
5answers
10k views

How do I access ArcObjects from Python?

I want to be able to script some things that aren't exposed via arcgisscripting or ArcPy. How do I access ArcObjects from Python? I'm working with ArcGIS Desktop 9.3.1 right now, but will be ...
44
votes
6answers
3k views

When to use ModelBuilder over Python scripting and vice versa?

I am new to Python scripting in ArcGIS but not new to ModelBuilder. I would like to know the benefits of Python vs ModelBuilder. When should we write Python script for GIS automation rather than ...
42
votes
10answers
3k views

Alternatives to using Arcpy

I seem to use ESRI's Arcpy site package for virtually all of my python geoprocessing. To ESRI's credit, these are an incredible suite of tools that can help accomplish a great deal. However, I would ...
41
votes
13answers
8k views

What are the best resources for learning GIS programming with Python?

In your opinion, what is the best book/site to learn Python with GIS goals in mind? By "best", I mean: not very long (book) easy to understand (book/site) good practical examples (book/site)
34
votes
10answers
18k views

How to install GDAL with Python on windows?

Can anyone please explain to me in step by step instructions how to install GDAL/OGR with Python on Windows. I have Windows Vista and I have tried following the information on the website and it does ...
33
votes
7answers
5k views

How can I effectively debug arcpy Python scripts?

I have written many Python scripts using arcpy in ArcGIS 10, and so far my only means of debugging is restricted to printing messages to the geoprocessing results window using arcpy.AddMessage(). Are ...
32
votes
1answer
3k views

How to smooth the polygons in a contour map

Here is a contour map for which all the polygons of levels are available. Let ask how to smooth the polygons keeping all vertices preserved in their exact locations? Indeed the contour is made on ...
28
votes
3answers
941 views

How to Share Open Source Python Code for ArcGIS?

My company just purchased ArcGIS software. I'll be writing scripts for ArcGIS in Python. Is there a community or open source project where this code can be shared?
27
votes
4answers
3k views

Performance of ArcGISScripting and large spatial data sets

I am currently writing a python script using the arcgisscripting module to process a reasonably large data set (~10,000 records in total) normalised over a small number of tables, 8 in total. The ...
27
votes
2answers
1k 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 ...
22
votes
9answers
3k views

What are some resources for learning ArcPy?

I would like to learn ArcPy, but I do not know quite where to begin. Does anyone have any good advice on where I should start to learn ArcPy?
21
votes
9answers
2k views

How to easily shift all features in a vector dataset?

Let's say that I put together a Shapefile and all the features have their vertices shifted by a constant amount. What's the easiest way of shifting all the features (hence the (x,y) position of their ...
21
votes
1answer
631 views

What does the adoption of Python by NVIDIA for GPGPU mean for GIS?

Today NVIDIA announced support for the Python language on its flavor of GPGPU (CUDA). Manifold GIS uses CUDA to enable some accelerated raster operations but it is not a programmable environment and ...
20
votes
2answers
2k views

Python Efficiency — Need suggestions about how to use OGR and Shapely in more efficient way

I'm looking for some suggestions about how to make my python code more efficient. Normally efficiency doesn't matter for me but I am now working with a text file of US locations with over 1.5 million ...
20
votes
5answers
2k views

OpenSource Remote Sensing Tools for Classifying Roofs

with envi image processing and classification tools, you can get roofs from images with some spectral value and then you can convert it some vector data for your app. in python with OpenCV which have ...
19
votes
4answers
2k views

Python Script examples for geoprocessing shapefiles without using arcpy

I would like to use a Python script that is not based on arcpy to do things like query a shapefile by attributes, create new layer from selection, and calculate areas of a polygon and convert ...
19
votes
6answers
523 views

Python for GIS on a thumb-drive

I'm looking at putting together a light Python install on a thumb drive that I can take to client offices and do some basic GIS processing. I'm thinking of installing the following: PyScripter ...
18
votes
9answers
4k views

How do I develop my GIS programming skills?

I would like to develop my GIS programming skills, where do I start? People say learn C++ or Python but where can I learn this in a geographic context? Tutorials or anything would be very helpful, as ...
18
votes
7answers
1k views

Value of a Python programming course

I am considering upping my programming skills by taking a python geoprocessing course through ESRI. Before I part with the hefty registration fee, I would like to get your opinion on the value of 24 ...
18
votes
6answers
12k views

How can I define projections for multiple shape files in ArcMap 10 at once?

I have over 100 shape files that don't have .prj file and thus when I bring them into ArcMap they show the coordinate system as unknown. I know all of the shape files coordinate system is GCS WGS ...
18
votes
6answers
3k views

Has anyone found any informative documentation about ESRI's ArcPy Python module?

Has anyone found any informative documentation about ESRI's ArcPy Python module?
18
votes
4answers
1k views

Run a Python Script when opening an MXD?

Can anyone tell me how to accomplish this? I want a Python script to run on opening the MXD which would pull an excel worksheet into a GDB and refresh the map. I only want this to happen in this ...
17
votes
11answers
3k views

What are the Python tools/modules/add-ins crucial in GIS?

With ArcGIS 10, Python has become the de-facto scripting language for ESRI. While leading Open source software like QGIS, GeoServer, PostGIS all supports Python. Thus it became important to know/learn ...
17
votes
2answers
3k views

Visualize shapefile in Python

I was searching the internet to see if it is possible to visualize geographical data in Python, without always opening ArcGIS and make a map (because I have a lot of scripts that uses arcpy). On the ...
17
votes
5answers
3k views

How to use ArcGIS functionality in Python without running ArcMap (e.g. separate editor/environment)

I'm trying to take the next step in programming ArcGIS with Python and see if its actually possible to run my script/code without having to load ArcMap and paste them into the Python window. I imagine ...
17
votes
6answers
2k views

Is there a way to code-complete arcpy scripts using an external editor?

I have been scripting in Python for ArcGIS 10, and so far I have just been using Notepad++. I like how the Python command line interface code-completes arcpy functionality for you, showing you your ...
17
votes
3answers
267 views

Python literature relevant to QGIS

Python for ArcGIS is a book that I have been looking at. Does anyone know if this would be applicable in QGIS? I am not looking to write application/plugins, simply get better at understanding ...
17
votes
2answers
870 views

Crashing ArcGIS 10.1 Add-ins Using Multiprocessing

I would like to run a multiprocessing task from a python add-in tool. My issue is that the process keeps failing. Basically crashes ArcMap. Here is my basic code: def function(startOID, endOID, ...
16
votes
1answer
4k views

How to divide a polygon into specific sizes using ArcGIS?

I have several thousand irregularly shaped polygons in a shapefile. I want to be able to split each polygon into three areas, and to specify what the size of those areas (they sum to the previous ...
16
votes
3answers
9k views

ArcPy and running Python scripts (with parameters) within another Python script

A common coding pattern used in AML was to run an AML (with parameters) inside another AML. An application that I'm currently developing would benefit from being able to run a Python script (with ...
16
votes
5answers
481 views

How to buffer raster pixels by their values?

The pixels to the left represent tree locations and their associated crown radii (i.e. pixel values ranging from 2 - 5). I would like to buffer these raster pixels by their crown radius value. The ...
15
votes
6answers
4k views

ArcMap 10.0 Python Field Calculator, Find/Replace Double Quotes

I'm trying to use the Field Calculator (ArcMap (10)) to strip out double quotes in an address field (I didn't put them in there, believe me). I've tried many incantations but am still unable to even ...
15
votes
4answers
717 views

How are people using Python data structures and classes in Arcpy?

This question may expose my ignorance on programming but I'm curious about how people are using different python data structures within Arcpy. This page lists the data structures in Python. I ...
14
votes
4answers
1k views

The best language to program with GDAL

I'm going to start to create programs to handle geographical data from a PostGIS server, and going to use GDAL. According to your experience, with the best language to program with it? I can program ...
14
votes
3answers
2k views

Port “Producing Building Shadows” Avenue code to ArcGIS 10

Whuber provided an answer here Producing building shadows? which required using Avenue code. Any idea how to make it work in Arc 10? Thanks in advance.
14
votes
6answers
4k views

Generate points that lie inside polygon

I have polygon feature and want to be able to generate points inside it. I need this for one classification task. Generating random points until one is inside the polygon wouldn't work because it's ...
14
votes
7answers
5k views

Nearest neighbor between a point layer and a line layer

I've asked this question several times on stackoverflow and irc between #qgis and #postgis and I also tried to code it or implement it my self in postgis with no real answer. Using programming (most ...
14
votes
3answers
2k views

Can i use ArcPy to get layer symbology?

Hello all Since ArcGIS 10 comes with ArcPy package, i'm wondering it is possible to use ArcPy functions to get Symbology (i.e color, width...) of a layer? Thanks in advance
14
votes
6answers
2k views

Pure Python Library for Geometry Operations

Does anyone know of a pure Python (no C or Java dependencies) library for doing geometry operations such as buffer, union, intersects, etc? I'm looking for something that Google AppEngine compatible. ...
14
votes
3answers
584 views

Ecological geospatial conundrum

I am looking for a different, more elegant solution to a spatial statistics problem. Raw data consists of an x-y coordinate for each individual tree (i.e. converted to a point .shp file). Although ...
14
votes
4answers
6k views

How to add an attribute field to an existing Shapefile via Python

I have a Python script that adds an attribute field to a Shapefile if doesn't exist. This is easy to do with ArcGIS (graphically or via Python), but I'm looking for something that doesn't depend on ...
14
votes
3answers
2k views

How to call gdal_translate from Python code?

Is it possible to use some gdal API to call gdal_translate from Python code? I do not mean simply executing the gdal_translate.py from the file system, but rather call it somehow in code so I do not ...
14
votes
2answers
3k views

How to find the angle between intersecting features in two featureclasses?

I have two intersecting line featureclasses. I want to find the angle at each point of intersection using ArcGIS 10 and Python. Can anyone help?
14
votes
3answers
5k views

What's the easiest way to install GDAL and OGR for Python?

I am developing some code in Python, and I want to use the GDAL/OGR python bindings. What is the minimum I need to install in order to use the GDAL and OGR python bindings? What is the easiest way to ...
13
votes
4answers
955 views

Python module to delete SHP features (without Desktop GIS installed)

I have a piece of software (not Arc) that runs nightly on a non-production machine which updates shapefile features from an external database. Periodically I would like to delete all of the features ...
13
votes
2answers
2k views

How to smooth/interpolate a raster in python using GDAL?

This is my first post so please feel free to critique where necessary. Background: I am developing in Python and using GDAL from OSGEO to manipulate and interact with rasters and shapefiles. ...
13
votes
5answers
328 views

Python Development Project - Team working

We have a development project in Python (ArcGIS 10). This project involves a mixture of toolboxes, map templates, layer files, file geodatabase templates (acting as templates being imported into a ...
13
votes
1answer
262 views

Watermarking photos using their geotag and create a shapefile

I have geotagged photographs and I would like to place a watermark of the photos location on the front for easy reference as well as creating a shapefile from the coordinates. Does anyone know of any ...
13
votes
1answer
2k views

How to have a python script self terminate in ArcMap10?

I have tried sys.exit, but it doesn't seem to work in ArcMap. Anyone know how to do it?
13
votes
2answers
2k views

Add a new group layer with python ArcGIS 10

Does anyone now how to add a group layer with python can I use arcpy.mapping.AddLayer but surely this is only for an actual layer as opposed to a group layer. so far I have this import arcpy mxd = ...