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

learn more… | top users | synonyms

1
vote
1answer
48 views

Pythonic solution for changing shape files properties in QGIS

I'm loading several shape files into QGIS using the python console. The script works by reading a list of directories and a list of shapefiles to load from each directory, then it loads each file. ...
1
vote
1answer
21 views

QgsComposerTextTableV2 minimal implementation?

I would like to use the richer data and styling API QgsComposerTextTableV2 offers. However I get this error when adding it to the composer: TypeError: QGraphicsScene.addItem(QGraphicsItem): argument ...
1
vote
1answer
137 views

Create Table with postGIS geometry in Python

I'm creating the following table with a postGIS geometry column in python but get an error psycopg2.ProgrammingError: type "geometry" does not exist What should I use to be able to use postGIS in ...
1
vote
1answer
38 views

Install pygeoprocessing on ubuntu 14.04 and python3

I'm trying to install the pygeoprocessing package for Python 3.4 on an Ubuntu 14.04 VM. I have all the necessary versions of the required dependencies (GDAL, numpy, scipy, shapely, Cython). ...
1
vote
1answer
20 views

Error using gdalwarp in EPSG:4326

I tried to change the projection of AMSR-2 in Python using: 'gdalwarp -geoloc -t_srs EPSG:4326 C:\GW1AM2_201301311114_050A_L1SGBTBR_1110110.vrt C:\test100.tif' It said there are something wrong ...
1
vote
1answer
97 views

PyInstaller myscript.py - issues: empty dist folder

This question is subsequent to another question: here. The question was solved but I ran into another issue and tried to ask it there but it is worth being its own question I think. Python version in ...
1
vote
1answer
61 views

How to get the pixels from a geotiff file in gdal python for a given polygon?

