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

learn more… | top users | synonyms

1
vote
1answer
768 views

Is getting wrong attribute values from a feature in qgis

I make two polylines features(in my example both consists of two points) with the add feature tool. Then I (with code) add some attribute values on the first feature, then changes the geometry of the ...
1
vote
1answer
125 views

Selection on Feature layer (geoprocessing)

I have a feature layers with states and counties fields. I want to make a selection tool. Tool dialog should have input for feature layer and two drop downboxes for states and counties. When user ...
0
votes
1answer
317 views

MapProxy installation

I'm tryign to install MapProxy on a windows manchine. My hope is that I can install it and test it on my own computer before moving it to a server. At the moment I can seem to find mapproxy-util and ...
2
votes
3answers
2k views

“Dataset xxx does not exist or is not supported” using Table to Domain in Python

I have a directory of hundreds of *.csv files, containing code/description pairs for geodatabase domains. I'm trying to automate the creation of these domains using Python. If I manually run the ...
2
votes
1answer
878 views

Importing QGIS core into Python on OSX

I am interested in learning how to write standalone scripts using QGIS. An answer to my previous question directed me to the PyGIS CookBook which has the following instructions for importing the ...
6
votes
1answer
4k views

How to write standalone Python scripts using QGIS?

I've been learning how to use the Python Console in QGIS using references from qgisworkshop.org. I'm familiar with writing standalone scripts in ArcGIS and want to learn how to do the same with QGIS. ...
4
votes
2answers
856 views

Python - Check for number of shapefiles in a directory

I want to test: to see whether or not ONE AND ONLY ONE shapefile (which will be based on a filename wildcard) exists in a directory. Add these shapefiles to a list Use this list variable as an ...
1
vote
0answers
152 views

produce images with shapefiles and OpenStreetMap

I have a python file http://pastebin.com/jzwE6c6P which iterates over the features of a shapefile and renders a simple image by zooming to the bounding box of each feature. What I need is ...
1
vote
1answer
139 views

ArcServer Geoprocessing Service

I originally posted this in the ArcGIS forums, but I haven't been getting any bites. I've developed a set of ArcToolbox Python scripts, which I've been using on certain projects for clients. The ...
0
votes
1answer
227 views

ArcGIS Python Error Raster Domain

I´m always getting an Error with my Python-Code. Even though it is almost the same as on the ArcGIS Help Website. The Error occurs in line 19: Traceback (most recent call last): File ...
3
votes
2answers
2k views

Python in ArcGIS: How to use a variable as part of the output path

I´m trying to use a variable as part of the output path of a shutil command. Unfortunately I couldn´t work it out how to do it. Can anybody help? import arcpy import shutil Name = ...
0
votes
1answer
937 views

how to execute a python tool in ArcGIS 9.3

I have a problem executing the code below. The file is not found in split_row_0717.py Please kindly help any modification and thank you. The error said that Traceback (most recent call last): ...
2
votes
0answers
149 views

Why would an ArcGIS 10 Python custom tool fail without throwing a “failed to execute” or “completed script” message at the end?

I have written a custom tool in Python for ArcGIS that converts in batch SHP files to GML files. It processes one file at a time in a folder, file, or ZIP file and then moves on to the next. If the ...
1
vote
2answers
245 views

Python syntax error…cannot see the error!

I'm very new to python and have created a script for enabling a user to list file types in a workspace making use of the parameters function in ArcGIS so it's more user friendly. However I cannot get ...
3
votes
1answer
822 views

Pass a variable from Modelbuilder into a Python script

I'm new to modelbuilder and python. I have used modelbuilder to iterate through all rows in a shapefile (Points), process them, and produce a seperate output shapefile for each row. The filename is ...
4
votes
1answer
423 views

ogr2ogr when importing from fgdb and use in python

I want import data from my GDB to PostGIS. It works fine on some datasets (all records -data- is imported or nothing is imported) from a gdb but just doesn't import others. I can't find any ...
1
vote
0answers
498 views

Python batch text replace crashes some ArcGIS10 MXD on reopen

