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

learn more… | top users | synonyms

1
vote
2answers
46 views

Automated search of misplaced points with Python or Model Builder

I am using ArcGIS 10.2.2. My work is to find points which are misplaced. I want to know if there's a way to automate this using Python or Model Builder? I wish to place this in the attribute table ...
1
vote
1answer
132 views

How to get a the minimum value of a raster layer in qgis with python? [on hold]

I'm very new user of QGis and I work with landsat 5 images. In this framework, I would like to make an atmospheric correction subtracting the minimum value present in each band (1 to 4). My ...
1
vote
0answers
9 views

Map algebra from files in multiple directories

I'm a rookie in python programming. I want to do map algebra for multiple rasters but these rasters are in different folders. Here's the code ive created so far: #Importing modules import arcpy from ...
3
votes
2answers
202 views

Per-pixel (statistical) calculations on a raster stack using GDAL

In R, it's relatively trivial to perform per pixel calculations based on a raster stack (e.g., get std.dev for each pixel on a 12 layer GeoTIFF). Unfortunately, the speed is less than desirable when ...
4
votes
1answer
61 views

How do you set the position of a plugin window when you start the plugin?

I'd like to set the position of a plugin's window or dialog relative to the map canvas frame. For example, if I start a plugin, I want it to appear somewhere in the left upper corner of the map ...
4
votes
1answer
26 views

Can QGIS map canvas update while python script is running?

I want to automate a periodic refresh of the QGIS map canvas with updated shapefiles. A Python plugin or console script does not allow the map to update until the script terminates. Is there a way to ...
6
votes
0answers
69 views
+100

How to get status of a layer in geoserver using gsconfig?

I am getting all published layers from geoserver using gsconfig using following code: from geoserver.catalog import Catalog cat=Catalog("http:// localhost:8080/geoserver/rest") myResource = ...
4
votes
0answers
33 views
+50

How to get layer list of layers that are published?

I'm stuck. I've been using geoserver with python extension gsconfig library for a while now. Almost everything works as it should be. While there are little things like publish raster images are ...
2
votes
2answers
133 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 ...
0
votes
0answers
21 views

How to add new columns with attributes in existing Qgis layer?

How to add new columns with attributes in existing Qgis layer? Doing the "same thing" here described
1
vote
1answer
133 views

Raster extent, just clipped by geomtery, slightly differs from a given geometry

The raster using arcgis geoprocessing is cliped with a feature, reading it's geometry and as a result, rasters extent slightly differs. Extent of geom: str(row.shape.extent) '570600,537958652 ...
1
vote
2answers
69 views

Concatenating fields with label expressions using Python

I am trying to combine three numeric fields together for a feature's label. I only want to label the feature if it is over 0. The labeled numbers need to be separated a dash ("-"). This is what I ...
1
vote
1answer
609 views

GDAL loads in Python, but not IPython (Linux)

I am trying my hardest to utilize the work of the good folks at the GeoDa center, but I cannot seem to get all of the components to load. GDAL, in particular, has been giving me some difficulty. The ...
0
votes
1answer
37 views

What is a simple python code to practice with in arcgis? [on hold]

I am trying to familiarize myself with python code. Could someone give me a simple code with an explanation of what it does so I can practice? Or a few codes with explanations if you have the time
1
vote
1answer
440 views

Scipy: Convert RGB TIFF to grayscale TIFF and output it on Matplotlib

I want to manipulate RGB bands in a TIFF file and output the grayscale map on matplotlib. So far I have this code, but I couldn't get it on grayscale: import scipy as N import gdal import sys import ...
1
vote
2answers
41 views

Creating shapefile from selection - remove from map

