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

learn more… | top users | synonyms

1
vote
1answer
22 views

ArcGIS10.2 Data Merge error: 000732

I am running python in the ArcGIS python window. ArcGIS shows error message when trying data merge from arcpy. File "", line 1, in File "c:\program files ...
0
votes
0answers
24 views

Import GRD and count days with temperature below zero, using python

Minimum temperature of a year is given in GRD file. I have to read that file and then calculate the frost day (less than zero degrees celcius) from it in python.
0
votes
1answer
26 views

Geodjango read raster files

I am developing a web app in geodjango (django) framework but I need to import raster files. Is it possible a geodjango app read raster files from a directory? Thanks
0
votes
0answers
24 views

QGIS custom form and autocompleted data entering with “validation check”

In Qt-Designer I created a custom form where I can choose serveral species names in two different combo boxes. This combo boxes are linked via "value relation" to the accordant non spatial tables ...
0
votes
1answer
30 views

arcpy to perform “select by attribute” and display the result on the map in a table [duplicate]

I am thinking to use arcpy to select by attribute, after that I want to display the selected features attribute in a table on the map, how can I make it? Thanks in advance.
0
votes
0answers
9 views

argument 1 has unexpected type error when parse xml with ElementTree

I try to make plugin in QGIS Dufour to open and read xml metadata and then to show some information in metadata i try to parse it with ElementTree and then show it in QLineEdit, this code i use to ...
0
votes
2answers
21 views

Keep leading zeros when converting .txt into dbf using CopyRows management

I am writing a python code in order to bring my.txt file into a dbf file in arcgis. I am using CopyRows_management which seemed to be working just fine until I realized that one of the 40 fields from ...
2
votes
0answers
22 views

ArcGIS10.2 crash opening python window

I was trying to test the data management commends in python, yet arcgis crash every time I I try to open to python window. According this post, it is the python version issue. I do have other versions ...
0
votes
0answers
14 views

how to find close and parallel lines

I need help with script for QA of water network. I need to find all lines that are almost parallel and close to each other less then 2 meters. The script have 3 stages: add azimuth field and ...
1
vote
1answer
80 views

Secure credentials for scheduled python script targeting ArcSDE 10.1 on AWS

I have a python script that will be used as a scheduled task. Our dba team is wanting the credentials to be as secure as possible. I would say that using the os security system as far as locking ...
0
votes
0answers
17 views

aggregate counts on a grid and determine grid adjacency

So here is the problem I am working on. I have a bunch of lat, long coordinates for event occurrences. I want to create a grid and then count how many points fall into each grid pixel. Once I have ...
0
votes
1answer
24 views

create polygon adjacency matrix using python

I am trying to create an adjacency matrix from a set of polygons. That is, I have a bunch of polygons and I want to identify which polygons have a common edge or "touch" each other. Once I find this ...
2
votes
1answer
33 views

How to use the List field function for a toolbox script?

i´m trying to write a simple script for a toolbox, similar to the Addfield_datamanagement toolbox. The script adds a new field to a table of a feature class or a shapefile with attribute tables. So ...
0
votes
0answers
78 views

How to export from ModelBuilder as script and then run using Python. 3.4?

I'm currently studying for a Msc in GIS. In my assignment I have been asked to produce a model builder, export that model as a script file and then run that script as a stand alone in IDLE. So ive ...
0
votes
0answers
15 views

Error 14: Could not open CRS database

I am using Python Console and loading a Vector Layer using python commands. When the layer is added, QGIS first asks for the CRS to use, but I don't have all the CRS listed out to select the Reference ...
-1
votes
2answers
29 views

How to use raw_input() with while-loop? [on hold]

