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

learn more… | top users | synonyms

68
votes
5answers
10k views

Accessing ArcObjects from Python?

I would like to be able to script some things that are not 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 ...
45
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 ...
43
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 ...
43
votes
13answers
9k 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)
36
votes
10answers
21k 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 ...
34
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 ...
33
votes
1answer
4k 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 ...
29
votes
3answers
1k 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?
28
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 ...
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 ...
25
votes
9answers
4k 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?
22
votes
4answers
650 views

Recommend topics to be included in a Computer Science for Geospatial Technologies course

I will be instructing a course at the local university titled Computer Science for Geospatial Technologies. This is an introductory course meant to introduce computer science concepts to geospatial ...
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
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 ...
21
votes
1answer
697 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
3answers
4k views

Simple thematic mapping of shapefile using Python?

I wish to visualize geographical data in Python, without using ArcGIS/ArcPy, and make a map. On the internet I found how to make a thematic map using Python: Here is some code that I tried: ...
20
votes
2answers
3k 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 ...
19
votes
9answers
5k 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 ...
19
votes
4answers
3k 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
538 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
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 ...
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
13k views

Defining projections for multiple shapefiles in ArcMap 10?

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
7answers
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 ...
18
votes
6answers
4k 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
3answers
288 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 ...
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
7answers
6k 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 ...
16
votes
4answers
857 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 ...
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
10k 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
574 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
3answers
3k 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 ...
15
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
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
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
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
3answers
7k views

Listing all feature classes in File Geodatabase, including within feature datasets?

From python how can I build a list of all feature classes in a file geodatabase (*.gdb), including inside feature datasets? The standard example only lists feature classes at the top level of the ...
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
591 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
1answer
1k views

Voronoi polygons that run out to infinity

I have been working on implementing the voronoi.py script (Bill Simon's translation of Steve Fortune's code). According to the QGIS link it is basically the same code that I am working with, but the ...
14
votes
3answers
6k 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
1k 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
4answers
7k views

Is it possible to use Arcpy in ArcGIS 10 to zoom to a selected feature?

The answer to this may be a simple yes or no, but I'm hoping that someone is aware of a way to zoom to the extent of a selected feature using the ArcPy modules in ArcGIS 10.
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
339 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 ...