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

learn more… | top users | synonyms

1
vote
1answer
71 views

How to label line features using python code?

I used the following code to label the line features(roads) in a layer.It works in the console, but not by python code(application) It works for the points too. What did I do wrong? Any help would be ...
1
vote
0answers
18 views

Python Band.SetNoDataValue(), sets all bands at once

Can someone tell me what I am doing wrong? I want to set bands 1 and three to 255, and band 2 to 0. The code below only should only set band 2, but gdalinfo shows that all bands get set to 0. Ubuntu ...
0
votes
1answer
53 views

How to add mdb geodatabase layer (feature class) to QGIS project using python?

I want to add a feature class of a personal geodatabase mdb to my qgs project by code (a plugin I am working on). I am using a command similar to that used for adding shapefiles, but this is not ...
0
votes
1answer
41 views

GPX to shapefile tool error message

I downloaded the GPX to shapefile tool and when I use it I get the following error message: 1 No module named re Failed to execute (gpx2shp).
0
votes
1answer
25 views

How to reference a return value from openProject macro?

It is very good to have available functions on startup.py, I created one to get the qgs project base name and referencing it as a Python expression on the composer thanks to all the information found ...
2
votes
1answer
50 views

Determine spatial average of several tiff files

I am relatively new to GIS. I have a set of tiff files containing a raster each. I would like to average them, though their extents are slightly different. They each have their geospatial data ...
2
votes
2answers
49 views

ArcGIS are two rasters the same? - including null values

I am working on a task to calculate Height Above Nearest Drainage (HAND) - that is the height above the nearest point along the flow path that is on a drainage - not the geographically nearest ...
1
vote
0answers
22 views

How to find QGIS or QT or Python object definitions

I am attempting a simple plugin, on QGIS 2.6, using the available QT Designer installed I have successfully loaded a plugin, and can display a dialog box with widgets, within, and now attacking ...
0
votes
1answer
55 views

How to set feature coordinates to values in attribute table?

I have some shapefiles that were produced programatically, and everything came out okay EXCEPT that the geometry information was not written correctly. The coordinates for each feature are null. ...
2
votes
1answer
63 views

Is it possible to render a large number of shapefiles to a pdf document using Python?

I'm extremely new to GIS, and recently made a map by loading a bunch of shapefiles into QGIS using a python script. However, it took 15 mins to scroll in or out on the image, and the pdf export ...
3
votes
1answer
41 views

QGIS using the heatmapplugin from the console

I have to make a lot of heatmaps from csv's. Therefore I'm making a python script to run in the console. So far I can load csv's and save them as shapefiles. To get to the heatmapplugin I'm using the ...
1
vote
1answer
39 views

Qgis Python console print statements not working

I have a small problem with the Python console in Qgis. I am working through some introductory tutorials on Python scripting for Qgis. I have a script that loads layers, then queries the canvas for ...
0
votes
1answer
23 views

Data frame index

Can anyone know how to make index ,in arcpy, for a several data frame in one mxd? That question related to this question : Insert layer file to specific data frame
1
vote
1answer
59 views

Calculate value from an equation using Field Calculator Python/VB Script

I wanted to calculate a result value from 3 fields using an equation. VBScript or Python codes are also accepted..:-) the equation is RESULT= [(R^2/3)(S^1/2)]/n..
0
votes
0answers
47 views

Fiona write crashes

I am trying to write a new shapefile with fiona but after creating the features, i keep getting this output after the program crashes: The program '[6668] python.exe' has exited with code -1073741819 ...
1
vote
1answer
56 views

Using if else statement in Python Parser of Field Calculator in ArcGIS for Desktop?

I need help in writing the python script in the field calculator. I have three fields namely: CODE COMPLEX Map1 Map1 is an empty field that I want to populate. I have a number of conditions to cater ...
1
vote
3answers
67 views

Determining Y coordinate for Create Fishnet from desired Angle of Rotation in Python/ArcPy?

On the ESRI website it says: How_Create_Fishnet_works Calculating a value for the y-axis coordinate If you know the angle of rotation, you can compute a value for the Y-Axis Coordinate parameter as ...
-1
votes
1answer
51 views

