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

learn more… | top users | synonyms

6
votes
1answer
703 views

Working around slow processing times in ArcGIS Spatial Analyst functions?

I am batch processing a large amount of distance functions (~50,000) using ArcGIS 9.3. In this version, using spatial analyst functions, it seems to be the case that users cannot parallelize processes ...
3
votes
2answers
35 views

Exporting multiple dataframes as images using ArcPy?

I use this code to export a dataframe to png, and it works. import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] ar = df.extent.height / df.extent.width ...
1
vote
1answer
29 views

QGIS 2.6 python PlugIn Error : NameError: global name 'QMessageBox' is not defined . any idea ? this use to work in QGIS 2.4

I am wondering why is this code not working ? def run(self): QMessageBox.information(self.iface.mainWindow(),"Ok", "You pressed F7") NameError: global name 'QMessageBox' is not defined ...
0
votes
0answers
19 views

Python, KML and Geoserver/MapServer

I have this question: Is it possible to create an script that syncs a Google Drive folder with a MapServer/Geoserver and creates the visualization of an KML/HTML embedded file in Mapserver/Geoserver? ...
2
votes
1answer
24 views

QGIS - Edit UI - Python Init function localization with QTranslator

I have interaction with layer defined by custom designed UIs. In layer properties the following settings: Edit UI - customline.ui and Python Init function: customline_set.py. #coding: utf8 from ...
1
vote
1answer
68 views

Trying to loop if condition at PYTHON code using Arcpy

I'm working with Arcgis 10.1, i'm trying to loop if condition on PYTHON code, but they give me as error : Parsing error IndentationError: unexpected indent (line 18) I don't know what is going wrong. ...
3
votes
0answers
24 views

Configuration problem anaconda python in ArcGIS

I used Eclipse with PyDev to create a script in Python (windows 7 x64). My code runs perfect when I start the run in Eclipse, but when I add it as a Tool in ArcGIS 10.1, I have the following problems: ...
2
votes
1answer
330 views

View HTML field data with QT4 browers as a QGIS Run Feature Action Tool

I've successfully populated a sqlite table with an HTML-encoded-table as a field attribute, and so there is literally a Table within a single field value in sqlite, for each record. This is going to ...
4
votes
2answers
564 views

Issues with osgeo - qgis.core and arcpy modules

Is it possible to have the python shell from either qgis or argis to load (import) both qgis.core and arcpy? I am developing a metadata creation tool and have completed the core functionality using ...
0
votes
1answer
42 views

Replace Domains of ArcGIS 10.1

I need to Replace the Domain on Field level on my Geodatabase. My Geodatabase having multiple features and tables where at each on field one Domain is assigned, I need to replace that Domain and ...
4
votes
2answers
52 views

How to check for corrupted raster data?

I am working with thousands of tiled (2km x 2km) 4-band NAIP images. When I diced the images in Erdas, the program corrupted many of the tiles. The screenshot shows an example of one of the ...
14
votes
7answers
7k views

What's the easiest way to install GDAL and OGR for Python?

I am developing some code in Python, and I want to use the GDAL/OGR python bindings. What is the minimum I need to install in order to use the GDAL and OGR python bindings? What is the easiest way to ...
0
votes
1answer
135 views

Cause of ArcGIS Raster Calculator Parsing error <type 'exceptions.SyntaxError'>: invalid syntax?

This is my first attempt at much code in the raster calculator of ArcMap 10.0, but I think I'm close. I have nine rasters (A-I below) and want a new raster with value = 1 where any of the rasters ...
2
votes
1answer
53 views

Add value to field using arcpy

I calculated the azimuth angle between two points. I'm trying to create a new field where I will store my angle values, but although the field is created it stays empty, no values within! I'm using ...
2
votes
1answer
26 views

Trouble renaming layers using arcpy

Running ArcMap 10.1 So, I have a bunch of layers that all have the same name. I'm trying to rename them so that they have names that actually mean something. Everything runs fine until it is time ...
1
vote
0answers
21 views

Vector Layer Symbol (ism) properties?

