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

learn more… | top users | synonyms

1
vote
3answers
118 views

How to prevent ArcGIS SOC from locking Oracle tables?

I have a python geoprocessing that performs CRUD operations on feature classes and oracle tables. Sometimes, when handling Oracle tables, ArcGIS SOC gets hung and locks the Oracle table. I need then ...
1
vote
1answer
139 views

Flow Direction Arrows in python

Any help would be appreciated. I am trying to write a python script to determine flow direction on a water pipe network. I have calculated the mid point of each section of pipe and created a point ...
1
vote
1answer
52 views

Unsupported operand error writing to file (Python, arcgis)

In the code below, I get a "TypeError: unsupported operand type(s) for +: 'NoneType and 'str'" on the f.write line. If I don't concatenate, it runs fine, but all the layer names run together. I ...
1
vote
2answers
159 views

Alter validation in ArcGIS script tool

I have a script tool in ArcGIS 10.1. Some of the parameters are optional and if they are left blank, will not be processed. They are numerical parameters and I want to enforce this in the tool, so an ...
1
vote
1answer
100 views

How to reset ObjectID after running Delete_Features on SDE feature table?

I have a python script that deletes all features on a SDE feature table and then inserts new features to it. I noted that the ObjectID keeps incrementing from where the last feature was with before ...
1
vote
2answers
305 views

Programmatically load composer from template and generate atlas using pyQgis

I Am trying to build a plugin to load a print composer from file, generate an atlas and export to image. So far I have been successful in loading the template and exporting it to image. I have been ...
1
vote
1answer
158 views

Automatically determine polygon overlap 'islands'

I have a shapefile with many polygons. Some partly overlap with each other, some are not overlapping. I'm considering a polygon to be overlapping given a minimum area of overlap. 'Islands' of partly ...
1
vote
1answer
126 views

Python code intended to merge files in subdirectories… not producing merged result

The short python code below is intended to merge a series of files (GIS files) which are contained in a series of subfolders. import arcpy import sys import os PointsMerged = ...
1
vote
2answers
85 views

how to identify qgsvectorlayer area?

I need to identify the area from Qgis qgsvectorlayer anyone have an idea how to do that in python ?
1
vote
1answer
124 views

Python/GDAL: Best way to read in raster for use in A* search algortihm

I want to create a least cost path program with Python and GDAL since I couldn't find any open source cost path additions for use in Python. As recommended here the best approach is to use A* ...
1
vote
1answer
144 views

pulling an excel sheet with =rand(between) in a Python while loop, and exporting results as .dbf

To preface my question: I am very new to stack overflow, and relatively new to Python. I am working on setting up a sensitivity analysis. I am working with 40 parameters that range from 0.1 - 1. My ...
1
vote
1answer
204 views

Connect not working for custom QGIS form

So I have a custom form for editting feature attributes. However, I can't seem to correctly disconnect and reconnect certain bindings. The init code is below and should work for any simple QT widget ...
1
vote
2answers
102 views

AML routines and python

I´m trying to use some AML files in ArcMap 10, but I have noticed that this option is not available for this version. Does anyone know or tried to "translate" the aml sequences to another language ...
1
vote
1answer
39 views

How to handle a UnicodeEncodeError with sampling tool?

I'm using qgis and I keep getting an error when using the point sampling tool, its keeping me from getting the sampling done. Does anyone has an idea what is it about? Thanks!
1
vote
2answers
133 views

Erase method using ogr

I'm trying to find the erase geoprocessing method as i am familiar with in ARC, but i can't seem to find it in OGR using Python. I have looked through the module ogr documentation but perhaps i missed ...
1
vote
1answer
130 views

Batch Aggregate Raster using Python

Trying to write a python script to batch Aggregate a bunch of different rasters. get a Parsing Error Syntax error for line 11. # Batch Aggregate raster tool import arcpy from arcpy import env from ...
1
vote
1answer
417 views

importing osgeo module in ubuntu 10.04