In an attempt to teach myself some Python, I am writing a script that will loop through a netwrok directory for all MXDs and when found, replace layout text elements with dynamic text element ...
0
votes
1answer
178 views

Qgis - Running SDA4PP [duplicate]

Possible Duplicate: How to install SDA4PP plugin for Kriging in QGIS? I'm trying to use the SDA4PP plug-in for QGIS but it doesn't work. The software says to me that I need the rpy2 plugin ...
3
votes
1answer
381 views

Python: shp file to GML using OGR

I am trying to convert a shapefile to GML 3.1.1 . I am using gdal 1.9.1 however the GML conversion it generates for a geometry feature is GML 2 and it also swaps the long/latitude coordinates. Are ...
5
votes
3answers
3k views

Select features by attribute if in Python list

I believe this will amount to largely a sql syntax question. Essentially, I am trying to complete a select by attribute in Python but based on the query of whether an attribute is present in a list. ...
5
votes
4answers
2k views

Exporting list of Feature Classes to CSV using ArcPy and Python?

I am successfully using the follow script import arcpy from arcpy import env import os env.workspace = ("WORKSPACE") fcList = arcpy.ListFeatureClasses() print fcList to export feature class names ...
2
votes
1answer
316 views

How to implent a “maketrans” python function on field calculator

i'm traying to implent python string translate function at field calculatore http://www.tutorialspoint.com/python/string_translate.htm in order to fix hebrew imported from cad. here is the code - def ...
7
votes
4answers
1k views

Visualization of satellite image - directly in python

Is there any way (a package or what not), to visualize a geotiff image directly in Python? I don't want to use ENVI or ArcGIS or anything else. Thank you in advance.
3
votes
3answers
2k views

Create an ArcCatalog OLE DB Connection using Python

Is it possible to create an OLE DB connection (*.odc) to a database in ArcGIS 10 , but using Python instead of the ArcCatalog GUI wizard? I don't need to necessarily create a file on disk, just make ...
3
votes
1answer
449 views

Need help translating small code block from VBA to Python

I need help from someone to translate a small piece of code from VBA to Python, due to the fact that the company I am working for has upgraded from ArcGIS 9.3.1 to 10.0 and VBA is no longer supported. ...
3
votes
3answers
734 views

arcpy.Exists not working within standalone script

I have the following code. I want to see if a layer name exists within a map document, not if the shapefile exists in the directory. If I copy paste into the python window within ArcMap works fine. ...
6
votes
3answers
3k views

Raster: How to get elevation at lat/long using python?

I was wondering if anyone has some experience in getting elevation data from a raster without using ArcGIS, but rather get the information as a python list or dict? I get my XY data as a list of ...
5
votes
2answers
791 views

rpy2 installation on Mac OSX. A still unresolved problem on StackExchange and rpy-list [closed]

following lgautier's advice on rpy2 installation on Mac OSX, I posted my request on rpy-list and got in touch with Yair Benita who said he could only install rpy2 through his default Mac OS X python ...
12
votes
2answers
7k views

How to run a simple python script for QGIS from outside (e.g. Sublime Text)?

I would like to run a few small and simple python scripts for QGIS (Mac) from "outside" of QGIS. With outside I mean in this context, either the normal os command line (terminal.app) or even better, ...
2
votes
1answer
280 views

How to manipulate OpenStreetMap schema to be useful in ArcGIS applications?

I have a shapefile of OSM data. I plan to use the data for an ArcEngine application, and I was wondering if there are any existing solutions to getting the data's schema into your typical GIS format. ...
9
votes
2answers
507 views

Generate near table for x number of neighbours using arcpy

There are 3 likely scenerios that I am trying to capture near distances for: An interchange subway station, which has 2 or more neighboring stations. That is, the station in question connects 2 or ...
20
votes
8answers
2k 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 ...
8
votes
3answers
429 views

Using ESRI geoprocessing services from a non-ESRI client (Python)?

I'm thinking it should be possible to consume an ESRI Geoprocessing service from a python script without invoking ArcPy or needing an ESRI installation on the client machine. For example I create a ...
3
votes
1answer
1k views

Add multiple fields in attribute table

