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

learn more… | top users | synonyms

1
vote
0answers
48 views

How do I calculate the percentage of progress using raster data using Python?

How do I calculate the progress amount of two or more raster data being processed? I have seen examples of vector data but it becomes difficult to calculate the progress when no vector data are ...
1
vote
0answers
25 views

pyqgis change or update attribute data with real-time data or Timer update,Memory has been growing

I update my shapefile attribute data by QTimer ,and labling it, keep the lable visiable,change attribute by 1 minute, but the Memory has been growing 1 layers =self.iface.legendInterface()....
1
vote
0answers
113 views

QGIS 2.14 Couldn't load PyQGIS. No module named Qsci

When I open QGIS Version 2.14 Essen, I get the following error message: Couldn't load PyQGIS. Python support will be disabled. Traceback (most recent call last): File "", line 1, in File "C:/...
1
vote
0answers
24 views

CityEngine: Extruding Buildings

I have written some code extrude buildings, taken from another forum which had previously worked for others. However, it is not working for me. I have attatched two screen grabs, if anyone could ...
1
vote
0answers
53 views

PyQGIS: vector layer does not get displayed after rendering

My project goal is to write a standalone app for Unbuntu and QGIS 2.14. It should get a layer of simple points and their name from a Postgres database and show them in a layer. In addition there ...
1
vote
0answers
25 views

Using model precessing save from qgis into qgis python plugin

I would like to know if there is anyway to load from a QGIS python script a .model file and run it through the processing.runalg method as it seems that we lost the capability to save our model as a ...
1
vote
0answers
30 views

Received a python error when I clicked on new catalog in QGIS Geoserver

What shall I do if I Python error message is there when I clicked on new catalog in QGIS Geoserver. I have the same message: Python error: An error has occurred while executing Python code: See ...
1
vote
0answers
18 views

Local Maxima (or Pour Point) Pixel Value extract in Raster

I am doing watershed & pourpoint using python GDAL. I have calculated Fill, Flow-Direction & Flow-Accumulation using Python & GDAL. The next is to get Pour Point in certain window ...
1
vote
0answers
156 views

Convert PLSS (Section, Township, Range, Meridian) to Latitude and Longitude using R package or Python

I have data in the form of Section, Township, Range and meridian. I have 300,000 data points from all over the USA. Is there any way i can write R or python scripts to batch convert all the points to ...
1
vote
0answers
59 views

Python MapServer MapScript & Mongo - Use GeoJSON String Vs File

I have been using Python MapScript bindings for MapServer - and they work great. A new datasource for the application I am working on is MongoDB. I have seen mentions of a MongoDB Driver for ...
1
vote
0answers
25 views

unexpected change of area

Selecting a vector layer and running the following script, I expect the total area of my feature-geometries to be the same at the end of execution. from shapely.wkb import loads from shapely.ops ...
1
vote
0answers
43 views

Correcting for offset

I have a shape file with RTK measurements as a line feature, which more or less corresponds with visible features in a raster layer (shaped as lines). These measurements however are not accurate ...
1
vote
0answers
31 views

Flipped (Y-axis) Raster from point cloud

I have been working on a project where I need to create rasters from irregularly spaced point clouds. I am resampling my point clouds to a regular 0.25 cm grid using a nearest neighbor method ...
1
vote
0answers
178 views

How to install xlw and xlrd libraries on MacOS so that QGIS Python can see them?

I experience a problem with XYtools and need to install Excel libraries for Python. I tried to install them directly from the terminal and it worked on the system, however, how to import them into ...
1
vote
0answers
53 views

Preparing CliMond data for Maxent

I had been working with BioClim data and that was working in Maxent. I could clip files and realign them etc. Now I have some data from CliMond which is in two formats: Either as text files ...
1
vote
0answers
45 views

Python error in go2streetview plugin

We have the go2streetview plugin installed in QGIS 2.8.6 Wien and when performing a search using this plugin, the following error appeared: An error has occured while executing Python code: ...
1
vote
0answers
59 views

Cannot import name QtTest running unittests for QGIS plugin

I have the following imports in my unittest code: from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4 import QtCore, QtGui, QtTest When I run my unit test from the command line I get ...
1
vote
0answers
49 views

Geocoding and SRID - can't get desired SRID

