Tagged Questions

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

learn more… | top users | synonyms

7
votes
0answers
158 views

Geotransformation for polar stereographic?

I'm currently working to import CANGRID climate data (provided as Surfer Grid ascii, ".grd" files) into ArcGIS. The grid is 95 rows by 125 columns in size.Metadata provides lat/lon of origin (lower ...
3
votes
1answer
53 views

Trying to generate a PDF for each feature in a feature class based on an attribute with Python.

I have a feature class of points that represent storm water inlets. I am trying to automate a process that does the following. finds all of the inlets that have a field called "Marker" populated ...
1
vote
0answers
27 views

Error writing defaultdict values to feature class rows

I originally posted building dictionary from feature class field values, how can I ensure there are no duplicate values per key. The goal is to update another field with all the values per key, which ...
0
votes
0answers
57 views

Python trainings comparison

My employer provides me with a generous annual training budget and I'd like to use it on one of the following two Python courses. As a GIScientist, I would like to attend the course which will give ...
2
votes
0answers
31 views

How to Use GetGeomtype Gdal Python

I am just wondering what I am doing wrong when trying to use the GetGeomType. I need to focus on separating layers from a pix file. Two categories are the bitmaps(which are vectors) and then the ...
1
vote
2answers
48 views

building dictionary from feature class field values, how can I ensure there are no duplicate values per key

I found this code sample that builds a dictionary from two fields; the end result is a concatenation of all values per key to a new field. It's a great tool except that it doesn't account for ...
0
votes
2answers
40 views

Select Layer by Attribute: SQL and variable problems

I've had a good look around the site and haven't been able able to find any 'select by attribute' questions regarding string variables and how to integrate them into an SQL statement. In my particular ...
0
votes
0answers
42 views

Error selecting geometry from Oracle DB

I'm trying to select a geometry column as well-known text from a feature class in an Oracle 11g/ArcSDE 10.1 geodatabase. (This is in a Python script using pypyodbc as a driver). This is my SQL: ...
2
votes
1answer
42 views

Compiling custom plugins for QGIS on Windows

I've made my first plugin using plugin builder and I want to compile it. I read that I need two commands to do it under windows: pyuic4 and pyrcc4. But when I use any of these commands I get this: ...
1
vote
0answers
39 views

How to change color ramp in graduated classification with standard deviation using pyqgis

I'm using graduated clasiffication with standard deviation to style my shapefile (see code below). But I need to use different color ramp for classes below mean (-1std, -2std etc.).I'm thinking of ...
2
votes
1answer
35 views

ERROR 001243 preventing automatic publishing of geoprocessing service

I am trying to automate the process of publishing a geoprocessing service to ArcGIS for Server 10.2.2, using a python script: import arcpy result = r"C:\data\ContourLineFunction.rlt" ...
1
vote
1answer
29 views

Speeding up length calculation in QGIS 2.0 Python plugin

In a qgis 2.0 plugin for windows, I calculate length and update a field with the values. It works, but takes a lot of time. Execution for this part only takes about ten minutes. Can anyone suggest ...
3
votes
2answers
51 views

How to calculate the a list of rasters?

I'm writing ArcPy code in ArcGIS trying to calculate a list of rasters. I get an error message that says: TypeError: unsupported operand type(s) for -: 'unicode' and 'unicode'. Here's my ...
1
vote
0answers
15 views

Print Custom Feature Form using PyQGIS

I recently asked a question and accepted the answer, as it was a good guide on accessing the print composer using python. However, I am still looking for a way to print the custom feature form. Does ...
0
votes
2answers
60 views

Improving this script - GPX reading and processing with Python OGR

I am trying to plot every GPX trace I have in a folder, by reading it with Python-OGR, clipping it by a bounding box, and plotting Curently I have a working script, but it seems very uggly, and I ...
2
votes
2answers
92 views

Use updatcursor to replace values in multiple fields

I have spent a couple days digging through forums here, ESRI help and elsewhere and each variation of the codes I have tried has not worked. As best as I can tell this is due to my attempt to loop ...
1
vote
2answers
60 views

How to label only house number in python? [duplicate]

