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

learn more… | top users | synonyms

3
votes
1answer
113 views

Creating a polyline from point data that represents multiple linear features in ArcGIS 10.0

I have a problem where I have to somewhow create a polyline feature class in ArcGIS 10.0 from points that were collected in the field using a Trimble GeoXT that represent the start and end of multiple ...
0
votes
0answers
17 views

GRASS r.out.mat memory issues

we have built a model with pythn/GRASS that calls the r.out.mat module. The area is quite large 25,000x25,000 cells. The machine we are running it on is Windows 7 machine with 16GB of RAM. After a ...
0
votes
0answers
25 views

pyQGIS (Spatial Join): Sum features of attribute from point layer and join with vector layer

I am new to Python and QGIS. I have avoided asking questions up to now. But by now I have developed a reasonable idea of where i want to go so and where I am stuck. So, I have decided to ask but sorry ...
4
votes
1answer
282 views

QGis Zonal Statistics Plugin NoData included in Calculations

I have been trying to use the QGIS zonal statistics plugin. My raster has a nodata value of -99999 and all other values are positive. After computing the mean zonal statistics there are a number of ...
1
vote
1answer
33 views

How can I do a definition query on a layer and zoom to it?

I am trying to do definition query to a layer and to zoom to the same layer, but I got an error ("SyntaxError: can't assign to operator") ?? dataFrame = arcpy.mapping.ListDataFrames(mxd)[0] # the ...
1
vote
1answer
26 views

Resampling with Python console (QGIS): number of parameters

