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

learn more… | top users | synonyms

1
vote
1answer
54 views

How can I use pyqgis to automate a series of field calculations?

I've got a shapefile with about 30 fields that I'll need to update from time to time by importing a CSV with new data, joining it to the shapefile, and using the field calculator to carry the new ...
1
vote
0answers
62 views

Problem with polygon overlay in raster stats using gdal

I am using the raster_stats module in python to calculate the mean carbon value for different sets of polygons. Here is the code that I am using: africa_sat = ...
1
vote
1answer
59 views

Excel/Google Docs > Plss Map [closed]

Is there a way to map out PLSS (Public Land Survey System) TWP (township),RNG (range) and Section based off a field in google docs? I was thinking if you had your first column with the PLSS area in ...
1
vote
0answers
69 views

How do I smooth edges of polygons in QGIS?

Is there a built in function or plugin I can use to achieve smooth lines for my polygons instead of the blocky ones I have now?
1
vote
0answers
69 views

Decompress a LZW-compressed GeoTIFF

I have a LZW-compressed GeoTIFF file and would like to split it into several smaller regional files and change the format to png. I tried to do the spliting with gdal_translate -srcwin. I only get a ...
1
vote
0answers
57 views

How can a script tool share (dynamic) variables among different modules?

I'm running a python script from the toolbox window (as a script tool). I have a second python (tkinter) module that I use as an input interface. Now, I know that the script tool can call the ...
1
vote
1answer
127 views

PGRouting Layer plugin error in QGIS 2.2