I want to geocode a set of addresses with GoogleMaps, store the results in a different SRID in a PostGIS table and then project it in QGIS over a layer with the identical SRID. So far, it has been a ...
1
vote
0answers
24 views

Subset of spatial data causes slow SQL Spatial STIntersects

I've been having an issue were a specific subset of data causes an SQL spatial intersect to run extremely slowly. I am running sets of 1000 points against a subset of polygon layer to be intersected. ...
1
vote
0answers
48 views

How to access a feature by specific field value using python ogr in an efficient way?

I have one point layer and one polygon layer with a common identifier attribute field called "N", same objects amounts but Feature IDs (FID) are different. I have to iterate on the first one and what ...
1
vote
0answers
120 views

Write stacks of GeoTIFF image to NetCDF by chunk size

I converted GeoTIFF image stacks to NetCDF file with writing data by Index order (layer by layer) (this was a main solution). The problem is, it writes slowly (for 25 images - 1Gb takes 90 seconds). ...
1
vote
0answers
29 views

Use QgsRasterCalculator inside function

I'm relatively new to PyQGIS and I'm building a plugin to perform some calculations between raster layers. I was seeking to use the QgsRasterCalculator for some operations, however, the function that ...
1
vote
0answers
25 views

Python error using Vterrain in qgis