I have parcel data that has the site address field as ex. 123 First Avenue. I only want to label the house numbers on the map, so 123 in the example. How can I do this using the label expression in ...
2
votes
2answers
38 views

No plugin icon in the toolbox in QGis 2.4

When i'm loading my plugin into QGis 2.4 the icon doesn't appear in the toolbar. There is only an empty button. I have the icon.png in all the necessary files: resources.py: <RCC> ...
3
votes
0answers
33 views

Get value from Metadata in Python Script for attribute

I am working on a python script to create some feature classes from dbf tables. As part of the script I would like to pull two values (FGDC "publication date" and ArcGIS Spatial Reference ArcGIS ...
1
vote
1answer
32 views

Issues with FME and the ArcInfo licence

I have ArcInfo 10.2.1, Python 2.7 and FME 2013 SP4 installed on my Computer. I want to run a python script I exported from ModelBuilder (where it ran without issues) and imported in FME as shutdown ...
1
vote
2answers
38 views

How to provide a default value in an arcpy script?

How do I provide a default value like recommended in every Arcpy script? This script is exported from ModelBuilder where every output except the last one is set to temporary and managed. I want this ...
1
vote
1answer
27 views

How to Set Label Expression Using a Long Field Type in Toolbox

What I am hoping to be able to achieve with this Tool within my Toolbox is to allow the user to input a number of layers and to set all of the labels with the same font settings (font style, color, ...
1
vote
1answer
42 views

Can't Remove a Menu in Python Add-in

I have a Python add-in with a good amount of buttons and menus. I'm trying to remove a menu using the addin_assistant, but the menu isn't being removed from config.xml. I've tried removing the add-in ...
0
votes
0answers
22 views

export qgis point symbols per feature

I am currently trying to export the drawn symbol in a QGIS map for a webmap. The current approach is to extract the properties: if i.rendererV2().dump()[0:6] == 'SINGLE' and i.geometryType() == 0: ...
2
votes
0answers
70 views

Script to unzip a file geodatabase fails with Memory Leak

Hijacked the ESRI script to unzip. After research I found there is a memory leak. There are three zip files I download on a regular basis. Each .zip contains one (1) .gdb. The largest is 2 GB zipped, ...
1
vote
1answer
66 views

How to create a shapefile or gml from a Oracle database using SDE.ST_Geometry?

I have a ORACLE database 10g(Oracle Database 10g Enterprise Edition Release 10.2.0.3.0) with a SDE.ST_Geometry field and i want to make a program in python so i can create several shapefiles based on ...
0
votes
2answers
48 views

arcpy calculate string field: Any ideas what how to fix this?

I'm trying to store a string value obtained from a loop through a tuple into a field called ROW_1. The code goes like this: for creekclass in listOfClassTuples: (classname, Permanency, ...
2
votes
0answers
39 views

QGIS 2.2.0-Valmiera 64bit on windows 8.1 displays error while creating ROI in SAC plugin

I don't know what happened while creating ROI during Classification using Semi automatic Classification Plugin 3.1.0 "Rome" installed on hp Pavillion i7 with windows 8.1 When i started to generate ROI ...
3
votes
1answer
98 views

Using GDAL in python to stack Landsat bands

I am processing a large amount of landsat data. Landsat scenes ship as a collection of tiffs- one file for each spectral band, plus a bunch of masks. I need to stack some of the bands into a single ...
1
vote
1answer
41 views

Using Selection Sets with Python

I am trying to build a model that reads through about 30 different point feature classes and appends only the selected features to a new feature class. Some of the feature classes don't have any ...
2
votes
2answers
60 views

How to open the “File Browse” dialog in Windows from a PyQGIS plugin code?

I am in the process of developing a plugin for QGIS using Python. Note that this is my first plugin, so the query could be quite basic... I have used this Digital Geography link to create the basic ...
1
vote
0answers
38 views

midpoint of segments in QGIS determination

Gene thanks for your note on the problem yesterday ... This is a follow up to a question I posed before (How to find the middle point of a line in QGIS - Where to place input file name). Errors coming ...
1
vote
0answers
50 views

Is there a python function in QGIS to detect if the output file is saved to the hard disk?

I'm currently using QGIS 2.4 and writing some custom scripts on it. A proper script not only accomplishes its function, but also accepts user defined parameters and checks for possibilities of errors. ...
2
votes
2answers
50 views

csv to shp missing file

I transform a csv file into a shape file using the following script import shapefile as shp import csv import tkinter.filedialog import urllib.request import os a = ...
2
votes
1answer
45 views

Exporting layout elements and constants to Python script?

Is it possible to export the elements and constants used in a layout to a Python script? Something similar to creating a model and exporting it to Python but instead of being a model, it's a layout? ...
2
votes
1answer
50 views

Adding new Field and writing values for all features

I need to create new Field in Attribute table of vector layer, and afterwards to calculate values and store them in that Field for all features I have in that layer. I have solution which works, but ...
3
votes
4answers
279 views

Having trouble with 'and' 'or' statements and negative numbers

I have set up a program that calculates the relationship between a point and the first point of a polyline. The aim of the program is to run this calculation and then copy the result to a certain ...
1
vote
0answers
48 views

QGIS Add WMS layer with python

I'm developing a stand alone python script using QGIS 2.2.0 libraries. I want to add a WMS base layer to my map, and I follow the instructions reported by the documentation: urlWithParams = ...
3
votes
2answers
52 views

Python, OGR and Mapnik: Possibility of passing existing ogr.Open() datasource into Mapnik without using mapnik.Ogr()?

Okay, I'm trying to modify create_utfgrids.py to use an OGR VRT file, rather than shapefiles, and while the OGR stuff in this code responds to the VRT, the Mapnik stuff is not. It's failing with.. ...
0
votes
0answers
17 views

Using setCrsTransformEnabled in qgis 2.4

In the python console of qgis I try to load layers from shapefiles which have different CRS using the setCrsTransformEnabled() method. To test the procedure I changed the CRS of the shape file using ...
5
votes
1answer
51 views

PySAL natural breaks from Numpy array

I am attempting to extract natural break values from a raster using Python. The intended process goes: Arcpy raster object to NumPy Array (using RasterToNumPyArray) to natural break values (using ...
3
votes
0answers
55 views

How to create a python plugin in QGIS 2.4.0?

While I am learning to create a python plugin in QGIS 2.4.0, I have followed the proceedure expalined in ...
1
vote
2answers
152 views

GDAL/PYTHON: Batch Process Project All Level 2 HDF Files Only(Filter) and save to new directory

I have downloaded numerous hdf files from an ftp site. Let's say I already have 500 hdf files, 250 of them were level 1 hdf files and the rest were level 2. The level 1 format is: ...
1
vote
0answers
36 views

User input and passing variables with ModelBuilder

I have created three modelbuilder tools that must be run in sequence. After running each tool, the user must examine several shapefiles and potentially change the input parameters of the next tool. ...
1
vote
0answers
24 views

Stereo-pair Image Registration

Is there a simple command line or python based way to visually register a pair of overlapping stereo images and clip the non-overlapping areas out? These images do not have spatial information ...
1
vote
0answers
20 views

PyQGIS: Properly trigger actionPan() tool when feature is added

I wrote a plugin which creates a custom map tool that adds features. I would like to cleanly connect to the pan tool after a feature is added. I've done it in the following way and it works, but I get ...
2
votes
3answers
72 views

How to find all distinct values from a single column of an attribute table with GDAL (Python)?

I am working with GDAL and modify ESRI shapefiles with it. I am searching a possibility how to find all distince values from a single column of an attribute table with GDAL (Python). In SQL it would ...
-3
votes
1answer
107 views

Exporting file geodatabase (GDB) to Folder of shapefiles?

I have a geodatabase with several feature dataset and feature classes associated with it. I want to export each feature dataset as folder and feature classes associated with each feature dataset will ...
3
votes
1answer
38 views

How to refresh the view in QGIS Print Composer using Python?

I am trying to automate the printing of maps based on different attribute classifications using Python in QGIS. Everything is okay except for when I open the printed image, the labels are blurry. ...
1
vote
1answer
76 views

Importing file geodatabase (GDB) to table of contents (TOC) of ArcMap?

I have a geodatabase with several feature dataset and feature classes associated with it respectively. I would like to create a .mxd where the Table of contents consist of group layer and each group ...