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

learn more… | top users | synonyms

1
vote
0answers
53 views

Editing QGIS point layer: retrieve attributes of intersecting line layer

I'm creating a custom editing form using QGIS 2.0 and would like to modify the mouse event when creating a point. I've gotten a start by reading this thread: How to programatically check for a mouse ...
1
vote
0answers
20 views

Changing the symbology of layer when converting from Layer to KML using Python

Is it possible to change the symbology of a layer file using Python? I have a script that creates a layer file and converts it to kml, but every time I run it the symbology color in the kml of the ...
1
vote
0answers
42 views

Batch Clip (Editing Session)

I'm trying to correct some topology errors in my geodatabase, now focusing on two feature classes: grass and buildings. They must not overlap. However, there are plenty of spaces where the grass was ...
1
vote
0answers
35 views

PyQGIS Dialog Plugin not resetting

I have written a PostGIS search plugin that works pretty well, except two things that I just cannot figure out a solution 1) When the dialog closes and then is reopened the previous query is still in ...
1
vote
0answers
44 views

How can I draw features on GeoTIFF in Python?

I have a set of data (coords + value) and want to turn it into a heatmap in GeoTIFF. Should I calculate pixels and set them as array, or there are shortcuts? This is what I do now: driver = ...
1
vote
0answers
16 views

Able to circumvent QgsCredentials script called from Pre-execution

I've got a stored project that, when opened is connecting to my PostgreSQL DB, and is loading several layers. All good. I'm using a script that is called from Pre-execution (Processing/Options and ...
1
vote
0answers
33 views

ArcGIS Geoprocessing Service fails on data loading

I have a Desktop Script tool that works fine when run on desktop, but does not work when the results are turned into a geoprocessing serice. Running ArcGIS 10.2 on Desktop and 10.2 on server. I have ...
1
vote
0answers
78 views

How to use paths with non ASCII characters for subprocess calls with ArcGIS

I know that it is possible to create calls using unicode character encoding like \xf8 for non ASCII characters but how do I do it writing a path in a script just like: 'e:\gis\python_ø\notepad.exe' ...
1
vote
0answers
44 views

Install PyQGIS in virtualenv

Is it possible to install PyQGIS in virtual environment? I want to use rendering capabilities in my own application which runs using virtualenv.
1
vote
0answers
78 views

Publishing esri geoprocessing service - upload custom python modules?

I have an esri geoprocessing service which causes problems when publishing to arcgis server. The python scripts behind the service are structured as a custom python module, in a folder with an ...
1
vote
0answers
61 views

Export map to geotiff?

I try to export my map (layout or data view doesn't really matter) to a georeferenced tiff-file (geotiff). However, this presumably easy task is proving rather difficult to accomplish. I first tried ...
1
vote
0answers
56 views

How can i add a north arrow in QgsComposition?

I'm trying to add an svg image of north arrow in QgsComposition using this code: mapRenderer = iface.mapCanvas().mapRenderer() theComposition = QgsComposition(mapRenderer) ...
1
vote
0answers
32 views

Using the geocode function with cursors

How do I use a cursor with a geocodeaddress function? I want to be able to: 1) read from a table 2) only geocode addresses(from table1) whose street number is not 0 using a cursor 3) then update a ...
1
vote
0answers
34 views

header information is missing from image, after writing using opencv

I am doing complement of an image using open-cv python, while writing the image, open-cv is not writing the header information in the complemented image. my image data are in TIFF format. i am doing ...
1
vote
0answers
137 views

smoothing results from scipy griddata interpolatioin

I am using the griddata interpolation package in scipy, and an extrapolation function pulled from fatiando: import numpy as np import scipy from scipy.interpolate import griddata import ...
1
vote
0answers
44 views

Automate data entry into Access from ArcMap

I have an Access 2007-2010 database that I'm currently working on by manually searching for roads in a defined set of areas in ArcMap 10.1 and then filling in the area's ID in an empty column in the ...
1
vote
0answers
131 views

Watershed delineation; how to program

I've been trying to roll my own watershed delineation program, taking a flow direction grid and pour points as input. I coded up a quick search algorithm in Python which inspects the flow direction ...
1
vote
0answers
54 views