Traceback (most recent call last): File "C:/Users/Haimwant/.qgis2/python/plugins\VTerrain\VTerrain.py", line 409, in run os.spawnl(os.P_NOWAIT, directory + "Enviro", "-...
1
vote
0answers
36 views

How to transfer SQL variable back into ArcPy script?

I am trying to teach myself to access sql tables from an ArcPy script as part of a larger QC process. I am fairly certain that I have the sql statement correct (it works in SQL Server, albeit ...
1
vote
0answers
105 views

My QGIS keeps me returning “ascii” errors

First, whenever I open QGIS, the extension "Quickmap Services" returns an error with this tracker: Impossible to load the extension quick_map_services because of an error on calling InitGui() method ...
1
vote
0answers
19 views

Check if raster (part of) lies within a pixel - python/gdal

I have a list of the corner-coordinates of different grid (c1-c4). First i sorted these coordinates to ensure that c1 is the upper left, c2 is the upper right, c3 is the lower left and c4 is the lower ...
1
vote
0answers
70 views

Using row.setValue() function with arcgisscripting?

I'm trying to set column value NULL. I tried different ways to do that, I used CalculateField_management and UpdateCursor but i did not get success. when i used CalculateField_management. It says ...
1
vote
0answers
51 views

Try/Except Statement gives different Results in QGIS Console vs. QGIS Tool

I want my script to do different things depending on whether a particular layer DOES or DOES NOT exist in the Map Layers list. I thought the try: / except: statements would be the best way to achieve ...
1
vote
0answers
33 views

How to use itemChanged signal to update data?

I'm trying to understand the itemChanged signal to be able to update some information. An example of what I'm trying to achieve could be: def setCoordText(): label1.setText(str(label1.x()) + "," +...
1
vote
0answers
39 views

CF convention and GDAL projection

I'm trying to create some NETCDF4 CF compliant files from some code that generates GDAL compatible files. I was wondering whether there is a simple translation from GDAL (or proj4) projection ...
1
vote
0answers
59 views

How can i set layer polygon in center in QGIS using python?

I am trying to set a fixed zoom level whenever I layer is shifting on different polygon. I have coordinates for all the polygons , I need each polygon to be on center with certain zoom level so that ...
1
vote
0answers
38 views

How to change a point of an arrow on Print Composer?

To create an arrow on the Print Composer I've used this: qC = QgsComposition(iface.mapCanvas().mapRenderer()) arw = QgsComposerArrow(QPointF(0, 0),QPointF(10,10),qC) However, I can't find an ...
1
vote
0answers
35 views

python 2 polygon intersection

I have slope values derived from a DEM which I reclassified into NoDATA and vaules which I need. Then I made a polygon from this raster. I need to do intersection or something like that with the ...
1
vote
0answers
91 views

Projecting GeoJSON polygon object in python to calculate area

I have a script, written in python, that does many calculations - but one set of calculations hinges on determining the area of a polygon that I read in, in GeoJSON format. I can convert this object ...
1
vote
0answers
33 views

printing multiple .gws (geomedia work station)

I have a folder with many .gws files in it. I have to open each one individually and print to pdf. This consumes a lot of time and is very tedious. I know not a lot of people work with geomedia but I ...
1
vote
0answers
35 views

Using SET methods when feature classes setup in GDB using python, comtypes, ArcObjects?

from snippetarcgis102 import CreateMXD,CType,NewObj import snippetarcgis102 import os snippetarcgis102.GetStandaloneModules() snippetarcgis102.InitStandalone() import comtypes.gen.esriCarto as ...
1
vote
0answers
74 views

Upper limit to number of GeoTiff tiles?

I'm using the GDAL SWIG python bindings to create a new GeoTiff raster for use in a blockwise exponential-decay function. kernel_size = 177764054 driver = gdal.GetDriverByName('GTiff') kernel_dataset ...
1
vote
0answers
20 views

python - Composer plugin menu catch-22

a plugin for the Print Composer checks if the current project has at least one Composer when loading to avoid the error when creating the menu on a Composer that doesn't exist. However, once the ...
1
vote
0answers
50 views

Implementing Python script in QGIS with input variables?

I would like to implement this script in QGIS: How to draw perpendicular lines in QGIS? and be able to choose input data from the layers in my map, and iterate over them. The script from the link ...
1
vote
0answers
80 views

Installing Rtree on Windows 7 Python 35

I tried installing Rtree on Python35 on my windows 7 machine using the pip install command but ran into this error: OSError: could not find or load spatialindex_c.dll I also tried this and it gave me ...
1
vote
0answers
26 views

QgsCategorizedSymbolRenderer default ramp colors

I have a plugin and I want to symbology a vector file with some default ramp colors but I see that in graduated symbology is not so easy as in graduated symbology. Is it possible to assign a default ...
1
vote
0answers
94 views

Using peewee ORM with spatialite databases?

I would like to use the peewee orm in front of some Spatialite databases. Getting peewee to connect to a Spatialite database was relatively simple, and basically boiled down to: class ...
1
vote
0answers
52 views

How to call a package in QGIS python console?

I'm learning python and I'm also learning GIS (QGIS to be exact). What I'm trying to do is use the python console in QGIS to practice and get comfortable with python. Tutorials that I have found ...
1
vote
0answers
37 views

create own plugin

With the QGIS plugin 'plugin builder' I create a new plugin. Then I followed the steps described on this website : http://www.qgistutorials.com/en/docs/building_a_python_plugin.html It works perfect ...
1
vote
0answers
56 views

GRASS GIS i.landsat.toar hangs & holds CPU at 100%

I use python scripting to automate processing of several Landsat 8 scenes. I use a VPS (4 core, 8GB memory, SSD) running Ubuntu 14.04 with GRASS 7.0.1 Line in script for i.landsat.toar: grass....
1
vote
0answers
64 views

Creating spatial layer from MS SQL Server table?

I have a table in MSSQL that I am trying to use to create a spatial layer from using the QgsVectorLayer function to load the table as a layer, and then using Fiona to create a shapefile but I am ...
1
vote
0answers
195 views

Boundless OpenGeo Explorer fails with Python errors

I am running this stack on a Windows 2012 R2 Datacenter. PostgreSQL 9.3.10 PostGIS 2.2.0 PGAdmin III 1.18.1 Geoserver 2.7.3 QGIS 2.12.0 Boundless OpenGeo Explorer 0.6.2 Everything runs ...
1
vote
0answers
49 views

qgis python map canvas saveimageas save wrong image

I've been trying to write a small python script to output 2 tif's based on given box extents. The script all works, box coordinates convert to project coordinates, zooms to right place (would like ...
1
vote
0answers
45 views

Activate tracking for ArcGIS Online with python

It is possible to update data in ArcGIS Online by python-script: http://blogs.esri.com/esri/arcgis/2014/01/24/updating-your-hosted-feature-service-for-10-2/ Configuration is done by changing the ...
1
vote
0answers
26 views

Render single band gray raster define gradient and cumulative cut

I want to save an image with these characteristics: gradient: white to black std deviation = 5 Until now I get to apply the gradient but the minimum and maximum values are used instead of ...