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

learn more… | top users | synonyms

1
vote
1answer
44 views

Arcobjects- IAnnotateLayerPropertiesCollection2.QueryItem in Python

Anyone tried access label properties trough ArcObjects with Python? I try to obtain reference to label object with IAnnotateLayerPropertiesCollection2.QueryItem, but when I do: pA = ...
1
vote
1answer
39 views

How to export Std Dev from Raster Dataset of DEM to classify current extent and execute Contour Tool with Python?

I want to create Countour Lines for a DEM which are based on a "STD dev" classificaion. My problem is that the "Std dev" is exported in an unknown type instead of a String. So the classifacation for ...
1
vote
2answers
385 views

Fiona ImportError: DLL load failed

I've been using the great Shapely/Fiona combo successfully on Linux, but now i need to create a kind of production environment on windows and theres only one problem. When i try to import fiona, i get ...
1
vote
1answer
145 views

How to make a virtual layer from ogr geometry?

I know how to do this: nodes = driver.Open(node_nav,0) node_lyr = nodes.GetLayer() node_lyr.SetSpatialFilter(None) But how do can use the layer methods on a geometry I created from scratch? ...
1
vote
1answer
100 views

Export some specific pages from data driven pages to pdf file by python

I need to export pages 14, 13, 23 and 24 of 26 pages of data driven pages to pdf file by python and then add the pdf file to the final pdf file by arcpy (python), any help please?
1
vote
1answer
81 views

How to create point features from 1-Many relationship?

I have an address point shapefile for buildings in a city. The point shapefile shows only a single point for each building; apartments are listed in a table called additional addresses. I need to ...
1
vote
1answer
125 views

Python: Grabbing X,Y coordinate from matching fields

Here is my table. What I am trying to do is write a python script to go over the Zip_Crid values. If there are matching values, I need to grab x1, y1, x2, y2 and put it in a new field. Haven't ...
1
vote
1answer
75 views

Stop custom attribute form from resizing in Qgis

When I open a custom attribute form for a feature in Qgis it always gets resized to the default size of the original Qgis attribute form. I've tried to set the sizePolicy in QT Designer to Fixed ...
1
vote
3answers
843 views

How can I translate Modis HDF To GeoTiff

I've a MODIS04 L2, and I want to extract band 8:Image_Optical_Depth_Land_And_Ocean. I use Quantum GIS to open this band, because Quantum GIS see this is not coordinates so this allow me to select ...
1
vote
1answer
81 views

How do I change the isNullable property for a field?

Once in awhile I encounter a field in my featureclasses that have their isNullable property set to No. Is there a simple way using python to correct this? I came up with this code, but ...
1
vote
1answer
71 views

How to set parameters for Describe() function?

I developed one tool in arcgis using python code, in the process i used Describe(feature class) function to know the coordinate system of input feature class. I got success while compiling code, But ...
1
vote
1answer
99 views

ArcPy - Dividing every raster cell value by the maximum cell value

I want to divide every cell of a raster by the raster's maximum cell value using ArcPy. Here is what I have done so far. densityRaster = LineDensity(shapefileName, None, "", "", "") maxVal = ...
1
vote
2answers
122 views

Python select by attribute using a variable counter

I am brand new to python and trying to learn how to do some simple loops but I have hit a snag. Below is what I am working with, I am trying to select the polygon row by row, but I keep getting EOL ...
1
vote
1answer
139 views

How to iterate all input folders (containing coverages) using Python with ArcGIS 9.3?

I'm trying to write python scripts to batch convert thousands of coverages to shapefiles in arcgis 9.3. The coverages files are in different folders: d:/area_A/building d:/area_B/building ...
1
vote
1answer
150 views

How to set a spatial filter with Python/GDAL?