my task is to execute multiple buffers with the list-loop! import arcpy arcpy.env.overwriteOutput = 1 arcpy.env.workspace="C:\\salzburg.gdb" sbgRivers="sbg_rivers" buff_name=raw_input("Please ...
0
votes
1answer
72 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
0answers
18 views

Problem with polygon overlay in raster stats using gdal

I am using the raster_stats module in python to calculate the mean carbon value for different sets of polygons. Here is the code that I am using: africa_sat = ...
1
vote
1answer
43 views

My class using ogr to calculate distance is returning incorrect results away from the equator

In an answer to this question ustroetz kindly provided some sample code for use of ogr to do lat/lon distance and point in polygon calculations. I've created a Python class based on his example to do ...
0
votes
1answer
23 views

Calculate text field based on codeblock query of numeric field

I am trying to populate a field with a L/R bank designation based on a route measure (as part of a larger script), but I am struggling. I have a shapefile created (tir_pts_lyr), I have a blank column ...
1
vote
1answer
36 views

Excel/Google Docs > Plss Map [on hold]

Is there a way to map out PLSS (Public Land Survey System) TWP (township),RNG (range) and Section based off a field in google docs? I was thinking if you had your first column with the PLSS area in ...
6
votes
3answers
121 views

Python resource for remote sensing?

I am looking for a good resource (MOOC, book, etc..) to teach Python for remote sensing applications. I am already familiar with http://www.rsgislib.org/ - are there any other resource out there for ...
3
votes
1answer
126 views

Unable to get python-qgis-common on Kubuntu 14.04

just upgraded my Kubuntu from 13.10 to 14.04 LTS and lost all plugins. Found out that "python-qgis-common" is not installed. Tried to install it but was told that it depends on "sip-api-10.1" which ...
-1
votes
0answers
45 views

How to return value into a python list using search cursor [closed]

I would like to retrieve the temporary value which are done from searchCursor. I want those values to be stored inside an array (preferably a 2D array, as i have to store objectid,x,y , also there is ...
3
votes
1answer
49 views

Are the functions in OGRPolygon accessible through the python bindings?

I'm currently trying to use the OGR python bindings to process some shapefiles. I want to obtain the number of interior rings in a polygon feature. Unfortunately I'm unable to use the documented ...
0
votes
0answers
22 views

MODIS images set CRS and reproject

I am developing a plugin which reads MODIS images, and I know that MODIS images are in sinusoidal projection and I need to set that CRS and project the image to WGS84 (epsg 4326) in python. I search ...
0
votes
0answers
22 views

What is the Python numpy equivalent of the IDL # operator? [closed]

I am looking for the Python numpy equivalent of the IDL # operator. Here is what the # operator does: Computes array elements by multiplying the columns of the first array by the rows of the ...
2
votes
0answers
8 views

How to access annotation feature classes in ArcPy? [duplicate]

I want to batch replace paths in a series of .mxd files using Python. Many of the layers have moved and in some cases the name has changed or its dataset is different. I've written this code which ...
-1
votes
0answers
33 views

I am trying to clean up my data that I created but it is not stripping anything [closed]

I am trying to strip <br> among other things but when I print it out or look in my text file, nothing happen. The code runs without any error but it will not strip <br>. import urllib ...
0
votes
0answers
16 views

runCommand in pymongo

I run the following query on my mongoDB console: location = db.BLR_all.findOne( { $and: [{"geom.type":"Point"},{"REGION": "KORAMANGALA"},{"E_NAME": "RAILWAY BOOKING CENTER"}] }) db.runCommand({ ...
4
votes
3answers
110 views

Bulk convert DBF to CSV in a folder ArcGIS 10.1 using Python

I would like to convert 1000 dbf files to CSV. All dbf files are in one folder and they have sequential names (S:\output_tables\tcb1.dbf, S:\output_tables\tcb2.dbf, S:\output_tables\tcb3.dbf, up to ...
0
votes
0answers
15 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 ...
3
votes
2answers
128 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, ...
0
votes
1answer
22 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
0answers
20 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 it doesn't populate unless I reload the plugin. def __init__(self, iface): ... ...
2
votes
2answers
49 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 ...
0
votes
2answers
63 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
1answer
43 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 ...
1
vote
1answer
39 views

Problem with Intersect_Analysis : too long path? [closed]

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
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 ...
0
votes
2answers
26 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 ...
0
votes
0answers
15 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 ...
3
votes
1answer
71 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
25 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 ...
3
votes
3answers
363 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), ...
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
16 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
40 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
69 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() ...
0
votes
0answers
29 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 ...