What application server or web framwork to use

I'm looking to make a webmapping app, which gonna use Geoserver as carto server, and Postgres/postgis as Dabatase, and Extjs as client UI. but i'm in dilemma in application server side, between PHP, ...
1
vote
0answers
35 views

ArcGIS script for mapping lat/long coordinates to boxes/rectangles? [duplicate]

Working on a project that requires me to take lat/long coordinates and map them as rectanglular boxes on ArcMap 10.1. To be clear, the upper left & lower right corners of each box/rectangle are ...
1
vote
3answers
119 views

Field Calculator - How to evaluate and sum multiple fields?

I'll do my best to describe the problem - my main issue isn't so much the python code but rather the logic I'm using. The file I'm working on is a polygon shapefile with forest attribute data. In the ...
-1
votes
3answers
67 views

Insert layer file to specific data frame

I have a folder that contain mxd's projects. Each mxd has 3 and more data frame. I want to insert layer file to a specific data frame with position in the TOC. I don't know how to do it. I'm trying ...
3
votes
1answer
147 views

Export Model to python script in QGIS 2.6?

I just wanted to ask where the export model to python script option has gone in QGIS 2.6.0? Thanks
0
votes
1answer
81 views

Calculate Field based on two fields using python

I'm trying to calculate new values for a field based on two other fields. In VB I don't have any problem, but I need to use python to publish my gp service.
0
votes
1answer
47 views

Get shape file polygon attribute value at a specific point using Python (e.g. via PyShp)

I have a shape file comprising multiple polygons. These polygons have attributes. I am trying to write a script in Python that takes a co-ordinate point, determines in which polygon it falls, and ...
0
votes
2answers
102 views

Convert shapely polygon coordinates

I am trying to work with a shapefile using shapely, fiona and python. The original coordinate system is in latitude and longitude that I am trying to convert to state plane system. So I want an ...
2
votes
1answer
97 views

How to create a Qgis python script to manipulate fields with some parameters?

I'm just beginning with QGIS. I have a shape file with 10 fields field1, ..., field10, and many thousands of data. I will like to automatize the next sequence (in a python script or a model): load ...
1
vote
0answers
67 views

Link QGIS to Anaconda Python Distribution: Spyder, iPython Notebook, pip, scikit-learn

I have Anaconda as my primary Python distro, and want to route Python related QGIS scripts through it. With Anaconda, I have Spyder, can easily install packages with pip, and can launch a iPython ...
2
votes
0answers
78 views

Matplotlib error when installing Molusce or lifemapper in QGIS Brighton

I am installing plugins via the QGIS desktop internal interface, and have had twice now messages associated with matplotlib. The first error was for something called lifemapper and now for MOLUSCE. ...
0
votes
1answer
67 views

Transform lat long to state plane coordinates

I am trying to convert a set of lat long to state plane coordinates using python and pyproj. The location is Tennessee and this gave me information about the central meridian, lat origin and the proj ...
2
votes
1answer
120 views

Convert GeoPDF with GDAL

I'm attempting to convert a USGS US Topo GeoPDF in Windows. I'm using GDAL 1.11.1. My initial attempts were with this Python script, which automates the process by feeding a command to the Windows ...
1
vote
0answers
19 views

How do I make arcpy exclude frozen / off layers while importing a DWG file?

I'm attempting to update existing GIS feature classes (SDE) using master AutoCAD files but end up importing ALL features present in the AutoCAD drawing regardless of the visibility settings (frozen / ...
1
vote
1answer
189 views

How to fix python ImportError: DLL load failed: The specified module could not be found?

During import fiona, I am getting following error. Error is different from other user so I asked this question may be it is repeated. import fiona Traceback (most recent call last): File ...
3
votes
1answer
47 views

How to filter QGIS layer from python?

Using QGIS 2.4 python console, I'm trying to display only a subset of a layer features. I've managed to get the features both from the layer : featuresIterator = ...
2
votes
2answers
78 views