I am iterating over a shapefile and creating a new shape from each row. I will be creating several thousand individual shapes and do not want to inundate my TOC with that many layers (I bet ArcMap ...
1
vote
1answer
43 views

QgsMapRenderer to export current extent using PyQGIS

I am trying to accomplish PyQGIS simple map rendering via the QGIS 2.0 Python console, but end up with only a blank image. I've followed instructions of this link. My objective is to export a simple ...
5
votes
2answers
216 views

Is there a way to calculate closest distances to a point without using Near Analysis?

I frequently get asked to calculate distances from a specific point (A drilling well in the middle of the sea for example) to a number of Environmental layers (Protected Areas, Pipelines, Other wells ...
1
vote
0answers
31 views

Python console not working at all

My python console won't work at all. I can't open it. My QGIS version is 2.4. OS is win7 64. I've reinstalled QGIS a few times but I always get the same result. Strange. Something went wrong with the ...
4
votes
1answer
44 views

How to extract certain values from a table using the SearchCursor Tool

I am trying to write a python script to extract certain values from a table: the table I am referring to is a big collection of nitrate values for different water depths, which are deposited in the ...
2
votes
1answer
23 views

Open a .osm.pbf file with fiona in python

I would like to open a .osm.pbf using fiona in Python. I can't find much documentation on this. How can I does one do this? I have done it using ogr2ogr.
3
votes
0answers
29 views

ArcPy: Initialize zero valued grid Raster and iteratively increment

I'm jumping right into ArcPy to help out a friend who needs to automate some ArcGIS work. The problem at hand can be reduced to the following pseudocode: accumulationRaster = SomeZeroedRaster for ...
4
votes
3answers
51 views

Install gdal in CentOS without Root

I have been struggling to get python setup to do some image processing, so I really need the http://www.gdal.org/ GDAL libraries installed on CentOS 6.5. I want to install the package in a local ...
0
votes
2answers
141 views

QGIS 2.4: plugin changes map tool canvas click behavior from 2.0

I had created a plugin for QGIS 2.0 to add new features more easily. It involves changing extents and updating snapping options along with triggering the default actionAddFeature(). However, I've ...
4
votes
0answers
45 views

Preparing Huff model with data to use in QGIS? [closed]

I'm trying to find out about the notion of potential of acessibility using the methods of Huff. I´m using QGIS, with point data (with the variables that I would like to use) and polygons for Europe ...
0
votes
1answer
120 views

Using Union on multiple shapefiles to output single result

Using QGIS 2.2 and Python, I would like to use the Union algorithm on multiple shapefiles (contained in a folder TEST) which would then produce single shapefile containing all the data. Currently ...
3
votes
2answers
46 views

GDAL (Python) Aggregate Raster Into Lower Resolution

I have a (continent-scale) raster with 30m resolution in an Albers equal area projection. Each 30m cell has a value 1-34. I would like to aggregate information from this raster into a 1km grid such ...
6
votes
1answer
212 views

Calling external files in Python Geoprocessing Service

I have created a Python script which calls an R script and then reads the output back into Python. I can run this tool in ArcGIS Desktop (10.2.1) and it works fine. When I publish as a geoprocessing ...
2
votes
1answer
28 views

Is it possible to remove parameter values from the Python Window when running a script in ArcGIS?

When I run a python script in ArcGIS Desktop 10.1 the values from the parameters will be written to the Python Window (marked with red in the picture below). Does anybody know if it is possible to ...
4
votes
1answer
142 views

How can I modify layer order with the QGIS python API

Typically, after a new_layer = addRasterLayer(...) that inserts new_layer before the active layer, I'd like to move it to the top of the table of contents. How to do it? I use an existing QGIS ...
1
vote
2answers
44 views

Arithmetic on rasters with variable names in Map Algebra/Spatial Analyst?

I'm a Python (and StackExchange) novice trying to figure out how to perform calculations on temporary rasters with variable names. My attempt at a minimum working example is below, but I would ...
-1
votes
1answer
35 views

Displaying Shapefiles using Python? [on hold]

I have some shapefiles, which I want to display in Python. Is there any code for that?
2
votes
1answer
153 views

Does ArcMap/ArcPy support creation of textElements using Python?

From what I can tell python at ArcGIS Desktop 10.0 cannot create new textElements nor GraphicElements. Yet, 10.1 seems to support the ability to at least create a clone, of a existing GraphicElements, ...
4
votes
2answers
311 views

How to write scripts that can call on both Arcpy and PyQGIS?

I have spent quite a bit of time looking for a clear answer this topic and have still been unable to really accomplish my goal of accessing PyQGIS in a stand alone script. Parts of answers have been ...
2
votes
1answer
26 views

Use point shape file to spatial query multi polygon shape files with python?

I have an address point layer and would like to spatially query this layer using various polygon shape files to intersect this information so that each address contains the attributes from these ...
3
votes
1answer
432 views

Python: “Import Script” greyed out

I have a tool that I created from a Python script which I update from time to time. Usually I will right-click the tool and choose Import Script, but lately this has been unavailable, as shown below: ...
4
votes
0answers
35 views

Rules of Nodata value?

What are the arithmetic rules that govern Nodata values? Regardless of how these null values are defined? I am using ArcMap Raster Calculator. I am thinking specifically of operations like 1*Nodata ...
-2
votes
0answers
12 views

Time Epoch split day wise in Python [on hold]

I have file with a series of UNIX format Time Epoch and i have to split it into multiple files day wise. Any suggestion in this direction is appreciated.
2
votes
1answer
48 views

arcpy.AsShape function returning RecordSet not Geometry

I have the following code: feature_geometry = arcpy.AsShape(json_string, esri_json=True) print feature_geometry print type(feature_geometry) >>><geoprocessing record set object object at ...
-1
votes
1answer
305 views

ArcGIS 10.1 Custom Toolbar issue with addin wizard

I am having some issues. In ArcGIS, I created a custom toolbar (with the python addin wizard) to do the following: 1. Button to connect to feature class, 2-5. A series of comboboxes to view, edit data ...
2
votes
0answers
36 views

Filtering MSSQL layers in QGIS doesnt work

In my QGIS Plugin I am filtering layers with this Python code: FeatureIterator = layer.getFeatures( QgsFeatureRequest().setFilterExpression ("Fieldname='SomeValue'") ) for feature in FeatureIterator ...
1
vote
1answer
39 views

Pyproj: converting WGS84 to Robinson

I have a WGS84 coordinate pair (37.7749295, -122.4194155). I have an image that is a Robinson Map Projection of the world. I'm trying to write a python script to locate my WGS84 coordinate on my ...
1
vote
1answer
34 views

Unable to use kartograph.py

This is probably a very simple fix. I was able to download and install the Kartograph.py library. When I call it from the command line I am getting: kartograph is not an external command Usually ...
2
votes
1answer
149 views

Configuring spatialite database access for Python 2.6.6

I'm working on a GIS project, and I would like to implement and test some geo-spatial algorithms in Python. For this purpose, I will not only need sqlite, but also spatialite, in order to store and ...
7
votes
1answer
1k views

How to disable and enable drawing in ArcMap using Python?

The script that I'm writing repositions two data frames and sets their extents. When doing this, it redraws the entire Active View 4 times, slowing the script substantially. Pressing F9 or ...
3
votes
1answer
52 views

No get more option in QGIS

I have recently installed QGIS and trying to work with it but I don't see this option "Get More" at all. As suggested by some previous source, I also checked whether I am behind a proxy but that isn't ...
2
votes
1answer
67 views

Naming directories in python?

Why is it that when I label my directories this way: arcpy.env.overwriteOutput = True arcpy.env.workspace = "C:\\Users\\Documents\\ArcGIS\\Testing" arcpy.env.scratchWorkspace = ...
2
votes
1answer
25 views

Get min-max values of a raster and populate two parameters with the values in tool validation script

I am customizing the script tool behaviour of a custom script and would like to get the min-max values from a raster self.params[0] and populate the next two parameters, self.params[1] and ...
1
vote
1answer
18 views

Convert WKT (or geojson) geometry to numpy array of coordinates

I am looking for the fastest way to convert WKT or geojson geometry from string to numpy array of coordinates. Is it possible to do it strictly in Python and without creating geometry object such ...
1
vote
1answer
85 views

Installing pandas with Esri's python?

Trying to get pandas to import, but I'm getting what looks like an error caused by a failed dependency of the version of my Esri-provided numpy's compile, based on this stackoverflow posting. Here's ...