I would like to streamline the render of a polygon grid vector layer as a simple line (no fill) via Python coding. I am I bit confused by the implementation referenced by the API. Is it possible to ...
2
votes
1answer
187 views

Error with da.UpdateCursor and SDE feature classes

I am making my first attempt at editing an ArcSDE feature class with python through a da.UpdateCursor. I'm essentially taking code I've written for a file geodatabase feature class and applying it to ...
2
votes
1answer
34 views

Is there a python version of qTuio? [closed]

Is there a python version of qTuio? qTuio is implemented in C++. However, I am currently trying to use pyqgis due to problems with C++ environment (I cannot even create a raster layer). Any help is ...
7
votes
1answer
860 views

How to prompt for user input during ArcGIS Python script tool execution?

I want to prompt for user input after all parameters have been specified for the script tool. I've seen many forum posts and stackexchange questions about this, and they all conclude that it's ...
5
votes
1answer
104 views

Set default values for value table in Python Toolbox tool

I created a Python Toolbox tool to reorder fields and create a new feature class with the reordered fields. The tool works nicely and I am able to use a value table to let the user arrange the fields ...
2
votes
1answer
97 views

How to print 2 maps in the same PDF page using PyQGIS?

I am trying to generate a one-page PDF document containing the following items: 1) On the left half, a full state map (say, New York State). 2) On the top right quadrant, a map that zooms in to one ...
8
votes
1answer
177 views

How to call the interpolation plugin from the python console?

I would like to call the QGIS interpolation plugin function (TIN method) (Raster->Interpolate) from python console. I can't find the corresponding function within QGIS API or within the ...
3
votes
2answers
594 views

Enabling time aware layers using arcpy

Is it possible to enable time aware on a layer programmatically? I can add a time-enabled layer to a non-time aware data frame as shown here: ...
1
vote
0answers
36 views

Extract layer by attribute and export to new shapefile using arcgis scripting 9.3

I have a n-number of shape files based on attribute i want to extract the layer to export to new shape file, Using feature class to feature class conversion i can do, but i want to check for specific ...
1
vote
1answer
31 views

How to use a feature class attribute to look up values in a table and pass them as parameters to a function?

My problem: I have a set of points inside a polygon. My goal is to figure out how long it takes (in days) for each point to move outside the polygon, based on a daily movement which affects all the ...
1
vote
0answers
50 views

multiprocessing and the ArcGIS in_memory workspace

I am trying a script that makes use of multiprocessing and a number of tools within arcpy. The script works only if I write all input, intermediate, and output from child multiprocessing executions to ...
2
votes
1answer
77 views

ArcMap Python Question: Trying to Field Calculate Slope Percent in to Text

I have a layer of polygons that I spatially joined to a raster to point layer of slope percents. My polygons now have the percent of slope in a field called Avg_point. I want to use the field ...
3
votes
2answers
166 views

Is there a function to select a region of a map for further processing with Python?

I would like to select a map's region in QGIS for further processing with python console. Ideally I would like to select the region with a mouse drag (like Gimp crop function) and then e.g. analyze ...
12
votes
10answers
8k views

Python GDAL package missing header file when installing via pip

I asked this question on Stack Overflow before I realised this site existed. As this site it more appropriate, I'll ask it here too. I'm trying to install gdal from pip pip install gdal inside a ...
0
votes
1answer
38 views

Sort legend items up and down with arcpy

I work with arcmap 10.2.2 and I have 10 mxd's in one folder. I try to sort the legend items with a python code by moving the legend items up\down and i want that the layers in the TOC stay as is. I ...
1
vote
0answers
159 views

Converting GRIB to Geotiff with gdal_translate in Python