I have problem with importing "osgeo" module in ubuntu 10.04; I have installed GDAL 1.7 from source ( 1)./configure 2)make) however, still in python I cant import osgeo module. I appreciate any hints. ...
1
vote
2answers
167 views

How to modify the results of a geological dataset from vertical to horizontal?

I have a 3-D point shapefile of a geological fault dataset consisting of x,y, and z columns. I need to create a raster dataset from this point dataset. I have been trying to do this in ArcGIS; ...
1
vote
1answer
85 views

Create a plugin in QGIS-

i want to develop a plugin in QGIS to access to my database in postgres : i want to import a file.sql that contains my SQL Code in a textbox , and execute this code to assign myd database. Any ...
1
vote
1answer
322 views

Python GDAL/OGR: WGS84 & meters units

I'm dealing with shapefiles projected in: GEOGCS["GCS_WGS_1984", DATUM["WGS_1984", SPHEROID["WGS_84",6378137,298.257223563]], PRIMEM["Greenwich",0], ...
1
vote
1answer
328 views

How to add layer/raster with specific position in the QGIS layer list?

I use addRasterLayer(rast,'Name') but this adds the raster to the top. It is possible to set position when I add raster at once? Is it possible??
1
vote
1answer
566 views

Python GDAL: degrees to meters without reprojecting

I am trying to get senseful results in my Python script. I want to measure distance between features in a shapefile. I'm working with the SRS: GCS_WGS_1984, so my units are in degrees. But for the ...
1
vote
1answer
87 views

Setting More Than One Workspace

I have a number of tables that contain known values in a field. For example, I have a soil type table with one field in it. That field contains a list of known soil types. I have another table that ...
1
vote
2answers
782 views

How to Add Shapefile with Symbology from Layer File to ArcMap MXD using ArcPy/Python?

Say I have a Shapefile: C:\DATA\points.shp A layer file: C:\SYMBOLOGY\symbology.lyr And a map document: C:\MAPS\map.mxd How can I add points.shp to map.mxd with the properties of symbology.lyr ...
1
vote
2answers
724 views

What might cause invalid syntax from ArcPy with Raster Calculator and Multiple Rasters?

I am having trouble for writing script in Python (ArcGIS 10.1). The task is generally divide each raster by 100. I have many of these raster files.... So what I've done is the following: from ...
1
vote
1answer
653 views

Reverse geocoding to get city, state, country data separately?

I have longitude and latitude data. I need to reverse geocode to get city, state, country data separately. I have checked google service. Google provides complete address to a micro level. ...
1
vote
2answers
205 views

Weird File Path Returning from Print Statement Causing ERROR 000732

