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

learn more… | top users | synonyms

1
vote
1answer
323 views

No such file or directory PERMANENT\\MYNAME from Python+Grass?

I have an existing Python script that processes raster images with Gdal / Numpy. Now I want to extend the script with Grass. The python script is developed on Windows 7 with Eclipse/Pydev. The script ...
1
vote
1answer
781 views

How to make offsetting points perpendicular to a line (without ET GeoWizards)?

So I'm trying to create offsetting points perpendicular from a line and have run into a roadblock in Arc 10.1. I have the ability to use the ET GeoWizards tool 'Points Along Polylines' but the tool ...
1
vote
2answers
131 views

Missing lxml in QGIS 2

I made a QGIS plugin in QGIS 1.8 doing a lot of XSLT transformation and other XML handling with the library lxml. After upgrading to QGIS 2.0 this plugin does not work anymore: "ImportError: No ...
1
vote
1answer
322 views

Joining table data to features in QGIS?

I am trying to make a map using QGIS but I cannot join table data to features in QGIS. In ArcGIS for Desktop you just open the folder and then join the tabular table with the spatial data table. ...
1
vote
1answer
252 views

Help with field calculator in Python script

I am getting a syntax error in my script but I know from testing it in ArcMap attribute table, the syntax is fine. Anyone have any idea why this code doesn't work? I see that a search cursor has been ...
1
vote
2answers
163 views

SUDS (SOAP) from the Python console in QGIS

I´m trying to install a SOAP API called SUDS, on a Windows 7 OS, to be able to run SOAP from the QGIS Python console and pyQGIS/Python scripts. The only Python I have installed is the one comming ...
1
vote
1answer
858 views

Linux Client for OpenGTS server

I've installed an OpenGTS server and successfully linked it with the GPS2OpenGTS_Pro application for android. The buses I'm tracking offer 3G with a wireless AP, however whenever the bus stops, the ...
1
vote
1answer
233 views

how activate qgis features selection toolbar in the main window

How can i activate and desactivate qgis features selection toolbar in the main window using a signal in a python plugin?
1
vote
1answer
188 views

QGIS Python Composer Attribute Table has no content

I post 2 Month ago the same question. So I try it a second time with more code. My Problem still is that I add at the composer a attribute table and in this table there is no content. My Code: ...
1
vote
1answer
480 views

How identify Layer name when removing it from legendInterface qgis?