How do I add in multiple fields in the attribute table? In the attribute table I have crop types such as corn, cotton, sorghum....etc (as shown image below), in square meters. and I want to generate ...
1
vote
1answer
1k views

SImple model works, resulting script doesn't

The goal is to convert an XY layer (from Excel) into a feature class. The "MakeXY" portion works flawlessly, the arcpy.FeatureClassToFeatureClass_conversion portion inevitably returns a 999999 "Table ...
3
votes
2answers
864 views

How should I go about calculating the centroid of several lat long points in python, and perl?

Calculating the centroid several time on a number of geographical points. I was wonder is there a perl or python module that could make my life easier when working with large datasets of lat long ...
5
votes
2answers
294 views

ToolValidator not doing anything

I have created a simple script tool which has a single parameter of type "String". I have written the tool validation to disable the input field (simply trying to learn tool validation). The ...
2
votes
1answer
262 views

Creating a model to run a complex query

I'm just a rookie when it comes to creating models in ArcGIS. I have two shapefiles from which I need to calculate an AVG and a MAX erosion rate for individual properties. The two shapefiles are: ...
1
vote
1answer
571 views

How to get a signal when the geometry to a line in QGIS is changed

I am working on a plugin in QGIS and want to get a signal when the geometry to a feature(in this case a polyline) in my layer is changed. For example if I use the node tool to drag one of the nodes. ...
1
vote
0answers
35 views

qgis.core error [duplicate]

Possible Duplicate: qgis.core import error I am new in quantum gis and python, I installed quantum gis 1.8 from osgeo4w installer, after I installed python 2.7 and started python shell and ...
6
votes
2answers
1k views

Creating a multispectral image from scratch

I want to make a multispectral image from cero to do some tests on it. Something really simple like 5 completely uniform bands with salt and pepper noise on them or a square of different values at the ...
2
votes
2answers
3k views

arcpy.Delete_management not deleting a geodatabase folder

This script runs fine the first time but fails when run the second time. The issue seems to be that the KMLToLayer_conversion statement creates a file geodatabase (no surprise) that subsequently ...
3
votes
0answers
76 views

Adding points to represent non-chosen locations

I am looking for a way to set up a discrete choice model in ArcGIS for foraging behavior of individuals, in a grid of 15 locations. To do that I need a point for every possible choice they could have ...
1
vote
1answer
582 views

rpy2 installation on Mac OSX

I'm desperatly trying and retrying to install rpy2 on my Mac OS 10.6 in order to run SDA4PP plugin on QGIS. My version of R is 2.14.0 and it was obviously compiled with the option --enable-R-shlib ...
1
vote
2answers
1k views

How to batch convert Shapefiles to GMLs?

I know how to do this within Quantum GIS but I have 30+ shapefiles that need to be converted to GML. Is there a Python script sample or plugin for Quantum GIS that I can use to convert my shapefiles ...
1
vote
1answer
748 views

Applying layer file not formating labels in ARCGIS 10

I'm applying layer files in ARCGIS 10 using the ApplySymbologyFromLayer_management command via a python script tool. The symbology part works fine but the lables are not formatting. It is my ...
7
votes
3answers
426 views

Remove username and password from saved arcgis layer (.lyr) files?

How can one remove the saved username and password from arcgis layer (.lyr) files? A scripted solution preferred but even a point and click method will be welcome.
0
votes
2answers
2k views

Replacing NULL values in geodatabase table?

How do you update NULL values within a geodatabase table using the ArcGIS Field Calculator (service pack 4) without changing other values to NULL? I've tried the suggestions on this previous ...
3
votes
2answers
2k views

How to perform volume calculation in QGIS

EDIT 07/12/12 Ok, meanwhile I came to another problem I want to discuss. I just tried around with the volume calculation with some layers and came to a point where I receive the following error. ...
5
votes
2answers
2k views

How to return individual address components (city, state, etc.) from GeoPy geocoder?

I'm using GeoPy to geocode addresses to lat,lng. I would also like to extract the itemized address components (street, city, state, zip) for each address. GeoPy returns a string with the address -- ...