I am trying to resample two raster layers with Python console in QGIS with this code: outputs_0=Processing.runAlgorithm("saga:resampling", ...
7
votes
7answers
13k views

Full list of ISO ALPHA-2 and ISO ALPHA-3 country codes

I'm searching for a full list of countries with their country codes. Like on this page (need full and valid): http://www.nationsonline.org/oneworld/country_code_list.htm Thanks.
0
votes
1answer
39 views

Definition Query then Zoom to Layer Automation?

I'm trying to create something in here. I want to have an automated process of doing a DEFINITION QUERY then ZOOM TO LAYER with one step. the concept is like that, a dialog comes up with one form ...
0
votes
1answer
25 views

How To Turn Off Map Drawing When Using Python in ArcMap?

I have a Python script that creates layers in ArcMap. The script works fine, but when a new layer is created a map is always automatically drawn, which makes the script take longer to process. I ...
-2
votes
0answers
30 views

Error 0100060 while running Extract by Points? [on hold]

The resources have not been much help here. I can run this same process hardcoded in the IDE, however through the tool dialogue it gives the following error? Any thoughts? ExecuteError: ERROR ...
2
votes
1answer
491 views

How to debug 'Layer is not valid error' from Python plugin?

I'm trying to understand what goes wrong with a QGIS python plugin. Basically I'm trying to render a series of POINT. The query works fine, at least giving it by hand from inside PostGIS DB: "SELECT ...
0
votes
2answers
34 views

If-Then-Else statement in ModelBuilder has improper syntax

I have a model that converts a road network into a different schema for a different program. In one step of the model I am converting values for a field "Class". I wrote an If-Then-Else statement in ...
0
votes
0answers
21 views

QgsMapRenderer to export current extent using PyQGIS

I am trying to accomplish PyQGIS simple map rendering via the QGIS 2.0 Python console, but end up with only a blank image. I've followed instructions of this link. My objective is to export a simple ...
1
vote
0answers
22 views

Automating polygon mergers with python

This is the first real world python program am trying to write. I am trying to create a scrip that takes a shapefile that has n polygons with an integer formatted date (e.g. yyyymmdd or 6/24/2014 is ...
1
vote
1answer
31 views

gdal_proximity distance to meters

I followed the answer given in this topic for searching the distance to the nearest coastline given a lat/lon coordinate. The distance output obtained is in degree (I think) but I need the distance ...
1
vote
1answer
41 views

how to separate a list of features from its shapefile_

I tried to copy all features in a list of dictionaries. the code looks as follows: def iterate_features(self): feature_set = arcpy.SearchCursor(self.address) for feature in feature_set: ...
1
vote
1answer
27 views

Can't get SRS from PostGIS using Proj4 text

I'm having a problem transforming a point from the Australian MGA UTM datum (eg MGA Zone 51 http://spatialreference.org/ref/epsg/28351/) to WGS84 using GeoDjango. I've narrowed that down to a problem ...
1
vote
1answer
102 views

How to Average neighboring county data and store in original?

I have data for several rain stations, i have averaged the data and given each county a value. Some counties have null values and I would like to pull the data from the all the bordering counties and ...
1
vote
0answers
23 views

Python error message after download (QGIS 1.8.0/ Windows 7)

Hello to all members of the forum, I downloaded from the OSM website a small area in the neighborhood of Strasbourg, France: X (longitude): 7.6808 7.8216 Y (latitude): 48.5075 48.52 I got the two ...
0
votes
0answers
10 views

maptool doesn't receive key pressed events after QMenu.popup() function

I am developing a qgis python plugin which uses a maptool receiving key pressed events by keyPressEvent(self, event) function, mouse movements events by canvasMoveEvent(self, event) function and mouse ...
15
votes
3answers
3k views

How to call gdal_translate from Python code?

Is it possible to use some gdal API to call gdal_translate from Python code? I do not mean simply executing the gdal_translate.py from the file system, but rather call it somehow in code so I do not ...
0
votes
0answers
43 views

gdal_translate from within pyqgis [duplicate]

I want to use gdal_translate from within a python script in my plugin qgis2leaf. I've tried with ...
4
votes
5answers
989 views

How to use python to turn a .dbf into a shapefile

I have been scouring the internet trying to find a pythonic (sp?!) way to process this data.. Everyday we will recieve a load of data in .dbf format (hopefully) - we then need to save this data as a ...
0
votes
0answers
27 views

Suggested Workflow for Generating NITF (w/headers) using Nitro in Python

It seems that there is no real suggested workflow for generating an NITF file from a georeferenced, validated tiff image. Here are my inputs: Pyramid Tiff Image - georeferenced MBR (minimum ...
5
votes
2answers
149 views

Replacement for ArcScripts

Does an equivalent of ArcScripts exist? I know of the the ArcGIS resource center and "Code Galleries" but does something that equates to ArcScripts where users share useful ArcGIS code exist? The new ...
1
vote
1answer
48 views

How to use the MMQGIS plugin through the Python console?

I know how to make Hub Lines using the GUI, I want to know how to do the same using the Python Console, a tutorial would be great. Thank you
0
votes
1answer
194 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
1answer
123 views

Clustering polygons by sum of values

I would like to group polygons that (1) are contiguous and (2) when the combined values of field X >= Y. Specifically I am grouping zipcodes that are connected. a group is when 1 or more zipcodes ...
0
votes
0answers
30 views

How to get Coordinates values from the latitude and lontitude [duplicate]

I having the form, i have two fields, Latitude and longtitute, if i put the value from here, i need automatically mapping on the map. I want to get the value from Lat and Long, it must be generate ...
0
votes
1answer
127 views

Importing otb into Python

I have Python 2.7 (installed together with ArcGIS 10.1). Via OSGeo4W a have installed qGIS and otb application.I was able to connect qGIS and otb and it's working fine. Through OSGeo installer I ...
1
vote
1answer
135 views

Using a Select By Location in Python and Calculating a field based on what State Plane a point falls in

Here's what I have so far. Do I need to make another feature layer based on the selection? import arcpy arcpy.MakeFeatureLayer_management(r"PATH TO THE POINT", "point_lyr") ...
4
votes
1answer
66 views

XYZ Clustering in Python and numpy arrays

I am looking for a method of clustering XYZ data in Python that works on numpy arrays. I know of a few sources, such as clusterpy and Pysal but have had little success with them as they seem to still ...
1
vote
2answers
36 views

How to switch to edit mode vector layers, in pyqt application based on qgis?

I do QGIS based application, I need to implement the ability to modify the geometry of vector layers in manual mode (editing nodes), how to do it?
1
vote
1answer
150 views

How to construct a line from points in pyshp?

I am reading a shapefile for a pipeline and what I've noticed is that if I just draw a line from one point to the next (in the order I read them), there will be points where the line terminates, and ...
1
vote
1answer
142 views

Comparing field values to update new field using ArcGIS for Desktop?

I am currently doing an analysis in ArcMap 10 using python. I have two shape layers, one is a point layer and the other one is a line layer. The point layer have attributes for point's unique ID, as ...
4
votes
1answer
547 views

Using ArcPy for Copy Parallel, Move, etc (from Editor toolbar)?

Since VB can activate the Editor, then use the tools listed in the Editor, such as copy parrallel, I am wondering whether Python can do the same job? I have been searching the website all day. Still ...
0
votes
1answer
389 views

OSRM API - nearest point fed into routing

I am using the OSRM API to (1) determine the nearest point on a road segment from a give random point with http://server:5000/nearest?loc=_lat_,_lon_ The returned coordinates are used then as an ...
2
votes
2answers
637 views

OSR Python testSR.ImportFromEPSG(4326) returns empty spatial reference

This is empty using Python .ImportFromEPSG(4326): import osr #this fails: testSR = osr.SpatialReference() testSR.ImportFromEPSG(4326) print testSR.ExportToPrettyWkt() #why did the import from EPSG ...
3
votes
2answers
188 views

How practical is this workflow, tiling from a complex, multi-step GDAL VRT?

This is probably a cw-candidate, but here goes.. I've got 1002 ~100 MB (5000'x5000') .tif files in a state plane (transverse merc) projection comprising a county-wide, 1-ft aerial dataset. After two ...
0
votes
0answers
21 views

QGIS - Calling interpolation extension from python console

I would like to call the QGIS interpolation extension function (TIN method) (Raster->Interpolate) from python console. I can't find the corresponding function within QGIS API or within the ...
0
votes
3answers
63 views

UpdateCursor 'is not defined' Python

I have several files (shapefiles). Table 1 has only one row with several fields whereas Table 2 has several rows. What I want is to take a value from Table 1 and populate all rows in Table 2. I used a ...
1
vote
1answer
56 views

Using pyshp to merge two shapefiles

I am trying to find a fast way to merge two shapefiles and i ran over pyshp which apparently could do the job. However looks like this is not working for me because i receive the following error ...
0
votes
1answer
255 views

ArcGis Python Script, Calculate Field

Sorry for my English. I am trying to write a Python Script for ArcGis 10.2. #import system modules import arcpy import math from arcpy import env #Set environment options ...
1
vote
2answers
69 views

csv to shp python and formating a row

I´m doing a script to convert csv to shp, but I want to format one of the columns. It´s a string then I´d like to format like this a[8:10]+' / '+a[11:16]+' UTC' being a the value in the column. ...
1
vote
1answer
112 views

Buttons (Ok, Cancel) disappear in “Apri Modulo” from Attribute Table in QGIS 2.0.1

QGIS 2.0 has changed the visualisation of a form opened from the attribute table: instead of opening the form in a separate window, the form is opened in the same one. This is not a problem, but all ...
3
votes
1answer
220 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 ...
0
votes
0answers
54 views

What is GDAL equivalent to ArcGIS Lookup (Spatial Analyst) tool?

I use the Lookup (Spatial Analyst) tool to create several raster layers from a combined raster layer. I know ArcPy can do the same thing. However, I would like to know whether GDAL (or another ...
5
votes
1answer
158 views

Is there a way to use ArcPy module in the python shell that is not with ArcGIS?

I have ArcGIS 10.2 installed on my machine. When ArcGIS was installed, python 2.7.3(32 bits) was also installed. I need python 2.7.5 64bits for some gdal functions. So I installed python 2.7.5 64bits ...
2
votes
1answer
56 views

What are resources to learn ArcGIS for someone who already knew Python [closed]

I know that there are several resources recommendation questions, however, they are all from GIS people trying to learn Python (for example, here). My situation is the opposite: I have worked ...
1
vote
1answer
38 views

How to export a set of layers into multiple PDF(orAI)files, one layer at a time?

I am completely NEW to PYTHON(only took a 3-hr entry course in ESRI tutorial. I have a dataset contains files named as "1_A, 1_B, 1_C....12_A,12_B, 12_c,....200_A, 200_B, 200_C..etc." I need to export ...