Is there a way with GDAL (Python) to set a spatial filter (bounding-box) on a raster before I process it? I want to read it as an array. BandReadAsArray(band, xoff=0, yoff=0, win_xsize=None, ...
1
vote
1answer
158 views

Can I open a form in layer action?

I want to open a form (made in QTDesign) in the layer action. It is possible?
1
vote
2answers
297 views

ArcGIS 10.1: “ERROR 000223: Cannot extract event table properties” when iterating through multiple files/folder

I am trying to convert ~270k csv-files with lat/long-data to layerfiles. The files are split into folders by year, i.e. ~30 folders with ~9k csv-files in each. I have written a script to iterate ...
1
vote
1answer
140 views

How to add attributes to shapefile with Python and pyshp?

I'm using pyshp for creating a shapefile. I need to populate tens of fields with values using the record() method of shapefile.Writer. I have those values as a list, but have no idea how to send it to ...
1
vote
1answer
152 views

Need python code example - setting a combo listbox to Null

I want to be able to set the value of a field to Null using python, but I get an error. I am using arcpy.CalculateField_management Any help would be appreciated. Rob Smith
1
vote
1answer
257 views

AttributeError: HelloWorld instance has no attribute 'connect'

Here's the code: import sys,os import win32api from PyQt4.QtCore import * from PyQt4.QtGui import * from qgis.core import * import ctypes from PyQt4 import uic class HelloWorld: def ...
1
vote
1answer
567 views

GDAL bindings problem with ArcMap 10.1 Python tool

I'm really getting mad with this. ArcGIS sometimes can be so just...irritating! Forgive me if this question is by any means duplicating this one or similar ones, but I really can't find my way out of ...
1
vote
2answers
190 views

access attributes of one class for use in another class in python add-in

I want to get combobox attribute 'dem' and use it for further processing in class ExtentData. But I am not sure how to get attributes from one class to another for processing in pythonaddin. In ...
1
vote
1answer
1k views

Python GDAL: Save array as raster with projection from other file

I have an array of data, and for each datapoint I know the latitude and longitude. I'd like to save it as a GTiff with the same projection as other rasters I have. This is what I've tried so far, but ...
1
vote
4answers
401 views

Get vector features inside a specific extent

The problem: I have a very large vector layer with many features and a much smaller raster layer in a defined region. I want to get only those vector features which are within the raster layers ...
1
vote
2answers
233 views

ArcPy- AddJoin-function struggles using Table of PersonalGeodatabase

Hey, I am doing some arcpy -functions and afterwards I'm trying to add the calculated results from one table to another table. I'm using the arcpy.AddJoin_management() function. As input table I'm ...
1
vote
1answer
214 views

How to add MS SQL table using python console?

I have MS SQL Server 2008 R2 database. How to add MS SQL Table using python console in QGIS?
1
vote
2answers
150 views

How to handle adding a PostGIS layer in pyQgis without saving password?

I'm writing python plugin and trying to find the right way to add PostGIS layer on the map without storing user password. After adding layer on the map, I strip out the password from uri like this: ...
1
vote
1answer
86 views

GeoDjango - Use GDAL python binding in the shell

I would like to use the GDAL python binding in my GeoDjango site. The aim of this is to use ogr2ogr capabilities in a script. I am on windows 7 so I have installed GDAL-1.9.2.win32-py2.7 downloaded ...
1
vote
1answer
302 views

How to write a CSV from Python console in QGIS?

I am trying to write out a CSV file from a vector layer made up of points using the python console in QGIS. I've tried the following command: QgsVectorFileWriter.writeAsVectorFormat(layer_Map, Folder ...
1
vote
1answer
196 views

How to use QgsOverlayAnalyzer class in pyQGIS?

I am very new to Python scripting in QuantumGIS, so bear with me please. I am trying to use the QgsOverlayAnalyzer class in QuantumGIS (http://www.qgis.org/api/classQgsOverlayAnalyzer.html#details) ...
1
vote
1answer
310 views

Data Driven Pages, Graphs, and selections in ArcMap 10.1

Is it possible in python to create a selection set based on the extent from a Data Driven Page (DDP)? I have a layout view with a map and a graph. The graph is set to only plot the selected set of ...
1
vote
2answers
194 views

Batch set value/calculate field inside Cursor

I am matching data using a cursor, where one of the final steps is filling in a new attribute, match, with a value calculated during the cursor. This matching is done to an ID field in the original ...
1
vote
1answer
110 views

How to use QgsVertexMarker in a python plugin?

I am trying to display a vertex marker for a QGIS python plugin I am writing. I am getting a the following error... 'NameError: global name 'QgsVertexMarker' is not defined' canv = ...
1
vote
1answer
518 views

How do I copy all feature attributes to a feature in a new layer?

I'm trying to create a new layer in QGIS based on an existing layer. The new features should have all the attributes of the corresponding features in the original layer. I've been trying to use ...
1
vote
3answers
123 views

Applying rotation before FeatureToRaster_conversion?

I am converting polygon shapefiles to rasters. With arcpy I am using the function FeatureToRaster_conversion. gp.FeatureToRaster_conversion(InFeatures, InField, OutRaster, InCellSize) This function ...
1
vote
1answer
148 views

Why won't QGIS let me write to a file?

I am writing a QGIS Python Plugin. I am trying to write data to a file using with open("filename.txt", "w") as f: f.write("file text.") QMessageBox.information(None, "Test", "Written to file.") ...
1
vote
1answer
270 views

arcpy JoinField_managment RuntimeError

So, I've been banging my head against the wall the last few days trying to figure out what's wrong with my script. It's suppose to pull weekly flu data from a department of health website, parse it ...
1
vote
1answer
652 views

Error code 500 at REST Endpoint of published geoprocessing service - Problem with output parameter type?

Using ArcGIS 10.1 (Server and Desktop) I've been trying to publish a geoprocessing service based on a python script I wrote. Of course, it all works flawlessly from ArcGIS Desktop but I run into all ...
1
vote
1answer
370 views

How to hide/show QGisVectorLayer from Python code?

Once created a layer, how can I hide/show it? I can enable/disable rendering of a specific layer by selecting the checkbox through QGIS, but I need to do it programmatically from python code. How can ...
1
vote
1answer
379 views

How to change cursor shape in pyQGIS?

I noticed that PyQGis has QgsMapToolPan() and QgsMapToolZoom() functions, and the cursor shape on the canvas will change to a hand (for pan), magnifying-glass(+/-) (for zoomIn / zoomOut). I have a ...
1
vote
1answer
155 views

Why can't I add GlobalIDs to the table and feature classes I created?

I'm creating a script to which make a blank geodatabase with a required dataset, feature classes, tables, subtypes, relationships. I've got everything to work expect for the damn GlobalIDs! I have ...
1
vote
1answer
301 views

How to add a progress bar to a python plugin?

I would like to add some type of progress bar to my Qgis python plugin. Can someone point me to an example?
1
vote
1answer
171 views

Count the number of symbols in a 'new symbology' renderer from pyqgis

Background : I create a lot of symbology using 'saturation' ramps - for want of a better term, e.g. where the hue and value of each symbol stays the same, but the saturation changes. I couldn't figure ...
1
vote
3answers
4k views

Python Script for Select by Attributes taking user input

I am trying to write a python script and create a script tool in ArcGIS that will let a user choose the value or values that will be used to extract a shapefile. These selected value(s) will then need ...
1
vote
1answer
327 views

ogr: how to use epsg database for RD New projection?

I'm trying to assign this EPSG projection to my newly created shapefiles using ogr. The OGR Projections Tutorial says: ...any geographic coordinate system in the EPSG database can be set by it's ...
1
vote
1answer
502 views

How to drop ArcSDE connection using Python scripting?

I want to be able to control connections to ArcSDE via python. Here is my script so far using ESRI's example. import arcpy from arcpy import env env.workspace = r"SDEConnection" fcList = ...
1
vote
2answers
314 views

Cannot get arcpy.MosiacToNewRaster to work with list

Below I have a snippet of a much larger code that I cannot get to work and I am not sure why. It seems that I always have trouble using arcpy functions with rasters. Can anyone help me get this code ...
1
vote
1answer
241 views

Setting Script Tool Parameters Using Python and ArcGIS 9.3.1

Can't quite figure this out and i'm sure it's a simple fix. I have a script that utilizes the AGSSOM tool. It first stops all published services, allows for databases to be tidied up by ...
1
vote
1answer
240 views

Grid labels in ArcGIS, overlapping issues

I do have 3 grids made by Grids menu in data frame properties. I do need them to display in certain layout and also to behave accordingly to couple of rules (overlapping issues), so I can automate my ...
1
vote
1answer
364 views

installing module in embeded python in qgis

I'm newbie to Quantum GIS and Python. I'm using QGIS in windows platform. How I can install module for python embedded in QGIS? Also, how can I run embedded python from windows directly? Thanks