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

learn more… | top users | synonyms

1
vote
0answers
50 views

multiprocessing and the ArcGIS in_memory workspace

I am trying a script that makes use of multiprocessing and a number of tools within arcpy. The script works only if I write all input, intermediate, and output from child multiprocessing executions to ...
1
vote
0answers
35 views

I can't get fiona to write while copying shapefile

I am trying to debug a function and have narrowed down the issue to a problem with my attempt to use fiona write. After going through the many online resources, I can't seem to find my problem, ...
1
vote
0answers
14 views

How to update the items of qCombox in custom form?

For my project I use a custom form with multiple value relation comboboxes. This works quite fine and I can access the widgets via my script. Init the two comboboxes which are correctly filled ...
1
vote
0answers
26 views

How to open a second window in QGIS plugin from a button inside the main window

If I already created a qgis plugin, and i need to create a button inside that plugin that opens a new window, how is that possible? Qt creator won't add a slot unless there are a header file. I looked ...
1
vote
0answers
32 views

In qgis using python, how can I get multiple pixels from a raster based on a vector point file

I just started working with qgis, and for the life of me I cannot figure out how to solve this problem: I have several points of interest, these are stored in a shape file (just simple points). I ...
1
vote
0answers
18 views

Python problem during CADInput installation

I was trying to install CADInput (version 0.60) on 2.4 Chugiak and 2.6 Brighton as well. In both cases I got an eror message during installation. For me the following extract of that message might ...
1
vote
0answers
41 views

Generate random points in polygon. Algorithm question

i created a Random Point Generator in python using the algorithm described here by @whuber. The algorithm is implemented using Shapely, PostGIS and psycopg2. To boost performance pythons ...
1
vote
0answers
56 views

Splitting Line.shp at Point.shp with Python/ogr

I'm trying to modify some ESRI Shapefiles using Python with gdal/ogr module. What I want to do is quite simple, but I didn't find any solution by now. I have two shapefiles: (1) Lines.shp and (2) ...
1
vote
0answers
66 views

With QGIS, why use QT Designer tools for creating Slots/Signals/ etc, if plugin coding can do it alone

I am curious why there is facility within QT Designer to create signals and slots as, to my surprise, I did not need to do this. All of the necessary coding was accomplished completely within the ...
1
vote
0answers
18 views

Python Band.SetNoDataValue(), sets all bands at once

Can someone tell me what I am doing wrong? I want to set bands 1 and three to 255, and band 2 to 0. The code below only should only set band 2, but gdalinfo shows that all bands get set to 0. Ubuntu ...
1
vote
0answers
22 views

How to find QGIS or QT or Python object definitions

I am attempting a simple plugin, on QGIS 2.6, using the available QT Designer installed I have successfully loaded a plugin, and can display a dialog box with widgets, within, and now attacking ...
1
vote
0answers
68 views

Link QGIS to Anaconda Python Distribution: Spyder, iPython Notebook, pip, scikit-learn

I have Anaconda as my primary Python distro, and want to route Python related QGIS scripts through it. With Anaconda, I have Spyder, can easily install packages with pip, and can launch a iPython ...
1
vote
0answers
20 views

How do I make arcpy exclude frozen / off layers while importing a DWG file?

I'm attempting to update existing GIS feature classes (SDE) using master AutoCAD files but end up importing ALL features present in the AutoCAD drawing regardless of the visibility settings (frozen / ...
1
vote
0answers
137 views

py2exe ImportError: No module named _err

The .exe file generated with py2exe returns the following error: c:\Users\...\dist>ShapeFileConverter.exe Traceback (most recent call last): File "ShapeFileConverter.py", line 4, in ...
1
vote
0answers
86 views

How to convert length in Decimal degrees to meters programmatically?

I'm new to qgis and I want to find the length of some roads in a map. So I used the following code, from shapely.wkb import loads def getLength(): layer = ...
1
vote
0answers
55 views

Asset point IDs, pipeline and flow direction

I have a data set of a sewage pipe network and point data (assets). I would like to: first calculate the flow direction of pipes (polyline feature) assign IDs to the pipelines using asset IDs ...
1
vote
0answers
47 views

Error Loading Layer/Shapefile in a Standalone Python QGis Application

