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

learn more… | top users | synonyms

6
votes
1answer
288 views

How to compute Straight Skeletons using Python?

Is there a Python package which provides an implementation of a Straight Skeleton algorithm? I'm aware that the open source (C++) project CGALcontains an implementation but it seems like ...
0
votes
1answer
35 views

How to connect mouseclick to map canvas in QGIS?

How to connect mouse click to map canvas in QGIS using python script? I have two lines of code to connect mouse click to map canvas: button.clicked.connect(self.onClicked) ...
2
votes
1answer
56 views

Error with Python Script using Shapely

My professor gave us a basic Python script that demonstrated how Shapely works with a shapefile, however it's not working for me. Here is the code: from shapely.geometry import mapping, shape from ...
0
votes
1answer
59 views

How to trigger a QGIS action when a plugin button is clicked?

I tried calling the select free hand tool by below snippet of code. iface.actionSelectFreehand().trigger() I dnt have any idea how to call this when i am pressing a button in GUI. my gui is ...
1
vote
1answer
66 views

How to call default tool in QGIS inside plugin using python script?

I want to create a plugin which can draw irregular polygons in QGIS. For that, I want to call the Select features by freehand default tool inside my plugin. How can I do this within a python script?
0
votes
0answers
42 views

web2py - openlayers