I use python and GDAL under apache to make a webservice. I have a GeoTIFF file and i want only a subset of the data, everything inside one polygon defined by a buffer of a line (coord is the input ...
1
vote
1answer
74 views

Load multiple files from folder for further processing

I'm working on a processing model and I'm looking for a possibility to load multiple shape-files from an Input-folder for further processing (first clip them all to a certain extend, then assign them ...
1
vote
1answer
71 views

Fail to compile QGIS source on Windows

CMake fails to configure. I get following error: Could NOT find PythonInterp: Found unsuitable version "1.4", but required is at least "2.7" (found c:/cygwin/bin/python2.7.exe) which seems ...
1
vote
1answer
31 views

Operations lists arcpy

I have a list with 4 raster files and another list with 4 vector files. I want to relate each of the raster file 1 file list 1 vector list. I try to do and I related file 1 raster to vector file 1,2,3,...
1
vote
3answers
75 views

Querying dataset with .shp file?

I'm new to GIS tech. Please excuse me since I'm not yet familiar into using GIS. I will be using a very large dataset (yfcc100m dataset, a dataset containing metadata of Flickr's photos/video) which ...
1
vote
1answer
323 views

Installing QGIS using Homebrew

I've been unsuccessfully trying to install QGIS using Homebrew (used Homebrew to install GDAL and GSL) as outlined here My OS is Mac Yosemite, 10.10.5. The installation sort of finishes, but with a ...
1
vote
1answer
114 views

Getting inaccurate results converting from New York State projection to NAD83 with Python's pyproj

I've been trying to do a standard coordinate translation between New York State Long Island (ESRI:102718) and latitude/longitude (EPSG:4269)...but I keep getting the wrong lat/lng results. I don't ...
1
vote
1answer
111 views

QGIS docutils install (path,pythonpath,pythonhome)

New to QGIS and Python. Have QGIS installed and working great on Windows, want to install and use Docutils -- Python Documentation Utilities (presumably all simple and small .py programs). I see ...
1
vote
1answer
70 views

Moving file geodatabases in python without ArcPy

Please find my script below currently all i'm wanting to do is iterate through a folder and any subfolders extracting anything that is a .gdb directory + its contents to a new folder. import shutil, ...
1
vote
1answer
55 views

Find Feature class into another feature data

I am trying to find the feature classes from one feature data into another feature classes. But I'm getting nothing at the end as a result of the matc statement. The data in the arc environment is XYZ....
1
vote
1answer
43 views

rendering a single band raster - new maxvalue

I have a downloaded raster file, singlebandgray, and want to redefine it's maximum value to a higher integer value. Via the QGIS desktop it works smoothly by hand via the Properties. Via Python I was ...
1
vote
1answer
32 views

GRID-file: get max extent for all z-values above given value

I have a GRID-file with a quite large extent. For an automatic workflow I need the maximum extent/bounding-box for all z-values that are over a certain range. For example: Get the maximum extent for ...
1
vote
1answer
654 views

Unable to delete folder with shutil.rmtree() with ArcPy?

Unable to delete folder with shutil.rmtree() with arcpy: del mxd delete_path_edit = temp_dir_extended delete_path_forward = '/'.join(delete_path_edit.split('\\')) shutil.rmtree(delete_path_forward) ...
1
vote
1answer
37 views

QGis's Geoferencer plugin isn't able to paste text that has been added to clipboard via mac's “pbcopy” terminal command [closed]

I recently wrote a little script that used mac's pbcopy shell command to dump some text into my clipboard for use in the QGis program. For some reason I'm not able to paste stuff that has been pbcopy'...
1
vote
1answer
49 views

Render QgsRasterLayer without adding to legend

I am trying to render a number of related QgsRasterLayer objects that are related to eachother (they are slippy-type tiles). Ideally I would like one item in the legend that can have its position ...
1
vote
1answer
94 views

How to handle temp files created during Extract by Mask (Spatial Analyst)?

I have three scripts running simultaneously that processes raster data in several directories. The problem I am encountering is that ArcGIS is creating a temporary grid file called 'Extract_recl1' ...
1
vote
1answer
354 views

Avoid time out error Nominatim Geopy Open Street Maps

How to avoid the "GeocoderTimedOut('Service timed out')" error in geopy using the osm nominatim geocoder? I am not interested in using an exception and skip some entries. I already use a time delay of ...
1
vote
1answer
72 views

How to select attributes by unicode field value?

I have an attribute table in QGIS 2.10 with a string field (myfield) and when I want to make a selection based on the unique values of this field I get no selection at all. >idxmyfield = mylayer....
1
vote
1answer
1k views

Cannot load maps using OpenLayers plugin in QGIS

I'm currently using QGIS 2.12.1-Lyon. I have installed the OpenLayers Plugin (and updated to the latest version, v1.3.6). However, when I go to load up base maps in QGIS using this plugin (go to Web | ...
1
vote
1answer
149 views

Given a collection of polygons, how do you find which one contains a given point? Java or Python

I'm looking for Java or Python libraries that will help me answer this question efficiently: given a collection of polygons (via shape files or GeoJSON), which one of them contains a given point? The ...
1
vote
1answer
25 views

Clearing Calculate Value before Model Run in ArcGIS ModelBuilder?

I am using ArcGIS 10.2 for Desktop. I have a model which contains several branches, which branch should run is based on the results of an earlier stage in the model. If the first stage of the model ...
1
vote
1answer
96 views

PyQT: QFileDialog keeps on opening window after clicking on cancel or ok

I use to write QGis plugins, which is based on PyQT. I use to create QButtons and connect their click to a function that itself calls a QFileDialog. For example: def doOpenFile(self): fname =...
1
vote
1answer
40 views

Coding names with a uniqueid starting form 001 but not exceeding three digits

I'm trying to code the names from geo database the total records of names are 957 and i want each name to have the uniqueID and it should not exceed three digits. starting from 001. The below script ...
1
vote
1answer
121 views

How to display shape files stored in a database into a web page

I'm pretty new to geodjango and python in general. But I would like to display my shapefiles stored in my database into a web pages and present them in layers and retrieve certain information if a ...
1
vote
1answer
58 views

How can a gui be visible till all the work is done? (QGIS plugin, python)

I have made a gui in QTDesigner for QGIS2.10 (as a dialog). When I press the ok button (if result == QtGui.QFileDialog.Accepted:) everything works just fine but the gui is disappeared. How can the gui ...
1
vote
1answer
78 views

Change variables in QGIS 2.12 using python

Now it's possible in QGIS 2.12 to add your own variables, I wonder how I can add new variables or change variables using the Python console.
1
vote
1answer
50 views

Performing transformation with pyproj?

This seems like it should be straight forward, but I'm struggling to get the correct transformation from my state plane to lat long. My code is as follows # projection from spatialreference.org/ref/...
1
vote
1answer
99 views

Spatial join multiple attributes from smaller polygons to the bigger one

I'm trying to join (to the rectangle) values from multiple polygons intersecting for this rectangle. I've tried to use some Reference functions in Field Calculator like geomintersects() but it joins ...
1
vote
2answers
62 views

How to set independent path in QgsOverlayAnalyzer >> intersection statement using Python?

How to set independent path in QgsOverlayAnalyzer >> intersection statement using Python? QgsOverlayAnalyzer.intersection(QgsVectorLayer, QgsVectorLayer, QString, bool onlySelectedFeatures=False, ...
1
vote
1answer
79 views

Qgis: QgsLogMessage.logMessage to output message in a specific tab

I am writing a Qgis plugin. I would like the plugin to write log message in a specific tab, in the Log Messages window. I tried: QgsMessageLog.logMessage("File "+ii.source()+": all pixels set to no ...
1
vote
1answer
87 views

How to rasterize a point layer with multiple features falling inside a raster cell?

How to make a raster with values that are the sum of all points inside each raster cell? The burn value is a specific attribute. Using gdal_rasterize or gdal.RasterizeLayer(), the resulting raster ...
1
vote
1answer
77 views

How to get a list of all objects contained in my different QGis layers

I would like to know how we could do in QGis to get a list of object contained in my different opened layers: We have n .SHP files or PostgreSQL Views (they all contain at least an "object type" ...
1
vote
1answer
34 views

Hide an empty line through Python IF statement in FME Workbench

I am trying to set a rule that would move up filled lines and hide an empty line (it can be on any line) in a postal address through PythonCaller transformer. I have a database table consisted of ...
1
vote
1answer
42 views

String quoting issues with sql using ST_PointFromText in psycopg2

I've been banging my head against this for a while, and am seeking some insight into what I'm doing wrong. I have the following snippet of code: params = [PlaneRep.hex, PlaneRep.squawk, PlaneRep....
1
vote
1answer
40 views

Iterate over polygons to convert WFS features

So my first question on stackexchance. With ogr2ogr its possible to convert WFS features to SQlite with the following: ogr2ogr -f "SQLite" OUTPUT.sqlite WFS:"INPUT_WFS_url" It works. But there ...
1
vote
2answers
74 views

How do I export data to a new table?

This is my script and I need to create a new attribute table which contain the information on the print line. Could someone help me? import arcpy from arcpy import env import datetime env.workspace= ...
1
vote
1answer
50 views

Compare and modify changes amongst GIS and MIS data

import arcpy import sqlite3 # the column names columnNames = ["ASSETNUM", "DESCRIPTIO", "INSERVICE", "ENGINEID"] data = [] with arcpy.da.SearchCursor(r'E:\mypathtoshp\Fire_Hydrants.shp', columnNames)...
1
vote
1answer
139 views

Export/Import Shp file records to sqlite table

I am new to python and ArcPy. I need to transfer all the records of a single shapefile to a table created in sqlite3 without the geometry. So far I was only able to retrieve the records using ...
1
vote
1answer
93 views

Arc-node topology data structures in Python GIS packages

I am looking at using the traditional arc-node topological data structure to make some spatial data analysis more efficient. I would like to avoid reinventing the wheel. Is there an implementation in ...
1
vote
1answer
122 views

Mapnik zoom_to_box for shape

I have used the code from Mapnik python tutorial. Now I want to use zoom_to_box to zoom to certain extent. I want to zoom to Box2d(-180.0, 0.0, 0.0, 90.0), however, after appied zoom_to_box, I saw the ...
1
vote
1answer
49 views

How to see the 'example provider' in processing toolbox of QGIS?

I would like to create my own provider with the processing toolbox. I see the example provider in my folder C:\QgisWien\bin...\algs\ExampleProvider. It seems to be a good start but unfortunately, I ...
1
vote
1answer
82 views

How to edit shapefile name written to attribute table in QGIS?

I have adapted some QGIS pythonscript code from a previous question to assign the filename of a shapefile to that shapefiles attribute table as a prelude to joining multiple shapefiles together (the ...
1
vote
2answers
243 views

Using Python to backup ArcSDE geodatabase on SQL Server Express?

Is it possible to use Python to do a backup of ArcSDE databases stored in SQL Server Express? I have been using a custom executable that uses Arcobjects IDataServerManagerAdmin.BackupGeodatabase() ...
1
vote
2answers
123 views

Search and Select in Arcpy with Cursors

I'm working on a tool that identifies features and repairs them using an existing tool. At the moment I am struggling to put my idea into code however. The purpose is to use a search cursor from a ...