Python is an open source interpreted programming language used in many GIS programs.
0
votes
1answer
32 views
How to Average neighboring county data and store in original?
I have data for several rain stations, i have averaged the data and given each county a value. Some counties have null values and I would like to pull the data from the all the bordering counties and ...
18
votes
6answers
3k views
Has anyone found any informative documentation about ESRI's ArcPy Python module?
Has anyone found any informative documentation about ESRI's ArcPy Python module?
0
votes
0answers
32 views
Missing SIP Module in QGIS on Debian Squeeze
Python environment is not loading and shows this error:
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named sip
Versión de Python:
2.6.6 (r266:84292, Dec 26 2010, ...
0
votes
1answer
34 views
How can I avoid UnicodeEncodeError when using geoprocessing tools in QGIS?
I have a shapefile, that I want to split with the "Split Layers by Field"-tool. Due to some umlauts (ä,ü,ö) there will be a python error as soon, as the tool reaches a feature with an umlaut. The ...
0
votes
1answer
53 views
python script in modelbuilder: get field value and return boolean expressions
I have problems integrating a python script in a modelbuilder tool. I'm a absolute beginner with python. Maybe there's also an easier way to solve this problem in modelbuilder without using a python ...
0
votes
1answer
34 views
Rendering a layer in ArcMAP using ArcObjects and Pyhon
I succesfully wrote a script to render a Uniquevaluerenderer in a layer in ArcMAP using symbols from 4 parameters (values) read from the attribute table of the layer. I used ArcObjects and VBA, but ...
1
vote
2answers
79 views
Raster Calculator question for Multiple Rasters
I am having trouble for writing script in Python (ArcGIS 10.1). The task is generally divide each raster by 100. I have many of these raster files....
So what I've done is the following:
from ...
1
vote
1answer
61 views
GDAL bindings problem with ArcMap 10.1 Python tool
I'm really getting mad with this. ArcGIS sometimes can be so just...irritating!
Forgive me if this question is by any means duplicating this one or similar ones, but I really can't find my way out of ...
4
votes
3answers
269 views
How do I access an attribute table within a shapefile and replace values?
I would like to find a Python script that will access an attribute table within a shapefile and either update or replace records inside a field column. More specifically, I would like to use the ...
0
votes
0answers
18 views
Orthographic reprojection with mapnik
I am trying to create a google earth like wep application. My problem is that I can't get to render a full view of the earth.
The zoom_all() function generates the following error :
RuntimeError: ...
0
votes
1answer
50 views
How to find locations for hydro power using raster analysis?
I have a stream network and DEM file both in raster format. I need to extract values from DEM to stream network. For the analysis in stream network after that, I need to find out the places for hydro ...
3
votes
2answers
194 views
How to automatically reloaded raster layer if source is changed in QGIS?
How to automatically reloaded raster layer if source is changed? (The path is the same but inside source file are changes)
I use:
qgis.utils.iface.mapCanvas().refresh()
but layer not refresh.
#
...
0
votes
0answers
59 views
How to use more than one QT form in Qgis Python? [closed]
I need a help to use multiple qt forms in PyQgis. For example, i need to open one qt form after the login form.
I tried like this:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core ...
1
vote
1answer
88 views
How to evaluate raster calculator expressions from the console?
How can I execute from the console an expression that should be used with the raster calculator?
I'm searching for something like this:
qgis.someRasterCalcClass.evaluate("boh@1 + boh@2", ...
3
votes
3answers
127 views
Updating Attributes using Pyshp
Is it possible to update an attribute field in a shapefile using pyshp ?
I went through their documentation and all they show is how to create new attribute rather than editing or updating an already ...
0
votes
1answer
70 views
Using the API of QSpatiaLite plugin
I am using the popular QSpatiaLite plugin for QGIS. Since I am creating and modifying SpatiaLite tables directly with Python (using pyspatialite), I wonder whether I can automate tasks such as ...
0
votes
2answers
98 views
How to add a column in QGIS via python
I have a point shapefile and a polygon shapefile in QGIS
now I want to use the point shapefile's value add to polygon shapfile(be a column in the end)
there are colors with each value
and make the ...
1
vote
4answers
97 views
Get vector features inside a specific extent
The problem:
I have a very large vector layer with many features and a much smaller raster layer in a defined region. I want to get only those vector features which are within the raster layers ...
4
votes
2answers
268 views
How to write Shapely geometries to shapefiles?
Can someone demonstrate a simple way to write geometry data-structures from shapely into shapefiles? I am particularly interested in polygons with holes and linestrings. It would also be beneficial to ...
5
votes
2answers
594 views
Generating GeoJSON with Python
Hi I want to programatically create a GeoJSON file using polygons from a shapefile but adding attributes from my own application.
This is easily done for a shapefile:
def ...
20
votes
8answers
1k views
How to easily shift all features in a vector dataset?
Let's say that I put together a Shapefile and all the features have their vertices shifted by a constant amount. What's the easiest way of shifting all the features (hence the (x,y) position of their ...
8
votes
4answers
845 views
Is there a mapping between OGR and python data types?
I'm writing a shapefile using OGR in python, creating fields on-the-fly from a python data source. Creation of a new field requires an OGR data type, is there a mapping between OGR and python data ...
5
votes
2answers
512 views
Python: How to export Shapely objects to DXF file
Using shapely package for Python how to export the resulting shapely objects such as buffer to a DXF file?
1
vote
1answer
154 views
Find and replace unicode character in a shapefile
I've found several example of script and blog posts on working with unicode characters, but I haven't been able to make anything works so far... It's a little frustrating
I have a shapefile encoded ...
5
votes
2answers
282 views
How to get text attributes from shapefile with python / pyshp
I have a shapefile, containing only points in XY-coordinates and a string attribute for each point. I would like to read the coordinates and the attribute for postprocessing in python, but can't get ...
0
votes
1answer
66 views
Is it possible to use GDAL to combine (rather than mosaic) rasters
Is there a GDAL command which can combine multiple rasters so that a unique output value is assigned to each unique combination of input values, like the combine command in ArcGIS?
gdal_merge seems ...
5
votes
1answer
106 views
How to create a dropdown menu in QGIS Toolbar with Python
I Have a set of some QAction in my QGIS-Plugin and they are created and added to the toolbar like this
icon = QIcon(":/action1.png")
self.action1 = QAction(icon, u"Action 1", self.iface.mainWindow())
...
6
votes
1answer
440 views
Is there a way to access QGIS plugins in Python?
Is there a way to access QGIS plugins in Python? I'd like to write a script to do some geoprocessing, and I'd like to use the clip, regular points and convex hull tools in fTools, as well as the Road ...
0
votes
1answer
29 views
using ZonalStatisticsAsTable in python script
I use a python script in which the function ZonalStatisticsAsTable is called. In ArcGIS9.3 it all worked fine. Our company just went to ArcGIS 10.1 and now it doesn't work anymore.
When looking ...
7
votes
4answers
2k views
How to develop GUI in Python for geoprocessing?
I want to develop GUI in Python for geoprocessing, but I don't know what is the best GUI tool or library (Tkinter, PyQT, wxPython) for geoprocessing? Can I use PyQT for GUI programming in ArcGIS?
0
votes
0answers
43 views
qgis python app how to add edit feature button?
I'd like to develop a QGIS Python app for plotting points and editing the attributes. I've started with the tutorials here: http://blog.qgis.org/?q=node/59 and read the cookbook ...
5
votes
5answers
768 views
Python, shapely library: is it possible to do an affine operation on shape polygon?
I am trying to create a rotated rectangle in lat/lon coordinates.
Basically I have the coordinates of the center and rotation angle around the center.
Is it possible to do using, shapely or gdal, or ...
4
votes
1answer
481 views
Using Gui tools and arcpy.mapping
For a project I want to create a little program that does simple things like export a map from the python command line, but also users are able to edit said map (without having to open arcmap) e.g ...
4
votes
5answers
2k views
How do I build a form within ArcMap?
I am building a file geodatabase using ArcGIS. The gdb is going to be distributed to dozens of 'stand alone' machines. End users are expected to populate the gdb with data. End users do have ArcGIS ...
1
vote
1answer
73 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 ...
3
votes
1answer
104 views
Python Script for getting elevation difference between two points
I have several stream segments 1000 Km long. I need to find the elevation difference between two consecutive points of distance 1 Km starting from the upstream to downstream. How can I get the ...
0
votes
0answers
142 views
Problem reading attribute with Python using osgeo.ogr
I am working thru "Python Geospatial Programming" and I have a problem in a program in Chapter 6 that I cannot seem to solve.
The small program:
import osgeo.ogr
shapefile = ...
1
vote
1answer
40 views
Append to rather than overwrite to a single table in arcpy
The code thus far works to create multiple output files, but I'd like to set it up so that the data is all exported onto a single table across multiple rows. The issue is I believe with the part in ...
2
votes
1answer
216 views
RT Sql Layer plugin giving an error
I am trying to use the aforementioned plugin with QGIS 1.7 and Postgres 9.0/PostGIS 1.5.
Added a PostGIS spatial layer w/out a problem and then clicked on the RT Sql layer button which displayed the ...
1
vote
2answers
74 views
access attributes of one class for use in another class in python add-in
I want to get combobox attribute 'dem' and use it for further processing in class ExtentData. But I am not sure how to get attributes from one class to another for processing in pythonaddin. In ...
3
votes
2answers
115 views
Csv to Shp conversion? [duplicate]
I am working on a really big script right now where I have a csv file that I have removed rows and columns from, and edited the headers. I need to create one big shapefile for the entire csv file then ...
1
vote
1answer
104 views
Reverse geocoding to get city, state, country data separately?
I have longitude and latitude data. I need to reverse geocode to get city, state, country data separately.
I have checked google service.
Google provides complete address to a micro level. ...
23
votes
2answers
959 views
Streamlining Python Code for Big Data
I have Python code which is designed to take point shapefiles through the following workflow:
Merge points
Integrate points, such that any points within 1 m of each other
become one point
Create ...
2
votes
1answer
37 views
Geopy Error with Reverse Geocoding
I am using Geopy. I get following error for the code.
I have using the same code as on https://code.google.com/p/geopy/wiki/ReverseGeocoding
from geopy import geocoders
g = geocoders.GeoNames()
...
5
votes
2answers
151 views
Accessing ESRI Arcpy modules from Enthought Canopy
I've got ArcGIS 10.1 running on my windows system and I've
installed the new 32-bit Canopy Express Enthought Python Distribution.
Is it possible to load and use the ESRI arcpy modules from Canopy?
4
votes
1answer
95 views
Speed of editing attributes in QGIS from a Python plugin
I'm trying to edit the value of an attribute for each feature in a layer using a QGIS Python plugin. I've found that doing this outside of editing mode is much slower than while editing (even ...
1
vote
1answer
57 views
How to add MS SQL table using python console?
I have MS SQL Server 2008 R2 database. How to add MS SQL Table using python console in QGIS?
0
votes
1answer
53 views
Error: Exception Raised on the “for row in rows” command line?
I am comparing fields in layers. I have the AADT layer and AADTAnno layer and I want it to search the fields FLAG and TFLAG. For Example: If there is a 29C9 in AADT layer in FLAG fields then there ...
1
vote
1answer
64 views
How to “Merge Selected Features” with python?
I have been looking for the answer to this question for some time now, but can't seem to find it! My problem is straight forward:
I have one layer
It contains lots of features (only polygons), say ...
3
votes
1answer
52 views
Get the total distance from a point to the end of a linestring
I have a list of GPS coordinates that make up a bus route:
busRoute = [(x1, y1), (x2, y2), ... (xn, yn)]
I also have a point that may not be exactly on that route (due to GPS error):
...





