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

learn more… | top users | synonyms

3
votes
1answer
49 views

How to automate the execution of Python console in QGIS?

I want to automate the execution of Python console in QGIS. When QGIS start, Python console starts at the same time, and Python predetermined code wants to be executed. Currently, in order to ...
2
votes
1answer
43 views

How to highlight a selected feature in qgis plugin using python [duplicate]

I am working on a plugin that would highlight selected features by changing its color. Can anyone help me regarding this? The plugin searches for required features and once found, I want that those ...
1
vote
0answers
16 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 ...
3
votes
1answer
55 views

How to interpolate point set into value contours?

The task at hand is creating 'isobar' value contours that are interpolated from a point field of either the x/y or lat/lon type. I really have no idea where to begin mainly because this needs to be ...
3
votes
1answer
559 views

Reset python add-in

I have a toolbar which enables a second and third combobox when a selection is made on the previous. I would like to add a button to 'reset' the toolbar. Basically reload the toolbar to it's original ...
4
votes
1answer
453 views

GDAL polygonize lines

I have a raster file containing roads (left image). I polygonize the raster file with GDAL (see the script below). In the end I like to have vector lines. However GDAL only gives me something like ...
1
vote
1answer
30 views

Why does QGIS 2.4 prematurely terminates on startup at “Starting Python”?

After reinstalling Python (3.4) as well as OSGeo4W and the QGIS Standalone, my QGIS always crashed when "Starting Python" on my Windows 7 64 Bit environment. It simply did not proceed to the QGIS-GUI ...
2
votes
1answer
163 views

How to construct a line from points in pyshp?

I am reading a shapefile for a pipeline and what I've noticed is that if I just draw a line from one point to the next (in the order I read them), there will be points where the line terminates, and ...
3
votes
1answer
864 views

Multiline VBScript Label Expressions in Arcpy

I am able to set simple label expressions, but when I try to set multiline expressions (which all VBScript expressions are) it does not get copied into the expression box properly. I have tried using ...
2
votes
1answer
44 views

Grass python shell can't find my data

I have a problem, the grass 7 python shell can't find my rasters. When I try to use the python shell to set the region I get "region not found". I can set the region in the grass shell (and other ...
1
vote
1answer
114 views

Installing Pandas in ArcGIS 10.2 for Desktop?

I followed the very clear directions in the answer to Installing pandas with Esri's python? and created the Esri101 build and added a "conda.pth" file to my ...
1
vote
1answer
276 views

Dealing with overlapping grid (and graticule) labels using ArcGIS Desktop?

I do have 3 grids made by Grids menu in data frame properties. I do need them to display in certain layout and also to behave accordingly to couple of rules (overlapping issues), so I can automate my ...
2
votes
0answers
28 views

Validating whether PDF file Uploaded as part of Geoprocessing Service of ArcGIS for Server?

I'm developing a Python Script that will be a Geoprocessing Service in ArcGIS Server. The Script has a Button for Users to OPTIONALLY Upload a PDF. If the PDF is Uploaded it gets inserted into the ...
3
votes
1answer
453 views

Want to use GDAL in Arc10 toolbox via subprocess call

I'm attempting to launch a version Python 2.5 that supports GDAL from an ArcGIS10 toolbox script. I'm doing this because I'm having loads of trouble importing the GDAL library directly into Arc, and ...
3
votes
0answers
52 views

How to use Python's subprocess module in a for loop ArcGIS?

I am new to scripting with ArcGIS. Although this might be an easy thing for those that know Python well, I haven't figured out how to use the subprocess module in a script. I actually think I'm ...
5
votes
2answers
2k views

Efficiency of python script using SAGA and arcpy