I am trying to connect the removing layer action with a slot for doing some processing after that. I already try this: QObject.connect(self.iface.legendInterface(), ...
1
vote
1answer
264 views

Is it possible to move/shift an annotation to a new XY using Python?

Real quick question, I was wondering if it is possible to move/shift an annotation to a new XY using Python.
1
vote
2answers
279 views

How to recode and recalculate Field Values using ArcPy?

I am trying to figure out how to do several calculations through python and the arcpy set. I have an large dataset (7+ million records of individuals), and I am trying to code a value of 1 that ...
1
vote
1answer
289 views

Creating Polyline from GML using PyShp?

I have a problem in creating some polylines in one Shapefile with PyShp 1.2. The plan is to read a GML file containing LineStrings and create a shapefile. The theory is clear, but the realworld is ...
1
vote
1answer
260 views

GDAL and Python: How to “pad the extent” or otherwise handle band.ReadRaster() for area falling slightly outside the image bounds?

In a nutshell, I'm trying to create a bare-metal tiling utility using GDAL and Python. As you can see in the graphic below, which shows the perimeter of a raster and the OSM-structured tile index, ...
1
vote
1answer
298 views

Buttons (Ok, Cancel) disappear in “Apri Modulo” from Attribute Table in QGIS 2.0.1

QGIS 2.0 has changed the visualisation of a form opened from the attribute table: instead of opening the form in a separate window, the form is opened in the same one. This is not a problem, but all ...
1
vote
1answer
680 views

issues with updating data source, script runs but nothing happens, arcpy

I have seen many questions posted that are similar to mine but still havent found the answer so figured I would post my script. I want to change all the data sources found in all mxds in a location to ...
1
vote
1answer
87 views

CalculateField_management

How to put the field from arcpy.GetParameterAsText() into the expression here: CalculateField_management(in_table, field, expression, {expression_type}, {code_block}) Now it is like ...
1
vote
1answer
366 views

SetColorInterpretation() for a GeoTiff using GDAL not working

I have a single band image which I would like to copy to a 3 bands of a new image and set the ColorInterpretation to red, green and blue respectively. I have tried two approaches, one using the GTiff ...
1
vote
1answer
184 views

trouble deleting data in an fgdb using python

I am trying to use delete_management to delete files in a gdb based on whether or not they are in a list. I keep getting an error with the delete_management tool that says the file either does not ...
1
vote
1answer
401 views

Select a single entry using SearchCursor and create variable

I am trying to select a single entry of a floating point entry in a dbf table that contains 9 entries (sampled from a raster image), some of which is NULL using SearchCursor. I want to select one of ...
1
vote
1answer
426 views

How to correctly use LIKE in the code block of a Reclass expression in ModelBuilder Calculate Field

I have a Reclass expression that works when i am search for single instance of a data field. I also wish the Reclass to work with a SQL type LIKE selection with Wildcards. e.g. I need to reclassify ...
1
vote
1answer
447 views

Python Field Calc for Document Hyperlink

I am trying to create a script that will hyperlink to a .tiff or .pdf. These files are stored in one folder on a shared server. I want the script to look in a field: 'PLAT_IMAGE', which has the plat ...
1
vote
1answer
655 views

remove whitespace Python code results in odd character - Field Calculator

I need to remove whitespace from the end of a string in a field in ArcMap. I tried first the VBA function RTrim, but whitespace still remained. I thought maybe the whitespaces were tabs, so I tried ...
1
vote
1answer
1k views

QGIS 2 Installation on MAC OSX - couldn't load plugin 'processing' [duplicate]

New installation of QGIS running on Macbook Pro OSX 10.8.4 - this comes up on startup. I urgently need this fixed!!! I have a project due in 10 days that I desperately need QGIS for. Thanks for the ...
1
vote
1answer
967 views

Subquery a list in select layer by attribute management using python

I am new to python and having trouble with my script. I want only the records from the COMTRS field (of the pur_dbf_view) that match values from the ComtrsList to be selected; however, I am getting ...
1
vote
3answers
1k views

How to use gdal module in python

I am trying to import gdal modules from osgeo installed in my win64x machine but I get the following error: Traceback (most recent call last): File "", line 1, in from osgeo import ogr ...
1
vote
1answer
150 views

How to iterate through maps & add new layer to data frame and legend of each using ArcPy?

Newbie for Python and wondering if the following is doable. Problem is like this: I have two sets of data: one mxd file for each of multiple cities (all stored in the same folder) containing ...
1
vote
1answer
746 views

Failed to convert polygon to raster

I have two steps here. First select layer by attributes. Second convert polygon to raster. It failed when it goes to second step and kept giving me error 999999: Error executing function. I pasted my ...
1
vote
1answer
216 views

QGIS Extend Toolbar (GUI) Button Functionality via Python Plugin?

Is it possible to piggyback onto the QGIS split method via a python plugin? Are toolbar buttons accessible via the python API? This looks like the class that I need to access. Access ideas? ...
1
vote
2answers
305 views

Optimising Min/Max temporal raster search in python/gdal

I need to search across ~100 1200x1200 raster tiles and produce a min and a max raster. Along the way i also want to exclude values that are over 1 or less than 0. What would be the quickest method to ...
1
vote
1answer
593 views

How to avoid setting env.workspace and other paths/settings all the time

I have some scripts that are constantly setting env.workspace of arcpy. Usually, I have a caller script(script1.py) that may call some other script (script2.py). I've created a file globals.py with ...
1
vote
1answer
184 views

Dan Patterson's bounding containers

I used a toolbox by Dan Patterson () and the problem is that the new shapefile does not contain any field from my original shapefile and this is a problem because I can't join the two layers based on ...
1
vote
1answer
7k views

arcpy.env.overwriteOutput = True, not working for some reason

AOI_test = "AOI_test.shp" arcpy.env.overwriteOutput = True for i in loc_list: AOI = "AOI_" + i + ".shp" arcpy.Select_analysis("locality", AOI, " \"LOCALITY\" = '%s'" % (i)) ...
1
vote
1answer
447 views

Problem loading PyQGIS

There is a problem on my system when starting QGIS. I get this error. I am running openSuse Tumbleweed 64bit and openSuse 12.3 64bit. Same problem on both systems. Couldn't load PyQGIS. Python ...
1
vote
2answers
49 views

Convertfeaturestographics Tool or Program

Problem : With over 19 feature classes in our dataset, we need to convert all these featureclasses to graphic . But to do it programmatically, we searched the resources but could not find a Python ...
1
vote
2answers
781 views

Convert 3D WKT to 2D Shapely Geometry

I have the WKT of many linestrings which contains three dimensions, however my script only requires a two dimensional linestring and I therefore want to discard the third dimension. My current code, ...
1
vote
1answer
237 views

Comparing field values to update new field using ArcGIS for Desktop?

I am currently doing an analysis in ArcMap 10 using python. I have two shape layers, one is a point layer and the other one is a line layer. The point layer have attributes for point's unique ID, as ...
1
vote
1answer
304 views

Can I append to different tables using ogr2ogr?

I have been through many related questions and links but I am still confused as to how/if this is achievable. So, I have defined tables in my postgis database and I would like my ogr2ogr commnand to ...
1
vote
1answer
1k views

Attribute error:'NoneType' object has no attribute

I tried to run a python script for getting the coordinate system of a feature/shapefile as follow >>> import arcpy >>> from arcpy import env >>> ...
1
vote
1answer
92 views

Get the ID of polygon in edition sessions of QGIS?

I did a Qt custom form for QGIS which contain a QlineEdit that must get the ID of the current polygon in edit session. For example, I start edit sessions I draw 3 polygons when the Qt form is opened ...
1
vote
2answers
2k views

Using File Geodatabase with Null values in Field Calculator of ArcGIS Desktop 10.0?

I want to use the field calculator to get the sum of a couple of columns. The problem is that some of them has Null Values. I am not able to find a solution. I tried this Python functions: stack( ...
1
vote
2answers
108 views

To select one stream segment at a time for processing

I have attached my stream order network image. I have five different order streams. There are several segments in each order. Now my problem is to select one segment of stream at a time for the ...
1
vote
1answer
447 views

Looking for PyQGIS Syntax Examples/Guide

I am a long-time user of arcgis with intermediate experience python scripting for automation of geoprocessing workflows. I am moving towards using QGIS on the regular and I would like to dive into ...
1
vote
1answer
116 views

How to reach a field value of a record in field calculator in ArcGIS 10.1

I have two fields showing number of people in two age groups "young" and "old". these people also live in a cell (point) whose distance to a specific facility is calculated. then I categorized these ...
1
vote
1answer
258 views

Python GDAL: find out spikes and pits in DEM

I'm working with on a DEM (Geotiff) in Python GDAL, and I'd like to find out the spikes or pits in my terrain. I have no idea how to proceed, does anyone have good algorithm to help me out? Thanks, eo ...
1
vote
1answer
551 views

spatialite.dll with Python and QGIS - the specified module could not be found

I'm having a bit of a nightmare getting to the bottom of this DLL loading problem. The stand alone script works absolutely fine but the exact same code does not work within QGIS. import sys from ...
1
vote
1answer
88 views

ArcGIS 9.3 geoprocessing service output consideration

I'm developing geoprocessing service which do few processes with geographic data. I would like to get somehow geometry of those data and use it in my web aplication (JS ArcGIS API). Now I'm wondering ...
1
vote
1answer
179 views

Creating prepared geometries with OGR from Python

Is it possible to create a prepared geometry object using the Python SWIG geos.ogr module? It seems that Shapely and GeoDjango both have this functionality, but I can't see any mention of it in the ...
1
vote
1answer
122 views

How to Average neighboring county data and store in original?

I have data for several rain stations, i have averaged the data and given each county a value. Some counties have null values and I would like to pull the data from the all the bordering counties and ...
1
vote
1answer
160 views

Running a QC check for gaps between vertices on a polyline

I'm checking polylines to make sure power pylons were correctly extracted from imagery. Is there a way to find all of the gaps or missed pylons in the database? Currently, I'm manually making a ...