A version of the Python programming language

learn more… | top users | synonyms

0
votes
0answers
5 views

Pyqgis 2.2 : get signal on feature added : error message

For my pyqgis plugin 2.2, I try to: def logFeatureAdded(self,layerId,addfeatures): message = str(layerId) + " has features added: " for feature in addedFeatures: message += str( ...
0
votes
0answers
12 views

Pyqgis 2.2 : zoom to layer extent?

Regarding my plugin pyqgis 2.2, i can load a vector layer succesfully. But when i try to zoom to the layer extent it does not work. How to do in order to zoom to the layer extent?
-2
votes
0answers
10 views

AttributeError: 'NoneType' object has no attribute 'extend' [on hold]

my code is displaying the error:"AttributeError: 'NoneType' object has no attribute 'extend'' def poly1(a,p,q): j=2 b=list() b=[a[0],a[1]+(p+q)*a[0]] while (j<(len(a))): ...
0
votes
0answers
26 views

Get signal on edited feature?

Regarding my pyqgis plugin 2.2 , I've implemented signal on a vector layer event successfully. For instance, whenever i create a new feature, i can read a new basic message appeared via QGIS logging ...
0
votes
0answers
18 views

Read esri shape point data and spline interpolation using python shell scripts?

I am quite new in python scripting. I am a dedicated user of arcgis but this time I have to work without arcgis. I have a point shapefile with 10 different attribute fields of different peat layer ...
0
votes
0answers
12 views

Pyqgis :2.2 : link between a signal and an event

I'm writing a pyqgis 2.2 plugin with qgis 2.2 I succeeded in accessing and displaying vector data (geometries & attributes). I succeed also to create a 'beforecomitechanges' signal ( emitted, ...
1
vote
1answer
34 views

raster to polygon conversion

I 'm trying to automate the conversion of raster to polygon and the rasters files are in "TIF" format which is a "unsigned integer". I have the code below. However, I 'm getting an error while ...
0
votes
1answer
45 views

Type Error with ArcPy Update Cursor

filter = 'LinkID IS NOT NULL' cur1 = arcpy.UpdateCursor("ODDS_Links", filter) high_id = 0 for row1 in cur1: if high_id < row1.LinkID: high_id = row1.LinkID filter2 = 'LinkID IS NULL' cur2 ...
3
votes
1answer
57 views

Conditional formatting for Advanced Label Expression in ArcMap

I am trying to do some conditional formatting in order to highlight specific criteria. The main error I keep getting is that there are no features found. I've done a simple label with the exact same ...
0
votes
1answer
29 views

Creating multiple folders named by a list in python [closed]

I am trying to make a python code to create folders named by a list of int and strings, the code below is returning an error, it works when the list is made of strings only, can anybody help ? ...
2
votes
3answers
79 views

How do I insert the string field and calculate it in Python?

Hello I am trying to insert a code that force a column Sum_Acres_ to add a comma to display like this 300,000 from 300000.456 Here is my sample I wrote from a ModelBuilder and export it to python. ...
1
vote
1answer
47 views

sum count column in raster attribute

I am a beginner to python coding in GIS. I want to calculate the total number of counts in raster attribute table. In order to do that: I would like to build a attribute table of raster data use a ...
1
vote
1answer
32 views

ArcObjects SQL Server Connection not recognizing instance

I am trying to make a connection to a SQL Server database with SdeWorkspaceFactory. This is from my Windows 7 x64 Desktop to a Network database. If I use this: SDEWorkspace = ...
1
vote
1answer
52 views

Writing multiple file geodatabase tables into csv file with arcpy

I was asking a question about Merging geodatabase previously, (link: Merge from arcpy.ListTables() producing duplicate rows?) and although the script worked, it took more than 9 hours to run when ...
1
vote
1answer
23 views

Writing list of feature classes with fields to one csv file per feature class?

I have a database with multiple feature classes. Now I extracted a list of feature classes and a list of fields. I figured out how to write the list of feature classes and the corresponding fields to ...
1
vote
1answer
32 views

Python Hyperlinking Script in Arcmap 10.2 [closed]

I have the below python script which recursively walks through a directory and finds, then opens the associated parcel pdf file. How would I modify this to not be recursive but to just look in the ...
2
votes
1answer
73 views

How to get layers from a specific store of geoserver using python gsconfig?

I'm using gsconfig python library to acess geoserver rest, my question is how can i get layers from a specific store ? I'm tried as follow: from geoserver.catalog import Catalog ...
0
votes
0answers
40 views

Changing default precision and scale of number fields in ArcSDE geodatabase table?

After I change the precision and scale for my short, long, float, and double field types when creating a table in ArcMap SDE geodatabase, ArcMap will reset my precision and scale to default values. ...
0
votes
0answers
32 views

Change python installation directory arcgis

I've recently installed arcgis 10.2 on C: of my machine, I did this while my external HDD was plugged into E:, and the installer put python onto the E: Why it would do this I have no idea. Now I can't ...
1
vote
0answers
65 views

How to extract NetCDF raster values to time enabled shapefiles?

Does anyone know a good way to extract NetCDF raster values to each data point from a time enabled shapefile at the correct time? I have tried using a python script tool and a loop that steps ...
0
votes
1answer
76 views

Extracting NetCDF raster values to time enabled shapefiles - what's wrong with my python script?

I'm trying to make a python script tool that extracts the values from a NetCDF raster to each data point from a time enabled shapefile at the correct time. My NetCDF raster consists of monthly sea ...
0
votes
0answers
16 views

take record from ms-access using python and show it in Qt

I have a ms-access database and i try to make QGIS plugin that take record from table and show it in Qt, database have format like this : NO Skala 1 Skala2 Rekomendasi ...
0
votes
0answers
29 views

How do I install PyProj module for Python 2.7 on Windows 7?

I am having trouble installing the pyproj module for Python 2.7 on Windows 7. I have tried both the 32 and 64 bit installers from this list but the install crashes each time I run it. I have the ...
0
votes
0answers
22 views

Use python to execute GRASS module v.distance

I have successfully use python script to import a line shapefile and a point shapefile into GRASS, and the following are their attribute table in QGIS, line shapefile point shapefile Now I want ...
0
votes
0answers
137 views

Postgres SSL SYSCALL error: EOF detected with python and psycopg

Using psycopg2 package with python 2.7 I keep getting the titled error: psycopg2.DatabaseError: SSL SYSCALL error: EOF detected It only occurs when I add a WHERE column LIKE ''%X%'' clause to my ...
1
vote
2answers
70 views

Find all points in a linestring that are contained by a polygon

I'm fairly new to PostGIS, so I apologize if this has been answered before. I have a linestring made up of 4D points and I need to determine which points in this linestring fall within a specific ...
0
votes
0answers
35 views

import libtiff error

I am unable to use libtiff from Python on windows 7. Here is what I get when I try from libtiff import TIFF I do not understand the statement " Make sure that libtiff is installed and its location ...
1
vote
0answers
69 views

Use a Python script to stack layers from multiple directories and produce multiple outputs in ERDAS

I am using ERDAS Imagine 2013 and am trying to create a Python script that takes lists created in another script containing the path to each scene's raw data folder and base image ID's (for example ...
3
votes
1answer
74 views

Reading zipped ESRI BIL files with Python

I asked the question below on StackOverflow, but haven't received any feedback there yet: I have precipitation data from the PRISM Climate Group which are now offered in .bil format (ESRI BIL, I ...
0
votes
0answers
14 views

Parsing file didnt appear in textBrowser

I make QGIS plugin to parsing xml and show parsed file in textBrowser, however when i run the plugin, its still blank ( nothing happend ) and i didn't get error messsage when run it, this is the full ...
0
votes
2answers
39 views

Cell Size parameter for IDW (Spatial Analyst) tool

I am attempting to use the IDW (Spatial Analyst) tool in a Python script however I am a bit confused on what to put for the "Cell Size" optional parameter. When using the tool within ArcMap it seems ...
0
votes
0answers
25 views

Visualize bounding box to square like polygon

I want to add script in my plugin to visualize bounding box into a polygon shape, bounding box i try to visualize have format like this: (X1,Y1) (X2,Y2) (X1,Y2) (X2,Y1) Does QGIS/PYTHON have ...
1
vote
1answer
217 views

How to create a polygon feature class from polylines in Python Arcgis?

I am trying to create a polygon from polylines. I've created this script but it gives errors of Arrays. Thanks. import arcpy polyline=r'C:\temp\temp_lines.shp' ...
0
votes
0answers
29 views

Producing latitude longitute coordinates in csv file based on place names on existing csv file

I have a code that takes the HTML code and extracts the table to put it in CSV file. I want to further take the place names inside csv file and add two columns that show lat and longitude. Here is ...
1
vote
1answer
59 views

Habitat fragmentation tool error

I am trying to calculate the habitat fragmentation of a forested region in Africa in order to protect the areas less fragmented. I have used the tool "Landscape Fragmentation Tool V2 requiring Spatial ...
0
votes
2answers
95 views

Python ArcGIS 10.0 Expanding select layer by location from point (walking selection)

I have an old ArcView 3 tool which I've been tasked with converting to Python. I'm breaking it down into stages, but there's a "walking selection" I can't trap. To put the query in context, the user ...
1
vote
1answer
54 views

Unexpected output when using gdal_rasterize

Ok, I used the following code for converting my layer into raster format but I get a tif file that is completely black or white... from osgeo import gdal, ogr # Define pixel_size and NoData value ...
0
votes
1answer
14 views

Fiona error on installation

Receiving the following error when installing Fiona.Does anyone can guide ? error: Unable to find vcvarsall.bat
1
vote
0answers
44 views

Programmatically selecting features by polygon

Expanding upon this post how could you use QGis to programmatically draw a selection polygon and select features within the polygon? I have been using QgsMapToolEmitPoint(self.canvas), to find and ...
0
votes
1answer
79 views

batch buffer with different distances with python 2.7 in arcgis 10.1

I am trying to write a "smart" way in Python to process multiple buffer to lines, polygons and points with different distances. I use Python and ArcMap 10.1. I can figure out to separate lines, ...
2
votes
0answers
47 views

How to use matplotlib with ArcGIS 10.1 without Microsoft Visual C++ Runtime Error?

I have problems using the matplotlib for python with ArcGIS 10.1 If I run the code below as a script tool in ArcMap. No pdf is generated and when I close ArcMap this error is shown. If I run the ...
2
votes
4answers
55 views

How to Add (+) up integers in a field and print a total count in pyhton 2.7

I'm a complete beginner to python. I have what I hope to be a simple question. I want to run a bit of script in IDLE so that it adds up all figures in a table under attribute name "Tot_Aff". When I ...
1
vote
1answer
70 views

Find minimum elevation along a polyline and return xy or point?

Using ArcGIS 10.1 and Python IDLE 2.7.2... I'm trying to find the minimum value of a polyline with a raster layer and turn that LOCATION into a point. I put everything together in model builder, but ...
1
vote
0answers
57 views

How to create a circle vector layer with 12 sectors with Python and to save average value of underlying raster in each sector?

Hi I am writing a code with Python 2.7 using Arcpy 10.1 and I guess I am doing stuck with a silly problem that lies under my eyes. I have created a grid of points (with "Create fishnet" function) over ...
0
votes
1answer
65 views

Unknown error concurring when developing QGIS 2.0.1 plugin in Windows 7

I am following the tutorial found here for developing a simple QGIS plugin within QGIS 2.0.1 installed on Windows 7. However, as I have began to try developing a link between the GUI and each the ...
6
votes
1answer
340 views

Increasing speed of Python scripts using arcpy

Update 4/11/2014 It looks like the script was getting hung up on the Delete Features tool, so I switched to Truncate Table, as suggested in the answer below. I also removed the unused variables from ...
0
votes
1answer
23 views

how to calculate the average temperature of each band of a .grd file?

I am having a GRD file in which the temperature at different longitude and latitude are given in a 32x35 array for one day(band),i am having 365 such bands and want to calculate the average of all ...
4
votes
1answer
115 views

How to select all values by default in arcgis tool's multivalue parameter using python?

I am using ArcGIS 10.2 and have three parameters, Feature class, field and a multivalue parameter respectively in ArcGIS tool. I populate multivalue parameter with unique values of feature class on ...
0
votes
1answer
20 views

GRASS module g.mremove returns irrational outputs

I want to use g.mremove to remove multiple files in my mapset, import os import sys sys.path.append(os.path.join(os.environ['GISBASE'], 'etc', 'python')) import grass.script as g import ...
0
votes
0answers
21 views

saga_api python library : raise AttributeError(“No constructor defined”)

Good morning, I'm traying to execute a python script using saga_api library, unfortunately I'm stoped in the first step :(. when I tray to execute this command on python: ...