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

learn more… | top users | synonyms

0
votes
0answers
6 views

QgsGeometryAnalyzer.dissolve problems

I am completely new to the QGIS python api and I am running into an error which I cannot solve when trying to use the dissolve class. I used the basics of the PyQGIS Cookbook. In my understanding ...
0
votes
1answer
14 views

USGS Earthquake GPS Metadata: Buffer Zones & Python

I'm making a python web crawler that gets USGS earthquake GPS data, and I'm wondering how I should process the latitude longitude pairs to see if it falls within a specified radius of a specified GPS ...
0
votes
1answer
21 views

Conducting geographically weighted regression on a raster

I have a relatively big raster file on which I want to conduct geographically weighted regression. Size of raster ~ 2 GB and number of rows is around 100,000 One way might be to convert from raster ...
3
votes
2answers
96 views

Converting Vertices of Polylines and Polygons to Points and Maintain Attributes

I'm pretty sure someone has done this before, but I'm having no luck. I'm using ArcGIS Standard version 10.2.1 and I want to convert all the vertices of a polyline or polygon to points. Essentially, ...
3
votes
1answer
185 views

How come “Zoom to Polygon” always puts me in the middle of Nebraska?

This is an issue related to this question I'd asked a few days ago. I've got that code working, to an extent. Every time, though, that I double click on one of the Polygons in the attribute table that ...
1
vote
1answer
34 views

Problem with Intersect_Analysis : too long path? [on hold]

I made a python code for Arcgis 9.3. to intersect 2 features. The problem is that code works when the files are on my desktop (for example) but not when they are in a long path on another disc. Here ...
0
votes
2answers
47 views

using Python to calculate NDVI, output as a Geotiff

I need a script that can calculate NDVI from two separate input Geotiff files, then output the results as a Geotiff. I wrote following script, most of which is borrowed from various on-line sources ...
0
votes
0answers
44 views

Issue blocking QGIS feature form dialog with Python

I'm not sure where I'm going wrong with this python logic for a custom form in QGIS 2.0.1. There are a few things required by the validation function: that index of combo boxes aren't 0 (first index ...
0
votes
2answers
33 views

Shapely: Round Polygon Corners?

I use the python module "shapely" to make Polygons (like below). Can I convert the sharp edges of a polygon easily to round edges? Such that when I have unified some polygons I could issue a command ...
3
votes
3answers
130 views
+50

Is there a way to call the clip function in pyQGIS from the python console?

Is there a way to call the clip function in QQGIS from the python console? It is found under geoprocessing tools in the vector menu.
0
votes
0answers
13 views

custom toolbar combobox: issues with adding functionality

I've added a combo box to my custom toolbar in QGIS (based on this thread QGIS - Add a combobox to a toolbar), but there are two things I'd like to achieve that can't get working: first, dynamically ...
0
votes
2answers
22 views

How to plot geo-data using matplotlib/python

I am trying to plot a polygone on python, using different libararies, but no one of these worked with me. I tried vincent ,Shapely , .. and now matplotlib. I don't wanna use softwares like qgis I ...
1
vote
2answers
217 views

Where to find PySAL toolbox for ArcGIS?

I installed PySAL but i can't find the toolbox for ArcGIS.
0
votes
0answers
15 views

Error while running OSGeo4W setup

i'm not sure if i got a problem with osgeo4w or with python. but i get an error message if i run setup: C:\>setup C:\>Exception in thread Thread-5: Traceback (most recent call last): File ...
2
votes
2answers
66 views

Using Python to shorten polylines of varying lengths by 44% of their original length (or by a value contained in a field)

