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

learn more… | top users | synonyms

0
votes
1answer
188 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
121 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
121 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
126 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
56 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
31 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
148 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
140 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
538 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
378 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
621 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
183 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
20 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
61 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
51 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
243 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
63 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
111 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
219 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
146 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
37 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 ...
2
votes
2answers
330 views

Interpolation iteration using ArcGIS- arcpy

My current project requires interpolation of state level weather data. Approximately 5 years of daily data needs to be interpolated. I still need to figure out the best interpolation method. However, ...
1
vote
1answer
53 views

How to use Fields in the Field Calculator? [duplicate]

I'm using the Field Calculator in ArcMap and I need to create a unique ID for every storm drain in my county. An ID Should look something like this: 16-I-003 The first number is the municipal number ...
3
votes
1answer
148 views

Load and display a layer using PYQGIS

I'm having a go at using pyqgis from within the QGIS python console to load a layer from SQL Server and display it. I feel like I'm part way there but I'm having a real issue getting the layer to ...
1
vote
2answers
48 views

Getting error after trying to harvest from geoserver into pycsw

I'm using osgeo live to test the pycsw functionality. I need to harvest metadata from an existing Geoserver service (previously configure for this task). I'm quite new with CSW and I'm not sure if my ...
3
votes
3answers
2k views

Basic If/Then in ArcGIS 10.2 Field Calculator (Python or VB)

I've been looking through these threads and can't seem to figure out my answer yet. Very new to VBA and Python, but lots of years with Arc.I know I can do this the slow way with Select By Attributes, ...
0
votes
1answer
33 views

Adding field to table without path to table (python) [closed]

I want to add a field to my table in the FieldCalculator. import arcpy arcpy.AddField_management("veg8", "test", "TEXT") An error message occured doing this and I figured out that I need to set a ...
1
vote
1answer
61 views

Arcpy: List to point feature class

I have a list of lists that contains: [vala, valb, valc, vald, (pntx, pnty)] [vala, valb, valc, vald, (pntx, pnty)] [vala, valb, valc, vald, (pntx, pnty)] I also have a list of the field names that ...
1
vote
1answer
43 views

Map project a raster having separate latitude and longitude raster bands

I have a satellite image where one of the channels is a raster having the longitude values, another channel a raster containing the latitude values. What would be the best way for map projecting such ...
1
vote
3answers
78 views

Merging many to one data rows in arcpy [duplicate]

The dataset 'left_right_merge' at the bottom of my screen shot shows the dataset that I'm currently working with. The NODE values indicate a single point feature, but is duplicated with many ...
1
vote
2answers
78 views

Conditional Calculate Field Many to One

Anyone have experience calculating a field based on a many to one scenario? I have a feature class in a geodatabase with a field of unique names. Feature Class Table (let's call this ...
8
votes
1answer
919 views

Importing GDAL from Python window of ArcGIS for Desktop?

I am trying to run some Python code using the Python window in ArcGIS 10.1 that uses both the arcpy and gdal modules. However, when I try and import the gdal module I get an error: ImportError: No ...
0
votes
0answers
17 views

PyQt QTableWidget for QGIS python plugin: infinite loop issue

I'm using PyQt4 and Python 2.7 to develop a plugin for QGIS 2. I have QTableWidgets used to display/compare existing information in the database with newly entered information pertaining to the same ...
0
votes
3answers
82 views

Finding coordinate pair at any given distance along calibrated route?

Goal: given a route as a set of ordered coordinates, measure the overall distance of the route and be able to access the coordinate pair at any given distance along the route. Application: I'm ...
1
vote
2answers
40 views

Set parameter of field from number to string with python

since I realised python is a very useful tool in ArcMap I dont want to do any workarounds anymore. I have a field with is numeric, but I want to perform this calculation in the field calculator on it ...
1
vote
3answers
150 views

More Efficient Spatial join in Python without QGIS, ArcGIS, PostGIS, etc

I'm attempting to do a spatial join much like the example here: Is there a python option to "join attributes by location"?. However, that approach seems really inefficient / slow. Even ...
0
votes
0answers
55 views

How to keep all the unique columns of the shapefiles after merge?

Writing a script where the user is asked to select a directory which contains Folder_1 and Folder_2, both containing shapefiles and run various algorithms. The basic logical process of the script is: ...
0
votes
1answer
96 views

ArcGIS 10.2.1 Table To Table tool in Python script gives ExecuteError: ERROR 001156?

I work for an organization that just upgraded from esri arcmap 9.3.1 to 10.2.1 and I'm currently in the process of updating the python scripts. When running a script I'm getting hung up on a portion ...
2
votes
1answer
64 views

How to implement 1:n joins with string attribute concatenation?

I have a question concerning pyQGIS. I'm a QGIS long-time (self-learned) user, but just a pyQGIS newbie. I want to implement 1:n spatial join with attribute concatenation in the table. I have a vector ...
3
votes
0answers
50 views

How to find the minimum number of inspection points?

I am working on a pipeline inspection project and there is a high liklihood that some inspection tool deployment/retrival station will need to be installed on the pipe network. the problem is ...
0
votes
2answers
64 views

Any clue how to read a .style (ArcGIS) file in Python, for converting into another platform-specific format? [duplicate]

The problem I am face with is that I have all my data as shapefiles but my organization works with only 1 ArcGIS license. Migrating to QGIS to prominent amount of work, I need to convert my ArcGIS ...
3
votes
2answers
165 views

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.
1
vote
2answers
73 views

Calculating distances between points two feature datasets

I will do my best to explain my problem. I have two feature datasets. One set has about 100 points that are "city centers." The other dataset has points for each census tract in each of these 100 ...
5
votes
1answer
314 views

Is there a python option to “join attributes by location”?

I am trying to perform the function join attributes by location as found on the QGIS menu Vector>Data Management Tools. I am seeking an open source python option for this. I know arcpy has a spatial ...
1
vote
3answers
150 views

How can I save a column from the attribute table of a vector layer to a variable?

I am trying to write a python plugin for QGIS that can convert three vector layers into an object File for an urban climate model. Unfortunately I am stuck again with a possibly easy question: How ...
0
votes
1answer
107 views

Creating a python script to import an excel spreadsheet, create shapefile and do some analysis

I am trying to write a script that does the following. Imports an xls file containing x, y, and other columns with data. I want to make this into a point shape file. I want to take that point ...
0
votes
1answer
42 views

Calculate tree cover over certain area from raster data

Last year Hansen et al. published Global Forest Change map as set of raster data available in TIFF format. Basically those are 30-meters resolution satellite images with pixel values ranging from 0 ...