I have created a python script in ArcGIS 10.1. My first parameter type is a 'Feature Layer' set to as a multivalue input. I was running my script quite well off of data from one of my drives (my ...
1
vote
1answer
96 views

How to save ArcGIS process output to variable?

I've created script in Python for ArcGIS that simplify Line, and make buffer from processed line. input = "input.shp" name = "bord" buffer = "buffer.shp" gp.SimplifyLine_management(name, input, ...
1
vote
1answer
131 views

How to begin with tool development for GRASS gis or QGIS GRASS

I wanted to begin with customized tool development in Grass GIS or QGIS grass. How should i begin in to develop the tool. I search a lot in google search engine for begin with tool development in ...
1
vote
2answers
649 views

Where exactly are qgis.gui and qgis.core located?

I'm trying to create a standalone qgis app using pyqgis, i'll be deploying it by copying the install folder of qgis and source folder of my app, and so for the testing purposes i copied qgis install ...
1
vote
1answer
411 views

How to refresh a Combobox Add-in in ArcGIS 10.1

I need to refresh the value in the combobox after an event from other tool in the same add-in (ARCGIS 10.1. Python). I've changed the value of the combobox with the code: combobox.value = val and I ...
1
vote
1answer
500 views

how to install networkx python in QGIS

How to install and how to compile networkx python on QGIS? I always get an error that no module named networkx in the console of QGIS I copied the file networkx in C:\Program Files\Quantum GIS ...
1
vote
1answer
227 views

.Net to Python - ArcGIS Add-in

Background: I have been tasked with porting a 9.3 .NET toolbar to ArcGIS 10 / 10.1. I am a dyed in the wool Python programmer and, while digging through someone else's .Net is interesting, it isn't ...
1
vote
2answers
436 views

How do results from a Python script get added to an ArcGIS map? [duplicate]

I have a Python script for ArcGIS that makes a new feature class. I can add this to ArcGIS as a new Script (without parameters), however the resulting feature class is not automatically added to the ...
1
vote
1answer
954 views

Python/Arc10- Loop 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 ...
1
vote
1answer
447 views

Raster operation with grass.mapcalc

I need to iteratively add each raster map of viewshed analysis obtained from a series of single observer locations. For this i used grass.mapcalc with Python (GRASS 7 for Windows). However, my ...
1
vote
1answer
104 views

arcpy.sa.CostDistance from Python gives error about number of args but executes fine through Toolbox

I am attemping to call arcpy.sa.CostDistance to calculate the cost distance to a source point as well as generate the optional Cost Back link raster: arcpy.sa.CostDistance("input", cost, "costDist", ...
1
vote
1answer
103 views

keeping the coordinate system of raster files in the resulting raster file after operation with numpy

I'm trying to read as array two raster files using ReadAsArray in GDAL/python, perform some map algebra operation on it using numpy and then write the resulting raster file in GTiff format using ...
1
vote
1answer
2k views

How can I fix “ImportError: No module named qgis.core”?

First of all, I'm using Python 2.7.3, QGIS 1.8 (Lisboa) on Windows 7 pro 64 bits. Now let's go to the actual question: I have written some code (Python) that works well within the QGIS built in ...
1
vote
1answer
335 views

Can I use arcpy.Exists for domains?

A script I made creates domains within a selected geodatabase. I need it to not create the domains if they already exist because if they do, it gives an error saying invalid domain name. Is there ...
1
vote
1answer
282 views

Edit Shapefiles Attribute data in GeoServer Programatically

I'm rendering a shapefile using GeoServer and using OpenLayers library to render it in the web browser. Now I have created the option of editing the attribute data in web browser. I want the edited ...
1
vote
1answer
2k views

ArcGIS 10.0 \ arcpy - CalculateField_management : help with syntax for updating text in attribute table of feature classes

I am trying to add (ie "Author", "LastUpdated") to feature classes within a gdb and then populate each of those fields. I have been able to get my code to run properly for the numerical field but I ...
1
vote
2answers
82 views

Automating attribute completion of new polygons

Good Afternoon I am currently outlining property boundaries and then copying and pasting in the necessary attributes on a daily basis. I would like to speed up this process and remove the chance of ...
1
vote
1answer
566 views

how to get the projection from a vectorlayer in qgis?

Hi I am trying to set the projection on a raster to match that of a vector point layer. Thus I need to findout what is the projection of a give layer, to use it in the GDAL.Dataset.SetProjection() so ...
1
vote
1answer
1k views

Setting a query loop

I am looking to apply a Select By Location protocol to my data, but need to first query individual IDs in my target and source layer (the same ID in each table, one at a time). How do I loop through a ...
1
vote
1answer
128 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 ...
1
vote
2answers
799 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
3answers
735 views

Update shapefile data source with wildcard using python

I am attempting to update a layer's data source in Arcmap using python for lyr in arcpy.mapping.ListLayers(mxd, "*", df): if lyr.name == "project_whl": ...
1
vote
2answers
386 views

FieldPyculator Plugin - How to Classify Fields?

Could someone tell me how to classify/populate fields with QGIS FieldPyculator Plugin? In the Attribute Table, I have a field named POPULACAO with population data: I want to apply a weight to ...
1
vote
1answer
223 views

ArcPy: Creating weekly-sum layers by summing field values from seven consecutive daily .dbf's

So I have 490 consecutive daily rainfall shapefiles/.dbf files in a single directory. Each consists of a uniform even-spaced grid of 220 points having uniform pointIDs, number of records, field names ...