I have a feature class containing tens of thousands of polylines of varying lengths that were constructed from only a start and end point (of note, they are all at different angles, and many lines ...
1
vote
1answer
60 views

Using 'construct points' on all lines in a shapefile (arcpy)

I need to use the editing tool 'Construct Points' on several shapefiles that each have ~1300 polylines. I need to do this to create points every 1km along each of the polylines, which represent the ...
0
votes
0answers
14 views

QgsMarkerSymbolLayerV2 not rendering

For the life of me I cannot get a custom vector layer symbol to render. Following is the code I am using, as fas as I can tell renderPoint is never called. Is there something I am missing here. The ...
0
votes
1answer
95 views

Calculating Stream Length-gradient Index (Hack Index) with the field calculator

I'm trying to calculate the Stream Length-Gradient Index of a stream (example data below). Just started to get into python, but am struggling with a solution to this problem. I have 42 streams to run ...
1
vote
0answers
28 views

Managing large number of catchments/watersheds

Does anyone know of an easy way to manage a large number (10,000's) of catchments/watersheds? I have defined a stream network and for each segment, I have a corresponding catchment (in a unique ...
7
votes
1answer
662 views

How to prompt for user input during ArcGIS Python script tool execution?

I want to prompt for user input after all parameters have been specified for the script tool. I've seen many forum posts and stackexchange questions about this, and they all conclude that it's ...
0
votes
1answer
425 views

How to clip raster by multiple polygons in multi rasters?

Using QGIS, I want to clip a raster by multiple polygons contained in a single shapefile. I read that gdalwarp can clip my raster by multiple polygons BUT the output is a single merged clipped raster. ...
3
votes
3answers
345 views

Python - Find the largest extent in a list of extents (tuple format)

I am trying to find a way (simplest is the best) to retrieve the largest extent in a list of tuple extents in python. The list is looking like that: extents = [(-180.0, -90.0, 180.0, 83.624), ...
3
votes
0answers
44 views

After ArcGIS 10.2.1 update, Arcpy 64 bit import Error

I've updated my ArcGIS desktop version from 10.2 to 10.2.1 and have noticed that when I run the 64 bit version of IDLE I now get an error when trying to import arcpy: Python 2.7.3 (default, Apr 10 ...
0
votes
1answer
48 views

Error with Python Script tool for ArcGIS 10.2

I am trying to create an ArcGIS map tool that includes creating TINS and uses parameters. This tool works fine when taking the data from shapefiles, but when I use map layers, which is what I want it ...
0
votes
2answers
135 views

How to handle adding a PostGIS layer in pyQgis without saving password?

I'm writing python plugin and trying to find the right way to add PostGIS layer on the map without storing user password. After adding layer on the map, I strip out the password from uri like this: ...
0
votes
1answer
21 views

How do I check spatial reference on all parameters during Tool Validation?

How do I check spatial reference on all parameters during Tool Validation? Just looking for recommendations. Here is what I have already. This must work with existing validation. import arcpy class ...
0
votes
0answers
11 views

ogr: confusing results from `SetSpatialFilter()`

My layer is derived from a data source like this: l_131 = bounds.ExecuteSQL("select * from 'nam_l' where 'ND_5'= 131 ") feat = l_131.GetNextFeature() feat.GetFeatureCount() >>> 200 It is a ...
0
votes
1answer
15 views

Point z value Return 1.#QNAN while set before

I am makin a python code for ArcGis 9.3. The code is as following : rowsLine = gp.updatecursor(line_Feature_Class) count = 0 rowLine = rowsLine.next() rowsPoint = ...
0
votes
1answer
31 views

How to copy attribute values of fields in selected features of one layer to another Qgis programmatically?

I am trying to get the values of attributes of the selected features of a layer field by field and copy to another layer that I created in qgis with pyqgis. Is here a example for this. Every example ...
1
vote
1answer
59 views

How to get Z attribute of point using Python and ArcGIS Desktop 9.3?

I am making a python code for arcgis 9.3. In this code i create a new point with x,y and z attributes as following : rowsLine = gp.updatecursor(line_Feature_Class) rowLine = rowsLine.next() ...
1
vote
1answer
75 views

QGIS Python Labelling

i want to label a point layer with those values exceeding a set of variables attribute table as follows 'loc field'(text),'a'(float),'b'(float),'c'(float) variables as follows vara = 5, varb = 3, ...
-2
votes
1answer
185 views

How to write Process Dialog log information to text file in ArcGIS?

I have created a custom model. When this model is run, it shows a process dialog which has some log information. I want to write that log information into the text file for further analysis. Does ...
1
vote
1answer
36 views

How to call ogr2ogr from command line with Python 2.7 from ArcGIS 10.2 for Desktop?

I am trying to access ogr2ogr in the command line, and this is the message I receive: 'ogr2ogr' is not recognized as an internal or external command, operable program or batch file. This is ...
1
vote
1answer
36 views

Why does Animal Movement toolbox give SyntaxError: invalid syntax?

I found a complete toolbox (Animal Movement tbx, by Regan Sarwas) for my tasks and I tried it. I had a systematic problem with the codes for all tools (line 1), for exemple: Executing: ...
0
votes
0answers
22 views

Help with scripts for processing raster files with the raster calculator in QGIS

I am trying to process some raster files using python scripts in Qgis 2.20, and I have been having trouble finding any documentation on using raster calculator in scripts being run in the processing ...
1
vote
2answers
63 views

How can I group Points to make polygon via Python

I have an array of coordinates Point= [lat,long] ListPoint= [[38.203655,-76.113281],[38.10,-76.12],..] I wanna make a polygon that contains all these points ? There is a project developed by ...
6
votes
2answers
180 views

Using PROJ.4 library to transform from local coordinate system coordinates to global coordinate system using ground control points?

I have a point cloud whose coordinates are with respect to a local coordinate system. I also have ground control points with GPS values. Can I convert these local coordinates to a global coordinate ...
1
vote
1answer
170 views

How can I change SQL query through a layer of an action (python)?

I have three layers from three diferent database tables. When I click in other layer I want to change (with an action) the query of that three layers. How can I do that? Thank you
0
votes
1answer
55 views
+100

QGis: scripting the map rendering (multiple similar maps from one shapefile)

I would like to ask for advice on creating a Python script that will provide the opportunity to render a plenty of similar maps (with the same extent, projection, layout, color scheme and composition, ...
1
vote
1answer
43 views

Finding closest Intersection between line strings (PostGIS)

I want to find the distance between one point (excavation sites) and a line (rivers) for the cardinal directions. What I thought would be the easiest way is to draw lines between the excavation site ...
1
vote
1answer
131 views

How to use 'remap' in reclassify tool code in ArcGIS Python Toolbox

I am making a reclassify tool in ArcGIS python toolbox (.pyt) ... I am able to use the remap datatype but am not able to parse the information present in Remap in the Reclassify function's third ...
2
votes
2answers
141 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 ...
2
votes
1answer
24 views

How can I extract only band 4 from a geotiff multi bands to create geotiff or AAIgrid with this band using Python?

I have a geotiff file with many bands... I will like to create a .asc file or tiff file by converting only one band from the geotiff file. I don't find the solution by using python... With ...
3
votes
1answer
75 views

Python Postgres Multiprocessing speed increase

I'm trying to speed up my PostGIS queries using multiprocessing. My current setup is using python and psycopg2 such as below. Although this has given a speed increase, it still seems like there are ...
3
votes
1answer
143 views

Accessing arcpy functions from IronPython

I made a few python scripts to automatically optimize and publish my data.. Now i'm thinking about writing a .NET program to manage and run these scripts: the obvious way is invoking them in a ...
0
votes
0answers
20 views

Add existing QGIS plugin button to custom toolbar

Is it possible to add an existing plugin's button to a custom toolbar? I've succeeded in adding core actions such as shown below, but am wondering if it would be possible to integrate another plugin ...
0
votes
0answers
29 views

Have I created a valid Spatialite database?

I didn't manage to find the better way to populate the exisiting Spatialite database with new computed data than just creating new columns and filling them in the Python script. You can see that the ...
2
votes
2answers
43 views

How to save python ogr2ogr shapefile to memory, and stream to web client as zip

I'm trying to accomplish something similar to the site http://ogre.adc4gis.com/ I want to be able to manipulate a geojson file, and send it to the client as a shapefile, in a single zip file. I'm ...
0
votes
2answers
28 views

Get srid from a shapefile using ogr

I'm writing a script to import shp to postgis, using python, osgeo and psycopg2 ( see my previous question: Import shp to Postgis using Python and ogr ) I'd know if there is a way to get by osgeo ...
1
vote
1answer
145 views

Difficulties in dissolving stream orders

I've been trying to dissolve streams, using orders programatically and I came across this VB script. The reason is that if I use ArcGIS dissolve, it merges the confluence of the same orders. I would ...