=== SUMMARY === I have created a process to import a LAS point cloud, clip it, select the ground points and save the output as an XYZ.txt for clients to use. This uses a python based script (will ...
0
votes
0answers
57 views

Python + GME (Spatial Ecology) + Subprocess.call

I'm trying to run the following code to use GME commands in Python. import arcpy,os,subprocess from arcpy import env env.workspace=r"D:\Users\myname\Desktop\aviso" count=0 for raster in (f for f in ...
1
vote
0answers
34 views

Doesn’t cal AGSSOM program to manage AGS mapservices from python script

We are using ArcGISServer 10.0 on a windows server. Because of database management we need to stop several ArcGISServer Services. For this purpose I use the AGSSOM program, which is called from the ...
0
votes
2answers
163 views

Using Python to execute Spatial Ecology GME commmands

I think I just need a second set of eyes on this. I'm just using Python to capture some user inputs to pass down to GME command. I'm only using the export to CSV to hammer out the behavior, but the ...
1
vote
0answers
138 views

New python GIS Programmer : Fundamentals of the Python Language for ArcGIS [closed]

I am new to programming and I'm trying to learn "Fundamentals of the Python Language for ArcGIS" and then I've been trying to compile an example code but python GUI keeps throwing throwing this error ...
1
vote
0answers
333 views

How to use paths with non ASCII characters for subprocess calls with ArcGIS

I know that it is possible to create calls using unicode character encoding like \xf8 for non ASCII characters but how do I do it writing a path in a script just like: 'e:\gis\python_ø\notepad.exe' ...
0
votes
1answer
134 views

How to write output from subprocess to disk (using multiprocessing)

This code was developed from another question I posted about how to kill an arcpy tool if it takes longer than a specified time. See How to cancel tool execution in python. Using the multiprocssing ...
2
votes
0answers
95 views

Python scaling issues and possible subprocess conflicts?

I have always found such great analytical and programming expertise on StackExchange in the past that I hope you can help me. Background: I have a project that involves spatially joining and ...
0
votes
1answer
91 views

Plugin QGIS Error “QTextEdit.setPlainText(QString): not enough arguments”

I try to make save as button but i got this error message when try to save file in my directory File "C:\Users\Mr.Pakde/.qgis2/python/plugins\condition\conditiondialog.py", line 80, in saveAs ...
3
votes
1answer
30 views

Fast editing in raster calculator — adding lots of images together

I need to add pictures together to make one raster. In one session there are about 150 - 200 images (named randomly - see syntax example) There are about 50 sessions (named randomly) Is there any ...
0
votes
1answer
104 views

Arcpy Subtracting rasters error - TypeError: 'unicode' object is not callable

I have a script which subtracts 2 versions of the same raster from each other (one newer than the other) and then extracts the additions & deletions that have happened. I created a simple test ...
0
votes
1answer
101 views

Spatial ETL Tools won't run “AttributeError: 'module' object has no attribute, etc.”

I have a python script that runs 5 Spatial ETL tools that I wish to run as a scheduled task. Each of the tools will run successfully from ArcCatalog and also from the ArcCatalog Command line. If I ...
2
votes
2answers
174 views

Issue while running grass from subprocess

I have a map based web application using geodjango. I needed to display the crime hotspots within a selected polygon area. I found that v.kernel is very good for generating heatmaps/hotspots. So in my ...
1
vote
0answers
19 views

Error message retrieval in grass.read_command

I am writing a script in python and would like to get the error messages of the function grass.read_command for seeing why it is not working. I found a webpage ...
2
votes
2answers
56 views

Delete Files in a folder and disregard an existing folder

I did a lot of geoprocessing steps and now I like to delete all files including result, result, _join, _interand reclass in their name. I can do this with the following import glob import os for fl ...
1
vote
1answer
181 views

PGRouting Layer plugin error in QGIS 2.2

I am trying to do some basic computations using the PGRouting plugin for QGIS, but I am getting this error all time: An error has occured while executing Python code: Traceback (most recent call ...
2
votes
1answer
61 views

Georeferencing a raster using GDAL and Python

I want to georeference a raster using python and GDAL. My current approach is to call gdal_translate and gdalwarp using os.system and an ugly list of ground control points. I'd really like a way to do ...
0
votes
2answers
61 views

How to calculate cumulative decreasing sum in ArcGIS-10.2

I need to calculate the cumulative decreasing sum as a field in a rasters attribute table. The cumulative decreasing sum is the accumulation of the last values to the first, so it is basically the ...
2
votes
1answer
180 views

Python problem visualization .tif image

I am trying to read a hyperspectral image in Uint16 .tif format and visualize it. I use GDAL in Python to read the data and everything works perfectly when I use matplotlib to show one band of the ...
1
vote
0answers
34 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: ...
8
votes
1answer
139 views

QGIS - Calling interpolation extension from python console

I would like to call the QGIS interpolation extension function (TIN method) (Raster->Interpolate) from python console. I can't find the corresponding function within QGIS API or within the ...
1
vote
1answer
111 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 ...
4
votes
1answer
328 views

QGis Zonal Statistics Plugin NoData included in Calculations

I have been trying to use the QGIS zonal statistics plugin. My raster has a nodata value of -99999 and all other values are positive. After computing the mean zonal statistics there are a number of ...
7
votes
0answers
149 views

Geotransformation for polar stereographic?

I'm currently working to import CANGRID climate data (provided as Surfer Grid ascii, ".grd" files) into ArcGIS. The grid is 95 rows by 125 columns in size.Metadata provides lat/lon of origin (lower ...
0
votes
2answers
89 views

How to replace “NULL” value with Zero in geodatabase table

I am having some difficulties to change "NULL" values to zero in geodatabase. I have tried the following python code in ArcGIS 10.1 ("Field Calculator") to change it but did not work. Pre-Logic ...
2
votes
1answer
93 views

update cursor to calculate field

This is my first post, so any help is greatly appreciated. I'm trying to use an update cursor to calculate a field. Basically, I'm trying to avoid division by 0 by looking in row[0] and see if it's 0. ...
1
vote
1answer
66 views

GDAL Merge Py on ubuntu many tif tiles into one

Trying to batch mosaic 1000 Gtiff rasters (all in one folder) into 1 tif file via gdal merge on linux ubuntu. Having trouble with the linux command to bring in all files in a folder into the output ...
2
votes
0answers
43 views

Setting up pycharm and pyqgis

I wanted to set up PyCharm the way this blog post explains: Setting up PyCharm for PyQGIS and Qt. I did everything as instructed but when it comes to adding project interpreters I got this error ...
1
vote
1answer
44 views

Calculate azimuth of vector for QGIS 2.0 Python plugin

I calculate the azimuth of a vector and update a field in my QGIS 2.0 Python 2.7 plugin. This works currently, but it takes much longer than i'd like to. I believe it is because i'm querying the data ...
2
votes
1answer
75 views

PostgreSQL PL/Python Function for “IF” condition

I am using OSM data to run pgr_dijkstra() for weighted-path calculation. But after importing OSM data using osm2pgsql I populated some additional columns into my ways table. So now it has gid serial, ...
2
votes
2answers
758 views

OSR Python testSR.ImportFromEPSG(4326) returns empty spatial reference

This is empty using Python .ImportFromEPSG(4326): import osr #this fails: testSR = osr.SpatialReference() testSR.ImportFromEPSG(4326) print testSR.ExportToPrettyWkt() #why did the import from EPSG ...
1
vote
0answers
18 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 ...
0
votes
0answers
15 views

DeleteFeature work very slowly with a MemoLayer

I have a python custom geoproccess wich use osgeo.ogr with a 'Memory' datasource. It work pretty fast except in one point where I need to delete feature known by id in a list. duplicated.sort() #list ...
2
votes
2answers
62 views

ArcGIS Field Calculator passes European-formatted floats as tuples

I have the problem that the ArcGIS Field Calculator doesn't read a float number when it is included in Python by referring to the field that contains it, in this way: def giveResult(floatValue): if ...
5
votes
2answers
105 views

Efficient way to use a CSV to Define a Feature Class

I was provided an Excel Spreadsheet which had the definitions of fields for a feature class. There were several worksheets in the file, each containing field definitions for different feature ...