I tried loading a shapefile on Python using PyQgis API but to no avail. I double-checked the path to shapefile and found it to be correct. QGIS module also seems to be imported just fine. When I ...
1
vote
0answers
22 views

Identify, Get, recover ArcGIS for Server (AGS) user?

have some one try or succed in recover the ArcGIS for Server (AGS) User name used in the connection, i need this cause i'm doing some edits to a Enterprise GDB, SQL Server with the same user and ...
1
vote
0answers
25 views

Python 2.6 Module for GDAL 1.9.2, ImportError

I work on an internal network(IE I cant get the latest 1.11 stuff) and have GDAL 1.9.2 setup on a Red Hat Linux Enterprise Server 6. My linux box has python 2.6.6 however the python binding I received ...
1
vote
0answers
40 views

Reprojecting and Clipping in one script using Python Subprocess module and GDAL

I am trying to reproject a .tif file then clip it to the boundaries of a shapefile using GDAL Warp. I want to do this in a single script, and have successfully used the Python subprocess module to ...
1
vote
0answers
36 views

How to freeze basemap using cx_freeze

I am working on script and I´d like to freeze it for use in computers who haven´t got python installed- The script is running fine but when I freeze it using cx_freeze an error appears. at the end ...
1
vote
0answers
45 views

Clip Management won't work outside of ArcMap/Catalog

Okay so I have a short script that works great when copied into the python window in ArcMap or ArcCatalog, but refuses to work in an IDE for whatever reason. The error that is thrown is: Start Time: ...
1
vote
0answers
55 views

PyQGIS add WMS layer with CQL_FILTER

Dear PyQgis developers! I'd like to add a wms layer through my QGIS plugin with custom CQL_FILTER parameters. My problem is, that the CQL_FILTER parameters are not passed to the GeoServer (I can see ...
1
vote
0answers
22 views

Adding features in the layer with reference to another layer

I have built a tool for creating line in the exact center of two selected lines through this code: import math def mainCl(): ftr_geom = [] select = iface.activeLayer().selectedFeatures() ...
1
vote
0answers
58 views

Esri Python Toolbox(pyt) corruption in ArcToolbox.dat

Symptoms: Open ArcCatalog and all tools within Python Toolbox(pyt) have a red-x error next to them claiming that "Arcpy module has no attribute Parameter" Close ArcCatalog Delete ArcToolbox.dat file ...
1
vote
0answers
32 views

Error writing defaultdict values to feature class rows

I originally posted building dictionary from feature class field values, how can I ensure there are no duplicate values per key. The goal is to update another field with all the values per key, which ...
1
vote
0answers
64 views

How to change color ramp in graduated classification with standard deviation using pyqgis

I'm using graduated clasiffication with standard deviation to style my shapefile (see code below). But I need to use different color ramp for classes below mean (-1std, -2std etc.).I'm thinking of ...
1
vote
0answers
17 views

Print Custom Feature Form using PyQGIS

I recently asked a question and accepted the answer, as it was a good guide on accessing the print composer using python. However, I am still looking for a way to print the custom feature form. Does ...
1
vote
0answers
44 views

midpoint of segments in QGIS determination

Gene thanks for your note on the problem yesterday ... This is a follow up to a question I posed before (How to find the middle point of a line in QGIS - Where to place input file name). Errors coming ...
1
vote
0answers
56 views

Is there a python function in QGIS to detect if the output file is saved to the hard disk?

I'm currently using QGIS 2.4 and writing some custom scripts on it. A proper script not only accomplishes its function, but also accepts user defined parameters and checks for possibilities of errors. ...
1
vote
0answers
77 views

QGIS Add WMS layer with python

I'm developing a stand alone python script using QGIS 2.2.0 libraries. I want to add a WMS base layer to my map, and I follow the instructions reported by the documentation: urlWithParams = ...
1
vote
0answers
53 views

User input and passing variables with ModelBuilder

I have created three modelbuilder tools that must be run in sequence. After running each tool, the user must examine several shapefiles and potentially change the input parameters of the next tool. ...
1
vote
0answers
38 views

Stereo-pair Image Registration

Is there a simple command line or python based way to visually register a pair of overlapping stereo images and clip the non-overlapping areas out? These images do not have spatial information ...
1
vote
0answers
28 views