I want to extract each band from a GRIB (gridded binary from http://data-portal.ecmwf.int/data/d/interim_daily/) in a single Geotiff image. I´m using Python with gdal_translate in a QGIS backround, ...
3
votes
1answer
78 views

How to use QGIS field calculator in python?

I would like to use QGIS Field Calculator in Python to update the existing column based on certain conditions? How can I do this?
1
vote
1answer
151 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 ...
0
votes
1answer
39 views

Optimizing script with in_memory selection

I had a problem solved here. I had 2 features: polygons and points, both containing similar attributes(example: street name, number). Each polygon must have equivalent point added(same street name, ...
1
vote
0answers
35 views

I can't get fiona to write while copying shapefile

I am trying to debug a function and have narrowed down the issue to a problem with my attempt to use fiona write. After going through the many online resources, I can't seem to find my problem, ...
3
votes
1answer
39 views

Convert Raster into Cell by Cell Table

I'm hoping to run some Python mathematics on a raster, outside of ArcGIS. It's important to have a cell by cell table for the analysis I want to run. I plan to store it in a python dictionary similar ...
1
vote
0answers
14 views

How to update the items of qCombox in custom form?

For my project I use a custom form with multiple value relation comboboxes. This works quite fine and I can access the widgets via my script. Init the two comboboxes which are correctly filled ...
0
votes
0answers
23 views

workflow for reading data from a geotif and plot it on a map using python

I have a geotif with 9 different values (0-9). The projection of this is +proj=longlat +datum=WGS84 +no_defs. I want to plot this colors over a map (mercator projection). I tried to use ...
1
vote
1answer
22 views

how to transfer a geotif with WGS84 to a mercator array for ploting it with matplotlib.basemap

I want to plot data from a sensor raster file (tif) to a map using basemap. I have a geotif with 'WGS 84' >>> gtif = gdal.Open("example.tif") >>> print gtif.GetProjectionRef() ...
1
vote
3answers
39 views

Multiple python script for Alter Field

I'm a novice programmer and I would like to ask for something which will facilitate my work. I need to rename all the field names in some shapefiles I am working on and since renaming is an arduous ...
28
votes
10answers
6k views

What are some resources for learning ArcPy?

I would like to learn ArcPy, but I do not know quite where to begin. Does anyone have any good advice on where I should start to learn ArcPy?
0
votes
0answers
29 views

Python Automated Data Driven Pages - Labeling and Symbolizing Errors

I am trying to use a python script to automate the export of the data driven map document. However when I use the python script to run the DDP export some of the labels are not exported and the ...
1
vote
2answers
143 views

Syntax error from Python parser of ArcGIS field calculator if then?

Using ArcMap - I would like to calculate one field based on the value of another field. I want to Update the field 'Date_Class' based on the value in another field 'MIN_YEAR_B'. I was trying to do ...
2
votes
1answer
47 views

How to geocode a single address in Python Script/ ModelBuilder?

How to geocode a single address (not table of addresses) in ModelBuilder and/or python Script? I want to enter the address and then geocode it. I am using arcgis 10.2.2
2
votes
2answers
114 views

PyQGIS: How to send signal if layer is currently in edit mode

I'm looking for a way to send a signal if a layer is in editing mode. I tried editingStarted(), but it wasn't working. I'd like to do something along the lines of the what I have below, but can't find ...
2
votes
1answer
108 views

Setting up pycharm and pyqgis

I wanted to set up PyCharm the way this blog post explains: Setting up PyCharm for PyQGIS and Qt. I did everything as instructed but when it comes to adding project interpreters I got this error ...
1
vote
3answers
478 views

How to use gdal module in python

I am trying to import gdal modules from osgeo installed in my win64x machine but I get the following error: Traceback (most recent call last): File "", line 1, in from osgeo import ogr ...
0
votes
1answer
31 views

PyQGIS export to JSON: writeAsVectorFormat and precision

In my QGIS plugin qgis2leaf I am exporting all layers as JSON into a JSON directory. Therefore I would like to enable the user to define the precision in the GUI. The normal "save as" dialogue in QGIS ...
1
vote
1answer
47 views

Arcpy addin editable textbox on tool bar

I would like to add an editable toolbox on an arcpy addin toolbar. This would be used to change values of a threshold but I don't think this is currently available. (What I would really like is a ...
1
vote
1answer
208 views

How can I change SQL query through a layer of an action (python)?

I have three layers from three diferent database tables. When I click in other layer I want to change (with an action) the query of that three layers. How can I do that? Thank you