I have used web2py and there is test.py under controllers which shows a map as below: and its code is: for url in [ 'http://dev.openlayers.org/theme/default/style.css', ...
0
votes
2answers
100 views

How to add XY point and update attributes with ArcPy 10.0

I would like to create a script tool that takes 3 parameters in ArcMap: Google maps coordinate (e.g. -33.876846, 151.215117) text string text string The coordinates would define the XY geometry, ...
1
vote
1answer
66 views

QGIS (2.6.1) Processing Toolbox InitGui error after changing /Users folder on Mac OSX

Using: Mac OSX 10.9.4 QGIS 2.6.1 I had previously installed QGIS and had everything running fine. My home directory was /Users/rowanbado, but for another application I had to add an ...
5
votes
2answers
154 views

ArcPad Checkout from python command line

I have been developing a script to automate my ArcPad checkin/checkout processes. My problem is that I am having trouble getting arcpy to recognize the ArcPad tools from the command line. From the ...
1
vote
3answers
62 views

How to return a unique value from table using Arcpy?

Using Arcpy in Python, I would like to return / print '0.15' from the following table: When I use the following code I get "(u'D', 0.20)" as my print statement in Python: import arcpy fc = ...
0
votes
2answers
76 views

Shapefile projection for Matplotlib Basemap

Preface: First time working with GIS data. I'm using python's Basemap library for overlaying data on maps. The tutorial I'm using includes a shapefile for London (london_wards.shp). I use the ...
1
vote
1answer
25 views

Creating ArcGIS tool that can run list of checks?

Is it possible to create a tool in Arcmap where by uploading a shapfile, the tool can run a various number of checks/tests (ie intersecting other shapefiles) and flags or highlights conflicting ...
1
vote
0answers
34 views

QGIS 2.6 SAGA Processing Algorithm, “Add grid values to shapes”, produces NULL Values

I'm using QGIS 2.6 Brighton on Windows with SAGA 2.0.8 installed using OSGeo4W. I have the same versions installed on OSX as well which is not having this problem. On Windows, I'm trying to extract ...
1
vote
2answers
162 views

Debugging 'module' object has no attribute 'SdeWorkspaceFactory'?

I am new to python, am debugging one of existing python code, where am facing an error "'module' object has no attribute 'SdeWorkspaceFactory". Earlier this code was working fine but suddenly does not ...
0
votes
1answer
67 views

SyntaxError: can't assign to function call, arcpy set parameter as text

I have a python script loaded into arcgis ModelBuilder, and when I run the model I keep getting an error when the script tries to run, at the line where I am setting the output as a text parameter. ...
2
votes
1answer
53 views

QGIS gets stuck when running script to automatically refresh layer [closed]

I have a QGIS layer that represents a set of links and nodes to show the streets of a city and the traffic speeds on each street. I've been trying to write a script so that if I change the speeds in ...
1
vote
1answer
52 views

How to exclude a certain attribute from being added to the Processing script output layer?

I have a working script to split a layer by field attributes and save the single features as files: ##[User scripts]=group ##input=vector ##class_field=field input ##output=output file from ...
1
vote
2answers
151 views

Using Python in the field calculator - if/else over multiple fields

I'm trying to work out how to populate a field depending on the lowest score across 6 other fields. I've read several other questions relating to if/else statements but I'm only just starting to learn ...
1
vote
0answers
49 views

How to set time field when generating a GPX track with Python OGR?

I want to generate a GPX file with Python OGR. In particular I want to generate a tracks (layer of features of OGR type wkbMultiLineString) My script is below. I get the error ERROR 1: No such field: ...
0
votes
0answers
42 views

Is there any way to create user login for single project in QGIS?

Is there any way to create user login for single project in QGIS? I want to track changes on database when users update features. I know that I can do this on database level but is there way to do ...
0
votes
0answers
29 views

Invoke PostGIS geocode function using Python

I have a PostGIS Geocoder built with using Tiger data. Using SQL, I am able to execute all database functions and queries. I want to use it with my Python program. One of the option would be to write ...
1
vote
0answers
30 views

How do I compute uncertainties in the positions transformed using Helmert transformation?

I am familiar with Python, MATLAB and Mathematica. My data is given by Cartesian coordinates (positions in X,Y,Z (meters), standard deviations XX, YY, ZZ (meters) and a correlation matrix (XY, YZ, ...
0
votes
2answers
45 views

Performing batch Join Field in ModelBuilder?

I have a list of 250 feature classes (X1, X2 X3, ...) which all have an individual field that I want to join to another feature class Y. The join can be established through a common field that are ...
3
votes
1answer
50 views

What is the replacement for 'setColorShadingAlgorithm' in QGIS 2.6?

I have been struggling with setting the colorshadingalgorithm for a raster layer in QGIS with no success for the past few days. The QGIS cookbook seems to be pretty outdated. Anyways, the code that I ...
1
vote
1answer
40 views

Getting a number from QLineEdit and passing it to the buffer function

I am developing a plugin which finds buffer. In that i am using lineedit for getting distance from the user and pass it to the buffer function. My current code throws an error "'QLineEdit' object has ...
1
vote
0answers
38 views

Pan Sharpening Quickbird Images in Python

I'm attempting to pan sharpen four band images in python with a higher resolution panchromatic band image. I have imported them using gdal and converted them to numpy arrays for the purpose of ...
1
vote
1answer
39 views

WFS, python and updating

I'm trying to develop a script, something that can be run every hour/day/week etc that will look at some shapefiles (initially downloaded from a WFS) compare them to the WFS and download and append ...
2
votes
0answers
58 views

How to Bulk “Add Selected” Attributes to a Relationship Class ~ 40000 Records

I have 2 Feature Classes (FC's) and 1 Relationship class. FC1 and FC2 share a common field with almost 40,000 matching records. For each matching record (i.e. when the matching records from FC1 ...
1
vote
1answer
49 views

Getting values from Qt widgets and using them for a buffer

I am writing a simple plugin that finds buffer. My gui has 2 combo box and 1 Line edit. The first combo box will have a drop down of values from column 'States' and 2nd combo will have a drop down of ...
2
votes
1answer
80 views

How to move layers in the QGIS Table of Contents via PyQGIS?

I have loaded two layers in canvas and would like to move the layers using the following code in TOC, but it is not moving the layers to the position based on the index given. from PyQt4.QtCore ...
2
votes
1answer
35 views

How to apply a filter to multiple vector layers in QGIS?

I am trying to apply an attribute filter to multiple layers in QGIS at once. The filter is to be applied to .osm data brought in through PostGIS to QGIS. I have tried selecting multiple layers -> ...
1
vote
0answers
65 views

Updating attribute table from an Excel file using Python

I am kinda new to Python, please excuse for such a trivial questions. There is a shapefile (let's call it Materials.shp). I have an attribute table with different fields (for example, windows, doors, ...
1
vote
0answers
40 views

Embedding python to select feature in QGIS action

I am working from QGIS actions with python and want go to select the current feature that I've identified using the identify tool. (Key point is that there is a difference between identify and ...
5
votes
2answers
126 views

Automating labels with numbers

Is there a way to strip characters from a string using python? The string is varied in length... Examples of strings: Interstate 10 Auxiliary road 24 State highway 14 I am looking for just the ...
1
vote
1answer
48 views

Python GDAL: Rasterising point data, raster and points are not geolocated

I am trying to rasterise some point data using Python GDAL module. But when I plot the data there is an offset between the two (original points and raster). I am sure it has to do with the ...
3
votes
1answer
62 views

PROJ.4 cs2cs is too slow. Alternative?

I use PROJ.4 cs2cs to convert data from a Lambert Conformal Conic to a geodetic coordinate (NAD83) or vice versa. In my application, sometimes I need to convert a lot of data. Because I call cs2cs ...
1
vote
1answer
52 views

Apply Symbology Layer to a group layers

I have several mxds (located in C:\Project ) that have 250 layers each. All the layers as the same name- "plan" and they all in group layers like that (added picture for example): I try to change ...
0
votes
0answers
36 views

copy WFS features to featureclass or shapefile using python

I'm trying to copy the features from a WFS to a geodatabase but cannot use the ESRI WFS tool because the WFS in question only works with the 'prefer HTTP Post, if available' selected in the ...
0
votes
1answer
48 views

ArcGIS Spatial Analyst in arcpy - FATAL ERROR (INFDEF) DIRECTORY FULL

I have been running into this error in several geoprocessing scripts I've written lately. When I call a spatial analyst function I return this error: FATAL ERROR (INFDEF) DIRECTORY FULL import ...
1
vote
1answer
95 views

Adding field values to a QComboBox in PyQGIS

I have a layer say 'Cities'. There is a column called 'NAME_1' in the layer. My GUI has a QComboBox in which i want the values of column 'NAME_1' alone to be displayed in the drop down of the combo ...
0
votes
2answers
19 views

Arcpy/python Syntax Error. Variable Creation

I'm having a problem when trying to create a new variable within python. i = datetime.datetime.now() tme = i.strftime('%d/%m/%Y') print tme This portion of the code creates a date variable (tme) in ...
0
votes
1answer
44 views

Select by location and copy to new shape and name based on attribute

I have a point features and polygon features. I need to: Select points that intersect the polygons Copy the points to a new shapefile Name this new point shapefile using an attribute of the polygon ...
0
votes
1answer
19 views

Pycsw Harvest SOS Error Exception

when I used the Harvest operation by the pycsw, and there was a Exception as the following picture: Picture 1: The Response of Harvest Operation Picture 2: The document default.cfg setting so how ...
1
vote
1answer
50 views

How do I properly import python sklearn to QGIS PyQt plugin?

A bit of background: I'm somewhat new to python and QGIS plugin development. I've created a plugin structure for QGIS using the Plugin Builder on QGIS and I've added some controls to the gui and ...
0
votes
1answer
47 views

Finding Pseudo Nodes using ArcGIS for Desktop?

Trying to write a python scrip to find and dissolve pseudo nodes for a large dataset. Anyone have any code to perform such a task? For example, I have a road line with several end/start nodes ...
2
votes
1answer
101 views

How to check if an ArcGIS extension has already been checked out manually in arcpy?

I've written a python script that uses a Spatial Analyst function and hence requires the Spatial Analyst extension to be enabled. I would like to be able to check out the extension only if it hasn't ...
0
votes
0answers
11 views

Importing XML Schema, Update/Delete Field Names

Presently, I am trying to write a script to import a XML workspace that contains the outline of schema. I want to create a tool/script that allows the user to import it, specify the number of certain ...
0
votes
1answer
28 views

Sum a field, and take that sum and use it to populate an existing field in the same table

I am trying to break down land uses in a watershed by making a tool in ModelBuilder. Right now I am clipping a land use layer by a watershed polygon, dissolving land use layer by land use code, ...
1
vote
1answer
95 views

How to enable the snapping options for vector layer using the python programming?

I want to enable the snapping options for the the existing layers using python programming. How can I do this?
0
votes
1answer
51 views

How to position the Qwidget form/QDialogBox in the left corner using python programming

1) I am creating a Qwidget Form or QDialogBox using QT Designer. I am using the following code to move the form: sDialog.move(50,450) But i want to fit the dialogBox to fit in the left corner.How ...