PyQGIS: Properly trigger actionPan() tool when feature is added

I wrote a plugin which creates a custom map tool that adds features. I would like to cleanly connect to the pan tool after a feature is added. I've done it in the following way and it works, but I get ...
1
vote
0answers
103 views

Cumulative field calculation using Python in ArcGIS for Desktop?

I am using the following Python code to sum cumulatively but I need the summation to take place while the other field is equal to 1 and then again start the summation when it's equal to 2. I need the ...
1
vote
0answers
56 views

Finding areas with high POINT density from PostGIS table using Python

I have a PostGIS table with thousands of POINT objects and I want to find areas that have a high density of points. I have the DBSCAN clustering algorithm implemented in Python which does exactly ...
1
vote
0answers
57 views

QGIS processing framework SAGA NaturalNeighbor in external Python Script - No Output

I want to build a little script, which generates a NaturalNeighbor grid based on a point Shapefile. The script runs within my PyDev environment without any error messages, but no outputfile is ...
1
vote
0answers
30 views

Setting up ArcPad applet (Python) that calls arcgisscripting?

I've been asked to support a legacy script that was "made" (read: found) by a former coworker. My python skills are pretty basic, so I went right to installing the applet like I would for a VBS ...
1
vote
0answers
24 views

Python Script calling custom model failing during model execution

I have a python script that calls a model I built in model builder. If I run the model by itself it runs perfectly. If I call the model in the python script, the model errors in various locations. ...
1
vote
0answers
58 views

Orthographic projection in Python Basemap

I'm trying to plot a GeoTIFF in Python using Basemap. I can do so correctly with cyl projection like this: m = Basemap(projection='cyl', llcrnrlat=LL[1], urcrnrlat=UR[1], ...
1
vote
0answers
38 views

How to write in only a file .csv (or .txt) the values contained in several rasters?

I am an beginner in Python programming but I would like to write in only a file .csv (or .txt) the values contained in several rasters. For example, I built several rasters by using a loop. The ...
1
vote
0answers
34 views

GeoDjango WebMapping Application Update

According to the below GIS.SE questions, GeoDjango was the preferred framework for creating simple and quick webmap applications. But these questions are now all 2-3 years old. Can we verify whether ...
1
vote
0answers
46 views

How to load style from postgresql?

Is there any way to load a postgresql style for a vector layer using python? There is a function: loadNamedStyleFromDb (const QString &db, const QString &theURI, QString &qml).Does it ...
1
vote
0answers
24 views

Problem Loading Plug-Ins in QGIS 2.2 on Mac

I'm trying to load the 'processing' module in QGIS (2.2.0-Valmiera on Mac OSX 10.8). However, this module and others (e.g. GarminaCustomMap) re failing to load with a message: ImportError: No ...
1
vote
0answers
42 views

Mapping from one plane on the other plane despite of masking regions

have a set of data given here, where in the first and second columns there are the sky coordinates (ra,dec) e.g. right ascension and declination, respectively and in the third and forth, the ...
1
vote
0answers
57 views

Creating symbology by category in python?

I'm trying to create a python script that creates color-coded symbology by county for multiple maps with different data. I've never created a layer file for the purposes of symbology before, but I ...
1
vote
0answers
41 views

Clipping between features within a single vector?

Is it possible (via the Qgis API and friends), to clip polygonal features within a single vector layer? The hope is to accomplish this without having to duplicate the feature into a new layer. ...
1
vote
0answers
52 views

lat/lon of intersection between line of sight from a given lat/lon and altitude above ground

Given a starting latitude, longitude and altitude, and a line of sight defined by azimuth and elevation, I want to find the latitude and longitude (assuming spherical Earth, WGS84 or other) where the ...
1
vote
0answers
47 views

Scaling features based on an attribute

I would like to scale polygon features by a specific factor I have calculated for each feature in a feature class. I know of the Scale tool, however it only allows for manual entry of a scale factor ...
1
vote
0answers
66 views

How to batch process near feature distance in ArcGIS

I have 2000+ point shape files. These are all GPS tracks. I want to calculate the distance from each point to the nearest feature (road, train line, restaurant etc) within a 30 meter radius. I am ...