Python Add-in- Message Box to display area of selected polygons

I am looking to create a Python AddIn which calculates the area of selected polygons. I would like to be able to select the features, click a button on the toolbar, and a Message box displays the sum ...
2
votes
1answer
43 views

How to add documentation for QGIS Processing algorithms?

In the Processing modeler, many of the algorithm help tabs say: Sorry, no help is available for this algorithm. In the QGIS sourcecode, the processing algorithms seem to reside in: ...
2
votes
2answers
104 views

Select the most recent date from a table using Python/arcpy

Given a dataset with a date field, how would I select the row with the most recent date using Python or ArcPy?
3
votes
0answers
13 views

Action: Move pointfeature to other layer - Point becomes Multipoint

I'm trying to write an action that moves a pointfeature from one layer to another. It works fine until i try to save the layer with the new feature on. He says he can't save a MULTIPOINT to a ...
0
votes
1answer
50 views

How to make polygons clickable in Leaflet.js / folium

I'm trying to create a clickable leaflet.js map using folium and Python. After a previous query - answered here Geopandas/folium map not displaying - I've added the polygons. But I'm getting a ...
0
votes
0answers
54 views

How to create shape file and show in map using Python?

I have calculated distance between longitude and latitude by import .csv using python. Now I want to show this points or distance between points in map. So how can i do it by using only python? and ...
0
votes
0answers
45 views

GeoTiff using GDAL

How can I project a tiff using the position of the four corners where the picture have to be placed ? The tiff file has no georeference or projection information I have got a grid with values of ...
0
votes
2answers
47 views

Understanding EOL while scanning string literal from Reclassify in ArcPy?

I'm trying to reclassify a raster using a Python script. I know I can just use the tool in ArcMap, but I want to start understanding the code behind it. Can anyone tell me why this doesn't work ...
4
votes
1answer
153 views

Understanding the Use of Spatial Indexes

I'm having trouble understanding the use of spatial indexes with RTree. Example: I have 300 buffered points, and I need to know each buffer's intersection area with a polygon shapefile. The polygon ...
0
votes
0answers
37 views

Is there a faster alternative to arcpy spatial join?

I am wondering if there is a more efficient method than using arcpy spatial join in python. I am currently using intersect and closest methods (including a near distance field) so would need ...
1
vote
1answer
54 views

why does arcpy function work in ArcMap python window but not from stand-alone script?

So I think I'm running into a data/schema lock issue, but I have no idea how to tell, or how to fix it for that matter. Here's the setup: I have this chain of gp functions: #extract elevations to ...
1
vote
2answers
129 views

How to create a series of points along multiple polylines at once in ArcMap 10

I have a series of polylines that represent linear vegetation (shelterbelts, etc). I need to convert these to a series of points equally spaced in order to add them to a different shapefile that ...
1
vote
1answer
30 views

Why does the python editor “Idle” reference two Python installations?

I have installed python 2.6 with ArcGIS 10.0 but also Python 2.7 for use with gdal. I have a problem at the moment with the editor "IDLE". When I right-click on a .py script, the idle editor ...
3
votes
2answers
63 views

PyQGIS: Speed up for adding features and attribute arrays?

Context: I'm writing a dynamic import tool for QGIS (2.2 to 2.5) with python. Datatype: Binary Datasets with environmental simulations from HPC which might contain millions of features and terabytes ...
1
vote
1answer
85 views

How can we merge the two selected features in a vector layer

I have taken one feature and find which are the neighbouring features to the feature which i have taken and then i have combine all those neighbouring features with my feature to make one feature. i ...
2
votes
0answers
51 views

How to add column to attribute table using field calculator with $length function?

I used the following code to add a separate column to the attribute table with the length of features. from PyQt4.QtCore import QVariant from qgis.core import QgsField, QgsExpression, QgsFeature ...
2
votes
1answer
118 views

How to load a WMS layer using PyQGIS?

Although there are some posts on this matter, there is no answer in anyone of them. This is why I am asking it again. One post I found was Raster layer invalid I read information from the following ...