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

learn more… | top users | synonyms

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
90 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
59 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
48 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
27 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
37 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
57 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
37 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
30 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
82 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
32 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
31 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
62 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
41 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
71 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
23 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
49 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
49 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: ...
1
vote
0answers
58 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
39 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
44 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
25 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 ...
1
vote
0answers
40 views

Why doesn't the Undo/Redo History Widget run my custom undo/redo methods?

We're writing a Python plugin for QGIS 2.8.3. I've derived a class from QUndoCommand to contain "undo-able" work. When I push it onto the undo stack, its redo method gets called as expected, but QGIS ...
1
vote
0answers
118 views

“Invalid JSON primitive: geometry” when adding features

I'm trying to use the arcGIS Rest API to add features to a feature layer, but I get an "Invalid JSON primitive: geometry" error. I get the same results if I leave out the spatialReference. The ...
1
vote
0answers
30 views

Pass information in external command line software from a python plugin file

it would be quite difficult to explain, I'll do my best.. I'm writing a plugin for QGIS (with the plugin builder, so the folder structure is straightforward). This plugin calls other software (that ...
1
vote
0answers
50 views

QGis cannot retrieve a text value from QLineEdit

I am a developing a small plugin with python for QGis. I have a QLineEdit widget and I need to take the input from there. The input is a 8 character number string. However when I try to retrieve the ...
1
vote
0answers
67 views

How to create 10 day averages of a multiyear daily raster time series?

I have a set of daily modis LST rasters (.tif) over a roughly 13 year period (2002-2015). I would like to group them by 10 day periods, i.e. bin 1 = julian day(jd) 0-9, bin 2 = jd 10-19, etc so that ...
1
vote
0answers
22 views

Error when zooming to layer in PyQGIS application. On-the-fly transformation the issue?

I am trying to set the extent of my window to a layer on my canvas. This has worked smoothly until I started using Web Mercator maps instead of WGS84 maps. My features are getting their geolocation ...
1
vote
0answers
31 views

Automatically applying a local ortho projection using the center of the raster layer extent

I would like to take a raster image read the layer extents, extract the center point and then apply a custom local ortho projection with the origin set to the extracted center point. Can anyone ...
1
vote
0answers
259 views

Using Python to compute the distance, speed, and time between coordinates (lat/long) using haversine formula and print results within .csv

I have a .csv file with 10 columns. The first column is titled Distance_Between_Points, the second column is titled Time_Between_Points, and the third column is titled Speed_Between_Points and all ...
1
vote
0answers
82 views

QGIS Openlayers tool not showing tiles, but showing question mark

We have a proxy server which I've added to QGIS, but when I load openlayers, I get a grid with lots of questions marks, yet the watermark is supplied; any ideas? Fiddler doesn't show anything out of ...
1
vote
0answers
192 views

Use Anaconda's Python distribution within OSGeo4W

I want to use a Python script that executes Grass commands via os.system(). This of course, has to be executed from a running Grass session. However, when I use the OSGeo4W Grass, it does not find all ...
1
vote
0answers
104 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
0answers
31 views

Changes in MOD09A1 quality mask as processed with GDAL

I'm analyzing MOD09A1 spectral data using GDAL/Python. The quality mask is a uint32 dataset and want to pull out the value of the first bit to mask the spectral data (1 == poor data; 0 == good data). ...
1
vote
0answers
688 views

Reading, modifying and writing a geotiff with GDAL in python

I'm trying the learn the ropes of Remote Sensing image processing using Python GDAL bindings and numpy. As a first attempt, I'm reading a Landsat8 geotiff file, do a simple manipulation and write the ...
1
vote
0answers
24 views

Matplotlib Basemap Coastal Coordinates

Is there a way to query basemap to extract all coastal coordinates? Say user provides lat/lng and the function returns true/false if the coordinates are within 1km from the coast? Links are more than ...
1
vote
0answers
34 views

Creating a reference line among LiDAR points and retrieving distances between them?

I have a LAS dataset which contains points with x and y coordinates. For further analysis I need a new dimension which can be adjusted as the dataset requires. To make it understandable I made this ...
1
vote
0answers
33 views

Run entire model or validate with open model

I am creating Network Analyst tools for people who are very light users and need things to basically be buttons. Because of the way we use GIS this can't be done in a web application or any light form ...
1
vote
0answers
27 views

listing existing joins in table of contents feature

I am looking for a way to use python in ArcGIS desktop to check and print out the joins that exist between tables and feature classes in my map rather than right-clicking, going to joins and relates ...
1
vote
0answers
94 views

How to view the features of a point with a click in QGIS

I am developing a plug-in for QGIS. I am creating a form of personalized editing using QtCreator. The form is in the following image I read a csv file and when i click in a button OK I get a layer ...
1
vote
0answers
34 views

Calculate invariant moments for a each polygon in shapefile

I am working in python and have polygon shapefile created from polygonized binary raster. I populate the attribute fields for each polygon in a loop. I need to calculate the invariant moments fr each ...
1
vote
0answers
54 views

qgis python: select on screen and change (pre-set) properties accordingly

I have a map with different zones where I have drawn isochrones -where I will arrive within 15 min, within 30 min and so on. The picture attached shows the 15-120 min isochrones. This is set as a ...
1
vote
0answers
66 views

show polygon from database in browser in geodjango

I tried to retrieve the polygon which I saved into postgis database. (all polygons) Here is my code: models.py from django.contrib.gis.db import models class MyMap(models.Model): name = ...
1
vote
0answers
38 views

Creating Origin Destination Matrix from Station Locations

I am attempting to create an origin destination matrix in python for all of the London Underground Stations. I have the station name and the lat, lng of its location. It is in the following csv format ...
1
vote
0answers
35 views

Rendering problem in qgis

I have fetch data from database and draw it on qgis 2.8 as vector layer it works fine with limited data but for large data it will not work and goes into not responding stage, I am unable to ...
1
vote
0answers
369 views

Parsing geocoded data using python

I am trying to create a .csv file of parsed information of geocoded data from the google API geocoding service. I want to parse out the address information to be in separate columns. My script runs ...