Where are dynamic hyperlinks stored?

A while back (ArcGIS 10.0 times, or maybe even 9.3) a colleague of mine created a mxd with a few hundred manholes and attached dynamic hyperlinks to them (pointing to photos of them). (I know this ...
1
vote
0answers
48 views

Write raster with its attribute table and symbology

I am classifying lots of rasters and I'd like to automate the legend creation and symbology displaying for easy manipulation. Here is the kind of raster I'm dealing with: library(raster) r <- ...
1
vote
0answers
45 views

how to open a layer's table in a map document

Trying to create a map document programmatically. Added a featureclass as a layer. When I open the map document in ArcMap, I want the table for that layer to be open. Found TableView (doc) and ...
1
vote
0answers
113 views

How to utilize GPSQLExpression data type in Python Toolbox

I am trying to write my first Python Toolbox for ArcGIS (neat stuff by the way). The tool is simple enough - it connects to SQL Server and downloads data for the user. The trick here is, I want the ...
1
vote
0answers
69 views

Folium GeoJSON Overlay Not Appearing

I am in the midst of a task which involves the clustering of assessment neighborhoods into larger neighborhoods (data link). The goal is build these neighborhoods in a manner consistent with major ...
1
vote
0answers
67 views

Create custom “Export To” context menu tool using selected feature in ArcCatalog

I'm trying to create a custom "Export To" script similar to the Right-Click Export Content menu item "To Geodatabase... (multiple)". I have a 3 feature classes in a file geodatabase. I selected two of ...
1
vote
0answers
34 views

Distribute QGis plugin which depends on certain Python packages

I developed a plugin for Qgis which depends on some Python packages. On Linux and Mac, this is not really a problem because I can easily install them with the system pip command. Windows is another ...
1
vote
0answers
74 views

how can i export a shapefile

hi I want to select the cities that exist in Morocco and export it to a shape file and I used this code but its not working, it gives me an error: code: import arcpy from arcpy import env ...
1
vote
0answers
18 views

Q: cursor memory and fields therein

Theoretical Python question. Say you have an update cursor while-loop for a few selected records. While looping through the rows, at some point a nested if statement triggers an "addfield" event. The ...
1
vote
0answers
73 views

Accessing existing instance of qgis from stand-alone python script

For my own data analysis pipeline, I am running a split screen setup with iPython notebooks on one side, generating variables from source data, pushing them to a csv file which qgis then reads/joins ...
1
vote
0answers
66 views

Is it possible to get field type information from FieldInfo object in ArcPy?

I'm looking at the FieldInfo object documentation for ArcGIS 10.2 and am not seeing access for field type (e.g. short, string, double). Is it possible to get field type information from the ...
1
vote
0answers
160 views

Locating the centroid (center of mass) of spherical polygons

I'm trying to work out how best to locate the centroid of an arbitrary shape draped over a unit sphere, with the input being ordered (clockwise or anti-cw) vertices for the shape boundary. The density ...
1
vote
0answers
50 views

Russian in fieldname changing with Python in ArcGIS

Is there any way to rename fieldname in the attribute table of a layer/shapefile in ArcGIS 10.2 containing russian letters? If yes, is it possible to do it in a script?
1
vote
0answers
53 views

How to create a startup prompt that populates definition queries on multiple feature classes

I would like to create an ArcGIS start up prompt or custom button that asks for a user's initials and then populates multiple feature class & layer definition queries. More specifically, I would ...
1
vote
0answers
58 views

Access to python addin objects/variables in python window

Following up on this question: Can a Python script be executed from a .NET AddIn and also write its standard output and geoprocessor messages to the ArcMap Python Window? Is is possible to access ...
1
vote
0answers
115 views

arcpy symbology colors changing on RefreshActiveView()

I have a problem that I'm not sure is functionality not built into arcpy or I'm just doing something wrong. I'm using arcpy.mapping.UpdateLayer() to apply symbology to a layer, but afterwards some ...
1
vote
0answers
35 views

Communicate synchronously & continuously (coords, etc) from terminal to application-based mapping software such that updates are displayed live on map

I run a lot of spatial queries. Hundreds of thousands a week. While these things are running, it would be nice if I could see what (where, actually) my scripts are working with. Distance calculations, ...
1
vote
0answers
61 views

What is the best way to handle geometries between Python functions?

What is the best way to handle geometries between different Python functions? For example: I have a function that exports a line from grass.script. The line will be a parameter of another function ...
1
vote
0answers
80 views

GDAL and Python: How to “pad the extent” or otherwise handle band.ReadRaster() for area falling slightly outside the image bounds?

In a nutshell, I'm trying to create a bare-metal tiling utility using GDAL and Python. As you can see in the graphic below, which shows the perimeter of a raster and the OSM-structured tile index, ...
1
vote
0answers
126 views

Unable to use pyQGiS in a custom application - import arcgis.core error

I'm using windows 7 and/or 8 64 bit with QGiS 2.01. I'm wanting to us the pyQGiS tools in a custom python application outside of the QGiS environment (i.e by running a python executable located in ...
1
vote
0answers
94 views

Matplotlib Basemap Resolution with PyQt makes Python Quit Unexpectedly

I'm having difficulties using Matplotlibs Basemap in combination with a PyQt4 interface. Basically I create a Pyqt4 Canvas in which I plot a Matplotlib Basemap and some markers. I call the function in ...
1
vote
0answers
82 views

Efficient computation of path profile with Numpy and GDAL

I have numpy array with SRTM elevation data and I need calculate path profiles - vectors with elevation data from one point (transmitter) to every points of my map. Here's my current solution: def ...
1
vote
0answers
67 views

AttributeError: Error in getting tool information when using TableToTable tool

I am trying to use the arcpy.TableToTable_conversion tool in my python script, but seem to be getting the following error on the line arcpy.TableToTable_conversion("FINAL_NLPG", ...
1
vote
0answers
87 views

Composite bands produces a single band image

Running this produces a single band tif and not a three band image. Has anyone seen this before or can suggest ways to trouble shoot it? Input_Rasters = path + parentdir + "/" + dir + "/" + ...
1
vote
0answers
215 views

Couldn't load PyQGIS, QGIS 2.0.1 on Ubuntu 12.04 Precise

After upgrading to QGIS 2.0.1 I still get the error: Couldn't load PyQGIS. Python support will be disabled. Traceback (most recent call last): File "", line 1, in File ...
1
vote
0answers
44 views

Obtain virtual output directory path in geoprocessing service

I am publishing a geoprocessing service and I want to be able to access the virtual output directory path configured for the service. Now I know that gp services will magically return virtual paths ...
1
vote
0answers
123 views

How to change the color of a selected feature with pyQGIS?

is it possible to change the color of a selected feature in qgis 1.8? To highlight a feature I use: vlayer.setSelectedFeatures(selectedList) box = vlayer.boundingBoxOfSelected() ...
1
vote
0answers
71 views

How to join attributes by location with command line

I would like to joint the attributes of 2 shapefiles by location but with a command line (linux). This feature is easy in QGIS but it is VERY slow. Is there a way of doing this with ogr or pyqgis ? ...
1
vote
0answers
131 views

merge_management

Here is the edited code: import arcpy import os from arcpy import env set the environment settings env.workspace = "C:\RG\Kings County\Test.gdb" fcs = arcpy.ListFeatureClasses("Sub_NVF_*") ...
1
vote
0answers
165 views

Pyshp 1.2 example from documentation fails

I must be doing something really stupid because I am trying to run an example straight from the PyShp (shapefile.py) 1.2 documentation with the only change being the input shapefile and it is failing. ...
1
vote
0answers
82 views

Modifying Raster Layer with Python Console

Forgive me if this has been asked somewhere else. I am looking for a way to edit a raster file which has already been loaded into QGIS through the python console (i.e. I would like to edit the raster ...
1
vote
0answers
57 views

Reference to Basemap instance's coordinate system

I use the matplotlib basemap toolkit (mpl_basemap.Basemap) to plot GeoTIFF images on a map background using pcolor() or pcolormesh(). For this purpose, I need to transform a meshgrid of x and y ...
1
vote
0answers
61 views

How to create a schematic view of a line feature?

DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far… I have a line feature (polyline with curves) in ArcGIS Desktop, and I want to create a linear representation (straigth line) of the ...