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

learn more… | top users | synonyms

2
votes
0answers
199 views

Is there any way to suppress the calculate field dialog box in arcpy script?

I've got a python script that I inherited. The python script takes input from a variety of feature classes and tables and spit it out to a single table. When I run this script via a scheduling ...
2
votes
0answers
1k views

Perfectly running python script gives error when run from web.py

I have the following python script which runs perfectly if run separately: import arcpy val = arcpy.GetCellValue_management("D:\dem-merged\lidar_wsg84", "-95.090174910630012 29.973962146120652", ...
2
votes
0answers
826 views

Spatial Analyst Cell Statistics seems to give the wrong answer in ArcGIS 10.0

I have a script that calculates standard deviation for a list of grids using the Cell Statistics function in Spatial Analyst for ArcGIS 10.0 The syntax is this: stdevGrid = ...
1
vote
0answers
4 views

using arcpy to convert labels to annotation

I am trying to use ArcPy to convert a specific shapefile in my TOC to annotation in the map. I am not so much in the need for the tiled annotation tool that i've seen talked about as this is going to ...
1
vote
0answers
14 views

How to convert Shapefile to KML in Python

My goal is to extract certain shapes from a shapefile, and render the chosen shapes in a KML file. From searching gis.stackexchange, I was able to piece together the necessary components, and the ...
1
vote
0answers
8 views

Reading and writing block windows with Rasterio

Alright. I'm trying to go about reading large rasters by the block windows in Rasterio. Everything works and I can iterate and output the flat file for my coworkers, but I can't for the life of me ...
1
vote
0answers
29 views

Qgis python: no interaction with Map Canvas

I've created a simple python script to load and show two layers and zoom to the first one. It looks like the script doesn't run the last 4 lines after I uncomment'print lyr1'. Anyway the map canvas is ...
1
vote
0answers
22 views

Per-pixel Descriptive Statistics through multiple Raster layers

I'm looking for computing different descriptive statistics through a set of raster layers. I need to make it with a python script capable of running into a standalone tool within the QGIS. To do so ...
1
vote
0answers
14 views

pyd error install qgis 2.14

I removed qgis 2.10 so i could install qgis 2.14. But when i try to install 2.14 i get errors on python .pyd packages. Every time it is a different pyd causing the error. I had this problem with ...
1
vote
0answers
27 views

How to automatically run some scripts for QGIS python console by defining the python macros checkbox

I'm working with QGIS 2.8 in windows 10. I've defined the python macros checkbox to QGIS start and simultaneously run a script that has the same path from my "QGIS.qgs" file. In the Project>Project ...
1
vote
0answers
34 views

Is there any way to connect features (entities) of dxf to database in python?

I'm using gdal, ezdxf, sqlite python packages and sqlite ODBC driver. They work fine, and in AutoCAD I can easily manually connect to my dbase.sqlite (read only) using _DBCONFIGURE and _DBCONNECT ...
1
vote
0answers
21 views

Nominatim address locator does't give longitude

I'm trying to geocode my addresses based on this tutorial: http://www.digital-geography.com/geocoding-addresses-in-arcgis-the-other-approach/#.VzMq_IR97Rb But Whenever I use Nominatim geocoder it ...
1
vote
0answers
35 views

Using Python-Flask-MongoDB with Geolocation field running on App Engine?

I'm trying to write an app which would act as a address caching API, so basically it needs to store addresses (geolocations) and later on I could query on a random address and radius and get all the ...
1
vote
0answers
37 views

Creating an ArcGIS toolbox with an R script

I posted this over on another website but since I think it might be an issue with ArcGIS, I decided to post it here also. So I have the following script in R. in_params[[1]] represents the input CSV ...
1
vote
0answers
28 views

Help with Python shapefile Union Program

First I am a Python noob... I have searched the database for this answer, found a few that might be the answer, just way over my head (I am signed up for a intro python class this month, to help ...
1
vote
0answers
24 views

Export multiple Layer Definition Files (qlr)

I have a postgresql database with approximately 400 tables. I need to generate Layer definition files (qlr) in QGIS for each individual table. Making this manually would take huge amount of time, so I ...
1
vote
0answers
22 views

QGIS cannot load macro function?

This has me stumped. For some reason, I can no longer run a function from a project macro even though macros are enabled (from Settings > Options > General > Enable macros > Always). Just ...
1
vote
0answers
39 views

QGIS 2.14.1 Processing Plug-In does not work anymore (Python error)

I did not change anything and started QGIS 2.14.1 today and was greeted with the following error message. So the Processing tab is missing and I cannot activate it. The error: 2016-04-26T17:58:43 1 ...
1
vote
0answers
35 views

Eclipse PyDev has quit recognizing QGIS objects

I followed the instructions for setting up Eclipse with PyDev to start creating QGIS plug ins found here: http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/ide_debugging.html after doing ...
1
vote
0answers
29 views

Python GDAL open dataset in PostGIS with quotations

Error trying to use gdal to open a dataset in PostGIS with the following code: ds = gdal.Open("PG: dbname=nyc host=localhost user=postgres password=mypassword port=5432 mode=2 schema=public ...
1
vote
0answers
26 views

Using “Ruled Based Render” to display labels without the marker with python in QGIS

I'm writing a script to load and manipulate some shapefiles. Unlike my previous question I now need to display labels only on certain zoom levels. My usual result is that the previous formatting gets ...
1
vote
0answers
44 views

Python error in Qgis 2.14.0

I'm trying to build virtual raster (catalog) following instructions from the documentation in QGIS.. It appears the following error in python code: 2016-04-17T12:13:07 1 Traceback (most recent call ...
1
vote
0answers
22 views

QGIS plugin 'Module' object has no attribute 'classFactory'

I am trying to learn how to make QGIS plugins and have been trying to follow tutorials such as this one; https://anitagraser.com/2014/04/26/getting-started-writing-qgis-2-x-plugins/ but I keep ...
1
vote
0answers
40 views

ogr2ogr - Shapefile database SQL query; missing .cpg and .xml

I am using gdal and ogr2ogr to perform a SQL query on a database of shapefiles with the code below. The geoprocessing works and the appropriate shapefile is extracted from the query, but when I print ...
1
vote
0answers
23 views

Python plugins not available, OS X 10.10.5, QGIS 2.8.4

I’m using OS X Yosemite 10.10.5 and QGIS 2.8.4 Wien. My mainproblem is that python support is disabled and I can’t use python plugins. QGIS seems to act fine and I’ve done a lot of work with QGIS. ...
1
vote
0answers
24 views

Resampling netcdf file?

What is the best way to change the cell size of a netcdf file, keeping it as netcdf? I have looked into ArcGIS and GDAL and have not found anything yet. I prefer to use python if a solution is ...
1
vote
0answers
44 views

QGIS python support disabled

I'm having a problem with the python support of my QGIS version. When I start QGIS, I get the error message: Traceback (most recent call last): File "", line 1, in ImportError: Module use of ...
1
vote
0answers
68 views

How to make NoData transparent?

I have been using python to turn a netcdf into a geotiff. Once I have the geotiff, I am using gdalwarp to transfer it into the right projection. Then use gdal_translate to get the tif into a vrt ...
1
vote
0answers
77 views

mosaic rasters with gdal_merge.py

I want to mosaic 2 rasters "rasa" and "rasb" using gdal_merge.py . While running the code, it produces an error " No input files selected". Can somebody help me to find the error in the code? ...
1
vote
0answers
41 views

Programmatically adding folders & layers to QgsComposerLegend

I've been building up QgsLayerTree object with a directory structure that reflects the desired legend. Specifically I'd like the Group(s) to be titles and their contained layers to legend items. ...
1
vote
0answers
43 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
23 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 ...
1
vote
0answers
105 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 ...
1
vote
0answers
21 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
48 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
24 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
29 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
128 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
52 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
39 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
28 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
137 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
45 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
41 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
58 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
44 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
23 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
44 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 ...