I am trying to do some basic computations using the PGRouting plugin for QGIS, but I am getting this error all time: An error has occured while executing Python code: Traceback (most recent call ...
1
vote
0answers
56 views

using arcpy to query sde database in python

I have three variables: view_name, column_name, and column_content. column_name contains id, name, address, etc. column_content contains 123, John, 200 King st, etc. user specifies the column_name ...
1
vote
1answer
37 views

Can i use CreateMapSDDraft in the arcpy.mapping library to set the scale range on tiled services at 10.1?

I know that esri has exposed many properties to the acrpy lib for publishing services. I need to published a tiled/cached map service but i need to set the min/max scale when i do that. Can this be ...
1
vote
1answer
157 views

Python: Ray-trace a WGS84 point with heading and distance

One of my services defines geofences for a mobile app. The geofences consists of a lat/lon pair and radius in meters, in JSON, e.g.: { "geofenceId":"geofence_b39da38cff7be4b4693cbc31b2394bbb", ...
1
vote
1answer
49 views

QGIS Custom Form: “Other” category in combo box replaced by line edit

I am trying to create a custom form for QGIS 2.0 with comboboxes containing an "other" category. I wonder how to provide a line edit to enter info replacing the "other" choice if chosen. Not sure if I ...
1
vote
0answers
41 views

model to connect points with line and set the digitize direction according to height

I'm trying to develop a tool that connects a point layer (manholes) with lines (waste water pipes) and sets the line direction according to an height attribute acording to gravity(from high to low). ...
1
vote
0answers
93 views

Running python script outside of Arcmap's python console

My codes works fine in Arcmap's python windows. But when I try to run it in a command promt windows, It says that; ERROR 000837: The workspace is not the correct workspace type. But it works fine ...
1
vote
0answers
63 views

How to use GDAL on Heroku?

I have a geospatial python app that I want to use on Heroku. This is my requirements.txt file: Flask==0.10.1 Jinja2==2.7.2 MarkupSafe==0.19 Werkzeug==0.9.4 gunicorn==18.0 itsdangerous==0.23 ...
1
vote
0answers
119 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
1answer
41 views

GeoDjango Scale/Layers issue?

I've been having issues visualising data from a shapefile in GeoDjango using OpenStreetMaps. I believe it's some sort of a scale issue because of how it appears(as you can see in the screenshot of the ...
1
vote
0answers
36 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
51 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
73 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
70 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
21 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
69 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
184 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
1answer
66 views

Gdalinfo and QuantumGIS does not recognize Spatial Reference even though Python does

I apply the following Spatial Reference to a file: spatialRef = osr.SpatialReference() spatialRef.ImportFromEPSG(3411) outraster.SetProjection(spatialRef.ExportToWkt() ) geotransform = ...
1
vote
0answers
32 views

How to replace accented strings in attribute tables using Python or VBA ArcGIS 10.2 [duplicate]

I need to replace accented words, into the Field Calculator, to the same non-accented ones. For example: María ---> Maria Need some help with this VB Code: Dim data as integer Dim contador Dim ...
1
vote
2answers
765 views

Qgis - Couldn't load plugin 'processing' - name 'QsciLexerCustom' is not defined - Manjaro

UPDATED I receive the following error when I start Qgis: Couldn't load plugin 'processing' from ['/usr/share/qgis/python', '/home/v/.qgis2/python', '/home/v/.qgis2/python/plugins', ...
1
vote
0answers
13 views

ArcGIS 000210 error copy to feature class [duplicate]

I have a script tool that: Creates a feature dataset within a file geodatabase Performs a Select by Attributes on a cadastral layer Copies the selected polygons into the feature dataset. The copied ...
1
vote
0answers
66 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
108 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
1answer
71 views

How does the tolerance influence QgsGraphBuilder and tieing of points?

I am developing a script which uses OpenStreetMap data to calculate the distance (over the road network) between each building and the nearest hospital. To do this, I mainly follow the official ...
1
vote
1answer
94 views

Why does connect to Excel spreadsheet through ArcPy give ERROR 000582?

My ultimate goal is to automate kernel density analysis on xy data from a table. I am trying to learn Python but I am very new. I built a simple model to take table data and display xy data. When I ...
1
vote
1answer
108 views

QGIS Python Labelling

i want to label a point layer with those values exceeding a set of variables attribute table as follows 'loc field'(text),'a'(float),'b'(float),'c'(float) variables as follows vara = 5, varb = 3, ...
1
vote
0answers
36 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
49 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
1answer
43 views

Python script to select a point within a cell?

I have two features: points and grid cells (vector). I want to select a point within a grid cell (some cell do not have point) using python script and create a new feature layer with below conditions: ...
1
vote
0answers
235 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
52 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
1answer
62 views

no output file with grass:r.los

i'm using qgis 2.0 and i want to calculate a viewshed using r.los from grass tool box. after typing in the python console and a few seconds, i don't get an error message, but there is no file. the ...
1
vote
0answers
187 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
65 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
61 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
2answers
46 views

Old Windows Installers for python library fiona

Due the the recent bug as presented here for fiona 1.1, i am obliged to use a version of fiona in 1.0.x on windows 8.1. however, i can't find older versions of the installer at here. Are there any ...
1
vote
0answers
51 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
135 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
1answer
35 views

How to do “random” distribution of certain classes to certain amount of polygons with respect to spatial constraints

I have a polygon layer. Now, I would like to assign/allocate/classify these Polygon into 13 different classes respecting spatial constraint, in my case: neighboring polygons (sharing line or nodes) ...
1
vote
0answers
78 views

Python script does not work for a LGA with space [closed]

Thanks! I got my script working now with replace gp.AddMessage() instead of print when running the script in ArcMap and replace the quote with blank as well since Python would include the quotation ...
1
vote
0answers
152 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
1answer
254 views

Convert polygons in shape file to a numpy array?

I have a shape file containing a number of polygons and all attributes being text. I'm trying to import the polygons into numpy as an array where each polygon is represented as unique values. I ...
1
vote
1answer
136 views

Using a Select By Location in Python and Calculating a field based on what State Plane a point falls in

Here's what I have so far. Do I need to make another feature layer based on the selection? import arcpy arcpy.MakeFeatureLayer_management(r"PATH TO THE POINT", "point_lyr") ...
1
vote
1answer
32 views

which feature of toolboxes will be appropriate for building a groundwater model in Model Builder [closed]

I am completely new to ArcGIS Model Builder and also Python scripting. However, I want to build a model to automate groundwater recharge.