Being able to add/remove attributes isn’t actually a very new feature
for QGIS at this point. However, to date non of the fTools functions
(Vector menu) have taken advantage of this capability. If a tool needed
to create a new field in the input vector layer, it simply wrote a new
version of the vector layer to disk with the additional fields added.
There have been several requests to allow some tools to add/update
attributes directly on the input layers, so I went ahead and created a
script to test this functionality out. I’ve
provided a copy here
for anyone who would like to test it out before I add it to QGIS
permanently. Basically, the script will replace/update three of the
Vector menu tools, including Analysis \> Sum line lengths
, Analysis
\> Points in polygon
, and Geometry tools \> Add/Export geometry
info
.
- Sat 12 March 2011 cfarmer
Because its Friday
Sat 06 November 2010 cfarmerMy two favorite scientific programming languages are Python and R, each for their own specific strengths. I stick with R for most of my serious stats stuff, but for everyday processing, analysis, and GUI building, Python is my modus operandi. Lately however, I’ve been doing more and more things in Python… even the stats stuff. When doing statistical analysis in Python, I usually use the excellent rpy2 library to communicate between Python and R. As a result, I have put together quite a few little code snippets to work with R commands in Python. Recently, I decided to put ...
Evolution is beautiful…
Wed 27 October 2010 cfarmerCheck out this video of the evolution of OpenSteetMap in Europe! It sure is cool to see how much ground a bunch of nerds with GPS units can cover! Link courtesy of slashgeo.org.
pgRouting, OpenStreetMap, and QGIS
Thu 14 October 2010 cfarmerI mentioned a few posts back that there was a great resource for downloading OpenStreetMap data, and that it was relatively easy to import osm data into
PostgreSQL
/PostGIS
for use withpgRouting
to calculate shortest paths and various other network-based operations. In this post, I’ll outline the steps required to get all this up and going, and provide a quick example to show how this can be combined with QGIS to visualise the computed shortest path directly.Happy 42 day!
Adding a bit of class(ification) to QGIS…
Wed 29 September 2010 cfarmerIn my last post, I implemented several classification algorithms for quantitative data which could be used directly from the Python console in QGIS. While this was a handy addition to my PyQGIS toolkit, it wasn’t quite handy enough for me, so I decided to (re)implement the same algorithms in C++ so that they could be added directly to the QGIS API. Before I did that however, I wanted to fix a few issues, and speed things up a bit, particularly for the Jenks Natural Breaks algorithm, which can be quite slow for large datasets.
After porting everything over ...
Playing around with classification algorithms: Python and QGIS
Thu 23 September 2010 cfarmerData visualization is part of my everyday work-flow. More often than not, I’m playing around with my data in a GIS to tease out interesting or informative spatial patterns, or to ensure that I’m getting the results that I’m expecting. As a result, I am constantly trying out different classification schemes to help me generalize spatial patterns, highlight outliers and/or patterns, or just plain mess around with my data.
New online GIS resource
Thu 29 July 2010 cfarmerThe new Geographic Information Systems Stack Exchange site is now open to the public!
It’s brand new, and has the potential to be an extremely valuable resource for GIS professionals, academics, enthusiasts, and just about anyone else looking for answers to GIS related questions. Check it out here: http://gis.stackexchange.com