PostGIS has supported curved geometry types — CIRCULARSTRING, COMPOUNDCURVE< CURVEPOLYGON — since version 1.4, but the number of functions that directly calculate against the curved features has remained pretty small. You can generate a bounding box, or calculate a length, but that’s about it.
In order to do more complex calculations like area calculation or intersections, you have to first convert the curved object into a linearized approximation, using the ST_CurveToLine function. This is fine for functions that return numbers (like ST_Area) or booleans (like ST_Intersects), but what about functions that return derived geometries?

Linearized version of the compound curve. The arc has been replaced by a regular collection of lines.
For derived geometries, the result will be linearized like the inputs. But portions of the geometry will be linearized versions of the original curves: wouldn’t it be nice to have those curves back for storage?
Yes, it would which is why ST_LineToCurve exists. The line to curve logic works on the premise that a linearized version of a curve will have a certain amount of regularity in it.
The version of the code from PostGIS 1.4 and 1.5 works by looking at the angles between successive segments. Segments that share an angle of deflection with neighbours are probably components of a circular arc. This worked OK, but the code involved a fair amount of trigonometry.
A simpler approach used for 2.0 turned out to be looking at the circle the arc is inscribed on. Any circular arc in PostGIS is defined by a start point, mid point and end point. Between them, they imply a circle, and the center of the circle can be calculated. Any successive point which is the same distance from that center point as the arc points can be considered part of the arc.

By using the circle as a basis for comparison, each successive point needs a simple distance check, instead of a trig check.
The new code is a lot simpler, and can deal with derived segments of more variable length that the old code.
The simplest way to prove that it works is to wrap a curved geometry in multiple nests of ST_LineToCurve and ST_CurveToLine, pushing the geometry back and forth between representations. While the functions are not perfect inverses (the segmentization routine doesn’t necessarily include the middle control points of the input arcs) you can see that the space bounded by the geometries does not change.
Happy curving!
In the geospatial software I'm writing and using these days, concerns are well separated. Fiona reads and writes features. Only. Shapely provides computational geometry algorithms. Only. Pyproj (not my work, but a favorite package) transforms coordinates between spatial reference systems. Only. The separation of concerns helps keep interactions between them predictable and as a user you pay only for what you eat.
A programmer-analyst's daily work has all the above concerns (and more, probably). A pip requirements file makes installing all three packages as easy as installing a single package like osgeo.ogr. I've uploaded one to GitHub: https://gist.github.com/1689767. This Gist includes an example of using Fiona, pyproj and Shapely together. Fetching them all, assuming you've got pip and the GDAL/OGR libs and headers already on your system, is just:
$ pip install -r https://raw.github.com/gist/1689767/34dedfd28546d41f8dbd7a08ccf2c8abf9ebdf6a/mersh.txt
by Sean Gillies (sgillies@frii.com) at January 27, 2012 05:52 PM
The QGIS Python console is great for doing one-off tasks or experimenting with the API. Sometimes you might want to automate a task using a script, and do it without writing a full blown plugin. Currently QGIS does not have a way to load an arbitrary Python script and run it1. Until it does, this post illustrates a way you can create a script and run it from the console.
There are a couple of requirements to run a script in the console:
By default, the Python path includes the .qgis/python directory. The location depends on your platform:
To see what is in your PYTHONPATH you can do the following in QGIS Python console:
import sys sys.path
While you could use the .qgis\python directory for your custom scripts, a better way is to create a directory specifically for that purpose and add that directory to the PYTHONPATH environment variable. On Windows you can do this using the Environment Variables page in your system properties:
On Linux or OS X, you can add it to your .bash_profile, .profile, or other login script in your home directory:
export PYTHONPATH=$PYTHONPATH:/home/gsherman/qgis_scripts
With the environment set, we can create scripts to automate QGIS tasks and run them from the console. For this example, we will use a simple script to load all shapefiles in a specified directory. There are a couple of ways to do this:
We will use the latter approach because it is more flexible and allows us to initialize once and then call methods without having to pass the iface object each time.
The script looks like this:
#!/usr/bin/env Python """Load all shapefiles in a given directory. This script (loader.py) runs from the QGIS Python console. From the console, use: from loader import Loader ldr = Loader(qgis.utils.iface) ldr.load_shapefiles('/my/path/to/shapefile/directory') """ from glob import glob from os import path class Loader: def __init__(self, iface): """Initialize using the qgis.utils.iface object passed from the console. """ self.iface = iface def load_shapefiles(self, shp_path): """Load all shapefiles found in shp_path""" print "Loading shapes from %s" % path.join(shp_path, "*.shp") shps = glob(path.join(shp_path, "*.shp")) for shp in shps: (shpdir, shpfile) = path.split(shp) self.iface.addVectorLayer(shp, shpfile, 'ogr' )
To open the console use the Plugins->Python Console menu item.
The comment at the head of the script explains how to use it.
First we import the Loader class from the script file (named loader.py). This script resides in the qgis_scripts directory that is our PYTHONPATH.
from loader import Loader
We then create an instance of Loader, passing it the reference to the iface object:
ldr = Loader(qgis.utils.iface)
This creates the Loader object and calls the __init__ method to initialize things.
Once we have an instance of Loader we can load all the shapefiles in a directory by calling the load_shapefiles method, passing it the full path to the directory containing the shapefiles:
ldr.load_shapefiles('/home/gsherman/qgis_sample_data/vmap0_shapefiles')
The load_shapefiles method uses the path to get a list of all the shapefiles and then adds them to QGIS using addVectorLayer.
Here is the result, rendered in the random colors and order that the shapefiles were loaded:
1. I have plans on the drawing board to implement this feature.
Roundabouts are handled interestingly in OSM: They can be both nodes or ways and represented as points, lines or polygons.
And this is how they can be downloaded for a specific area:
> wget http://open.mapquestapi.com/xapi/api/0.6/node[highway=mini_roundabout][bbox=15.86,47.95,16.88,48.70]
> wget http://open.mapquestapi.com/xapi/api/0.6/way[junction=roundabout][bbox=15.86,47.95,16.88,48.70]
Note: Not all XAPI servers are available all of the time. Check this site if the server is down: OSM Wiki – Xapi.
"Where to start with Geospatial Open Source Software, and how to build a business around Open Source products".Speakers at the GeoNext conference are covering topics around emerging geospatial business trends, which are being driven by such things as mobile phones, commoditisation of data, and web 2.0 principles such as crowd sourcing. It is running in Sydney, Australia on 29 February 2012. More details here: http://geonext.com.au/
by Cameron Shorter (noreply@blogger.com) at January 27, 2012 01:46 AM
OpenGeo Announces Gold Level Sponsorship for 2012 FOSS4G-NA
FOSS4G North America Regional Conference to be Held in Washington, D.C.
New York, NY, January 26, 2011 — OpenGeo, the organization behind the OpenGeo Suite has announced their sponsorship of the 2012 FOSS4G-NA conference. The Free and Open Source Software for Geospatial - North America (FOSS4G-NA) conference will be hosted by OSGeo North America from April 10th to 12th, 2012 at the Walter E. Washington Convention Center in Washington, D.C. Confirmed keynote speakers include Michael Byrne, CIO of the Federal Communications Commission (FCC).
OSGeo North America is the newly-formed North America chapter of OSGeo, an international not-for-profit whose mission is to support and promote the collaborative development of open geospatial technologies and data. OSGeo North America has scheduled this regional follow-up to focus on the North American open source geospatial community. Just as they did at the 2011 FOSS4G global conference in Denver, OpenGeo is once again committed to a gold level sponsorship, In addition, this year members of OpenGeo are also volunteering on the conference organizing committee.
Eddie Pickle, OpenGeo COO said "Supporting FOSS4G and OSGeo is a top priority for OpenGeo. FOSS4G is always a key forum for meeting with our friends, clients, and partners as well as for exchanging knowledge to improve open source geospatial software. A regional event in Washington, D.C. will allow us us to focus on the evolving landscape of open source geospatial in North America. We’re especially interested to see how government agencies have been adopting open source technology to address their needs." He continued "We’re also happy to announce that our own Paul Ramsey has volunteered to be the FOSS4G- NA 2012 conference chair; we know the conference will be a success with Paul at the helm."
About FOSS4G-NA 2012
FOSS4G is an annual global conference organized by OSGeo that focuses on bringing together individuals and organizations working with free and open source geospatial software; FOSS4G-NA is a regional event for North America and is being organized by the North American Regional chapter of the Open Source Geospatial Foundation (OSGeo), with additional support from members of a volunteer program and conference committee and the conference sponsors
About OpenGeo
OpenGeo is a social enterprise working to build the best web-based geospatial technology. The company brings the best practices of open source software to geospatial organizations around the world by providing enterprises with supported, tested, and integrated open source solutions to build the Geospatial Web. OpenGeo also supports open source communities by employing key developers of PostGIS, GeoServer, and OpenLayers. Since 2002, the company has provided successful consulting services and products to clients like the World Bank, Google, Ordnance Survey Great Britain, Portland TriMet, MassGIS, Landgate, and the Federal Communications Commission. OpenGeo is the geospatial division of OpenPlans, a New York-based 501(c)(3) non-profit that informs and engages communities through journalism and open source software. All of OpenGeo's revenue has been and will continue to be re-invested into innovative and useful software in support of the OpenPlans mission.
Related Links
FOSS4G-NA 2012 Conference - Washington, DC
FOSS4G 2012 - Beijing, China
OSGeo North America
Open Source Geospatial Foundation
Media Contact
David Dubovsky
+1 917-388-9077
david@foss4g-na.org
Daniel,
I believe the rationale behind avoiding the term Intellectual Property
has two parts.
First, it attempts to conflate a variety of very different legal mechanisms.
Primarily copyright, patents and trademarks. Giving them all one name makes
it harder to separate out things we might agree with (copyright) from things
we might not (ie. Patents).
Second, it expresses these legal mechanisms in a manner that implies that
they are some sort of fundamental or manifest right rather than limited
government granted monopolies intended to serve specific needs of society
[...]You can read the full email and the rest of the thread here.
by Daniel Morissette (noreply@blogger.com) at January 26, 2012 06:22 PM
by Andrea Aime (noreply@blogger.com) at January 26, 2012 10:42 AM
The recent stable version of Spatialite, 3.0, supports linking to and importing Excel spreadsheet tables. Read on to see how it’s done.
The developers of spatialite have added a driver for *.xls files (thru the FreeXL library ). You can either link to, or import a single sheet from an Excel file provided that:
However the columns of data are imported into spatialite without any data type. If you want to specify the data type for each column, my procedure is:
These few steps might seems a bit complex just to get a table of data into spatialite, but this method insures that data will be structured exactly as you want.
If you’re working with spatialite from the command line, here’s the command syntax for loading an excel sheet:
.loadxl <args> Loads a XL spreadsheet (.xls) into a SpatiaLite table
arg_list: xl_path table_name
[worksheet_index [first_line_titles{0/1}]]
Note that the worksheet index begins with 0. So if you have more than one sheet in your Excel file, be sure to set the correct index for the worksheet containing the table. The last parameter indicates (by values 0 or 1) whether the first row holds column headers. So for example you could import the first sheet of an excel worksheet called ‘host_trees.xls’, which contains column headers in the first row, with the following command:
spatialite>.loadxl 'host_trees.xls' host_trees 0 1
XL loaded
3770 inserted rows
spatialite>
We’ll follow the full procedure to smoothly import a spreadsheet of longitude,latitude data and create a spatial layer with screen shots from the spatialite_gui. Suppose we begin with a table that looks like this:
First import the table using the VirtualXL button. This creates a link in the spatialite db to the sheet from Excel.
In the next image note that the linked data table has no types for the columns. So we’ll create our premanent table (named here ‘MyHostTrees’)within spatialite, specifying the correct data types, then we will transfer the date over from the virtual table to the permanent one. Follow the steps…
Now we transfer the data from the virtual table to the permanent table using the SQL construct: “INSERT (…) INTO … SELECT … FROM …”. Here’s how it looks:
We continue by making this new table a spatial table with the AddGeometryColumn() function, then we populate this Geometry column using the MakePoint() function.
And here’s the result:
The raster calculator allows you to perform mathematical operations on each cell in a raster. This can be useful for converting and manipulating your rasters. Operators include:
To perform operations on a raster or rasters, they must be loaded in QGIS. The raster calculator is accessed from the Raster menu and brings up the dialog:
Let’s look a few examples.
Doing a simple calculation is easy. In this example we have a Digital Elevation Model (ancc6) loaded in QGIS. The DEM contains elevations for a 1:63,360 quadrangle in Alaska. The coordinate system is geographic and the elevation value in each cell is in meters. If we wanted to create a raster with elevation in feet, we can use these steps to create the expression:
This gives us the following expression:
ancc6@1 * 3.28
To complete the process, we specify a name for the output raster and the format we want to use. When you click OK, the operation will be performed and the new raster created, giving us a GeoTIFF with cell values in feet. If you leave the Add result to project box checked the output raster will be added to QGIS once the calculations are done.
If you only want to operate on a portion of a raster, you can use the extent setting to limit the area included in the calculation.
Sometimes you might want to mask out part of a raster. An example might be one where you have elevations ranging from below sea level to mountain tops. If you are only interested in elevations above sea level, you can use the raster calculator to create a mask and apply it to your raster all in one step.
The expression looks like this:
(my_raster@1 >= 0) * my_raster@1
The first part of the expression in parentheses effectively says: for every cell greater than or equal to zero, set its value to 1, otherwise set it to 0. This creates the mask on the fly.
In the second part of the expression, we multiply our raster (my_raster@1) by the mask values. This sets every cell with an elevation less than zero to zero. When you click OK, the calculator will create a new raster with the mask applied.
Using the raster calculator and a mask we can visually simulate a rise in sea level. To do this we simply create the mask and overlay it on the DEM or perhaps a DRG (topographic) raster.
The expression to raise sea level by 100 meters is:
ancc6@1 > 100
The output raster contains cells with either a 0 (black) or 1 (while) value:
The black areas represent everything below an elevation of 100 meters, effectively illustrating a sea level rise. When we combine this with a suitable background we can demonstrate the results:
We added the DRG for the quadrangle and overlaid it with the mask layer. Setting the transparency to 70% allows the DRG to be seen, illustrating the effect of raising sea level.
The raster calculator is a powerful tool. Check it out and see how you might use it in your analysis and map making.
I'm learning Clojure and having fun with it. I never learned a Lisp in school like many programmers my age did. The one variant I did try, about 15 years ago, was Scheme. I did a little Gimp scripting with it but nothing else. I think I had to mature a bit before I could appreciate the Lisp style for what it is.
For a language that's designed to be more simple than easy, it's surprisingly easy to use Java classes in Clojure. This is the first code I've written using JTS classes in a while.
user=> (.buffer
(.read (com.vividsolutions.jts.io.WKTReader.) "POINT (0 0)")
1.0)
#<Polygon POLYGON ((1 0, 0.9807852804032304 -0.1950903220161282, ...))>
I assumed I'd have to write something like a Python C extension module to do this and am thrilled to be wrong.
by Sean Gillies (sgillies@frii.com) at January 25, 2012 05:13 PM
Marble 1.3 has been released with lots of new gems: Marble — the virtual globe and world atlas — now integrates with KDE Plasma. By allowing for coordinate and bookmark searches, Marble can be opened directly from the Plasma search bar.
The new Elevation Profile shows the incline of routes, which can be edited interactively.
Stargazers can view and track Earth satellites thanks to Marble participation in the European Space Agency (ESA) Summer of Code in Space.
During Google Summer of Code, Marble gained initial support for display of .osm (OpenStreetMap) files in vector format.
Owners of the Nokia N9/N950 are the first to receive the new mobile application Marble Touch.
Further details can be found in the feature guide.
We have spoken many times on this blog about our release of GeoMobile for ArcGIS. The link below will take you to a more detailed discussion:
http://www.webmapsolutions.com/free-mobile-arcgis-viewer-upgraded
Our logic for the release was:
To demonstrate a custom ArcGIS mobile application Build a cross platform mobile GIS app or one code base which runs on multiple platforms; iOS, [read full article]
Education is undoubtedly the largest propaganda weapon in this consumerist-driven society. Having just completed matric, I realize that the first eighteen years of my life has been a period of unmitigated Windows brainwashing. It is a travesty to think how the capitalist greed of proprietary software has permeated my life for so long.
I recently began working at AfriSpatial with the intention of keeping myself busy during the holiday and earn some pocket money in the process. I was required to work in Linux which was a somewhat foreign OS to me and, afraid it would mysteriously hurt my fragile Windows PC, I installed Xubuntu OSGeo Live in a Virtual Box. At this stage life was treating me well…
One day, Windows decided to do an update which broke the harmony of my Virtual Machine by somehow preventing connection to the Internet. I wasted precious hours troubleshooting every conceivable error but this was to no avail. I had two choices: either forget about Linux and revert to the primitive ways of life before Linux or take a bold new step into a brighter future. So I actually had no choice and no more patience. I had to install Linux as a dual-boot. There was no other way.
This seemingly inconsequential event instigated a change; a purgation of conscience whose effects altered the kernel of my value system. I guess in hindsight this transmogrification was inevitable for an aspiring programmer.
Having joined the ranks of the converted Linux users, life has become so much brighter, so much more fulfilling, so much more. Gone are the days of tasteless architecture and graphics. The experience has been liberating. I blame schools for polluting their computer labs with expensive proprietary software when there are open source equivalents for just about everything (and often these ‘alternatives’ are better). Open source is undoubtedly the way forward. Anything Windows can do, Linux can do better. I am not trying to be antagonistic, just honest.
These are the confessions of an ex-Windows user.
Confessions of an ex-Windows user is a post from: AfriSpatial
by Jody Garnett (noreply@blogger.com) at January 25, 2012 05:31 AM
The rule based rendering in QGIS has just got a make over to improve in some of the old usability issues it used to have. Most of the improvements are UI related. If you would like to try them out you will need to grab a copy of the latest dev build (qgis-dev in OSGeo4W)
Main improvements include:
As you can see in the screenshot, the rules are now organized in a tree which clearly expresses which rules should be applied and when.
In the example above, all the rules under the Sealed rule will only be applied if that rule is true. The old system would have you managing all rules in one big list and dealing with priorities in order to get the rules to apply right, the new dialog is a major improvement.
And the results! As you can see below, QGIS will only render the colored squares if the Sealed rule is true otherwise it just shows a green line.
The work was sponsored by Ville de Morges, Switzerland and developed by Martin Dobias. Thanks to both of them for these improvements.
More info:
Note: As this is a brand new feature there might be some bugs, or things that don’t quite work as expected. If you do find something don’t hesitate to file a bug report at hub.qgis.org so it can be fixed, or at least known about.
We recently looked back over client and potential client feedback in 2011. There were definitely some re-occurring themes. Here we summarise some of these conversations:
1) Mining
Display in a mobile map app dynamic sensor data (click on map point and its shows current data)
2) Cultural Resource Management
“Even though GPS technology has been readily adopted [read full article]
by Tyler Erickson (noreply@blogger.com) at January 24, 2012 05:14 PM
То, чего многое давно ждали, свершилось. OSGeo4W перевели на Python 2.7.2 (до этого использовалась порядком устаревшая версия 2.5.2). Переход на версию 2.7 обусловлен длительной поддержкой этой версии, множеством исправленных ошибок а также наличием большого числа новых версий библиотек, которые не могут быть собраны с Python 2.5
Ознакомиться с тем, как проходил процесс миграции можно на специальной странице Requires Python, а также в соответсвующих тикетах #214 и #219.
Необходимо помнить, что такое глобальное изменение может повлечь за собой ошибки, кроме того, некоторые пакеты все еще не адаптированы. Если в процессе работы вы столкнетесь с ошибками, сообщайте о них.
As some of you already know, at the end of last year the OSOR project forge was closed and replaced by the new Joinup service. The projects that were available in OSOR had been migrated to Joinup.
In the case of the gvSIG project, we thought the new Joinup service was not going to fulfill our needs, so we started to prepare our own services for the source and maven repositories, as well as the trackers for bugs and feature requests.
In any case we are really grateful with the OSOR team for the services provided to the gvSIG community since during all the time we where hosted there.
The migration has been already performed, and all previous gvSIG project services are already available in the new servers:
The gvsig desktop 2.0 projects maven configuration has already been updated to point to the new servers, so you should be able to compile without problems. Also a new build has been prepared (2043), already in the new servers.
The gvsig desktop application and addons will be available also through a new downloads server. All those URLs are being updated in the projects main portal, but bear us if there is still any reference to the old OSOR locations or there are still some broken references. The development downloads page is still not working 100%.
For developers, the page about how to prepare a workspace with the gvSIG 2.0 core projects has been updated also.
Sorry everybody for any problems related to the migration. We hope we can
start working again as always from now on.
Como algunos de vosotros ya sabéis, a finales del año pasado la forja del proyecto OSOR fue cerrada y reemplazada por el servicio Joinup. Los proyectos que estaban alojados en OSOR fueron migrados automáticamente a Joinup.
En el caso del proyecto gvSIG, pensamos que el nuevo servicio de Joinup no iba a satisfacer todas nuestras necesidades, por lo que empezamos a preparar nuestros propios servicios de repositorios de código fuente y maven, así como los trackers de errores y peticiones de mejoras.
En cualquier caso queremos agradecer encarecidamente a la gente del equipo de OSOR los servicios proporcionados a la comunidad gvSIG durante todo este tiempo.
La migración ha finalizado ya, y todos los servicios que teníamos para los proyectos gvSIG están disponibles en los nuevos servidores:
La configuración de los proyectos de maven de gvSIG desktop 2.0 has sido actualizada para hacer uso de los nuevos servidores, por lo que ya se debe poder compilar sin problemas. Además un nuevo build (2043) ha sido preparado, ya disponible en los nuevos servidores.
La aplicación gvSIG desktop, así como los complementos de instalación, estarán disponibles a través del nuevo servidor de descargas. Todas las URLs están siendo actualizadas en el portal principal de gvSIG, aunque es posible que queden todavía algunas referencias a las antiguas ubicaciones en OSOR o algunas referencias rotas. Además la página de descargas en desarrollo todavía no está funcionando al 100%.
Para los desarrolladores, la página sobre como preparar un espacio de trabajo con los proyectos principales de gvSIG 2.0 ha sido actualizada también.
Disculpas a todo el mundo por los problemas que haya podido causar esta migración. Esperamos que a partir de ahora todos podamos empezar a trabajar de nuevo como siempre en el proyecto.
–
gvSIG Team
We mentioned the open source MapProxy a few times since 2010, including the 1.0.0 release about a year ago. Less than two weeks ago, MapProxy 1.3.0 was released. Anyone with an interest in tile caching might be interested in reading this previous story named FOSS4G 2011: What about a Tiling Shootout?
Amongst the new features for the 1.3.0 release: "
For those who don't read our geospatial press releases feed, you might be interested in learning about the first FOSS4G - North America conference to be held in Washington DC in April 10-12, 2012. We mentioned in 2009 the possibility of a North American-specific FOSS4G conference to be organized by the OSGeo, it now has become reality.
From the press release: "In light of the success of last September’s international FOSS4G conference in Denver, Colorado, the newly-formed North America chapter of OSGeo, a not-for-profit organization whose mission is to support and promote the collaborative development of open geospatial technologies and data, seized upon the opportunity to organize a regional follow-up conference focusing on the North American open source geospatial community. “2011’s event showed us that there is great interest in the region to continue the conversation and strengthen the network of individuals and organizations working the open source geospatial field,” said Paul Ramsey, accomplished geospatial software developer and FOSS4G- NA 2012 conference chair."
From 27th to 29th June 2012, the 5th Italian gvSIG Conference (Quinte Giornate Italiane di gvSIG) [1] will be held in the “Aula Magna” of the Politecnico di Milano – Polo Territoriale di Como (via Castelnuovo, 7 – Como).
The meeting, organized by the Laboratorio di Geomatica del Politecnico di Milano – Polo Territoriale di Como and the gvSIG Association, is an interesting meeting point for changing experiences between users and developers from Italy. Seminaries and presentations are planned at the Conference.
The call for papers is now open, and proposals can be sent to the email address: giornate.italiane@gvsig.org (consult Presentation rules [2]), until May 23th.
Registration period will be opened in March 7th.
[1] http://www.gvsig.org/web/community/events/giornate-italia/2012/
[2] http://www.gvsig.org/web/community/events/giornate-italia/2012/comunicazioni
We are happy to announce that OTB and Monteverdi have entered the 3.12 release candidate stage!
You can find the source (OTB and Monteverdi) and binary packages (Monteverdi form Mac OS X and Windows) here.
Some of the notable changes in this release are:
There are a lot more new things coming with this release ! For more information, please read the complete release note available here.
As usual, Release Candidate are made to be tested and stressed, so do not hesitate to give it a try and report whatever you find suspicious on the users list, or directly on the BugTracker.
Also note that a teaser of what can be done with OTB is now available here !
Happy Testing!
Manuel, for the OTB team
Shapely 1.2.14 is up on PyPI: http://pypi.python.org/pypi/Shapely and the documentation has been updated: http://toblerity.github.com/shapely/. Mike Towes has made coordinate and (homogeneous) geometry sequences sliceable. For example, you can now get every other vertex of a line string or linear ring like this:
>>> from shapely.geometry import Point
>>> ring = Point(0.0, 0.0).buffer(1.0).exterior
>>> len(ring.coords)
66
>>> evens = ring.coords[::2]
>>> len(evens)
33
and a geometry collecting the odd points of another multi point geometry can be had like:
>>> from shapely.geometry import MultiPoint
>>> multi = MultiPoint(evens)
>>> len(multi)
33
>>> odds = multi[1::2]
>>> odds.geom_type
'MultiPoint'
>>> len(odds)
16
>>> list(odds)
[<shapely.geometry.point.Point object at 0x744d30>, ... ]
Heterogeneous geometry collections can't be sliced in 1.2.14. Down the road, maybe.
by Sean Gillies (sgillies@frii.com) at January 24, 2012 05:01 AM
Gary's updated book is now (back) in print and listed on Amazon for sale! Covering a vast array of open source software for GIS analysis, mapping and application building. With special sections focused on Quantum GIS and GRASS GIS.
For more info see our book page or the comprehensive book website. Or just buy it on Amazon.

by afabiani (noreply@blogger.com) at January 23, 2012 05:53 PM
by Jackie Ng (noreply@blogger.com) at January 23, 2012 01:57 PM
1: using OSGeo.MapGuide.Viewer;
1: public void SetCursorPositionMessage(string message)
2: { 3: 4: } 5: 6: public void SetFeatureSelectedMessage(string message)
7: { 8: 9: } 10: 11: public void SetMapScaleMessage(string message)
12: { 13: 14: } 15: 16: public void SetMapSizeMessage(string message)
17: { 18: 19: }1: public void SetCursorPositionMessage(string message)
2: { 3: lblCoordinates.Text = message; 4: } 5: 6: public void SetFeatureSelectedMessage(string message)
7: { 8: lblMessage.Text = message; 9: } 10: 11: public void SetMapScaleMessage(string message)
12: { 13: lblScale.Text = message; 14: } 15: 16: public void SetMapSizeMessage(string message)
17: { 18: lblSize.Text = message; 19: }1: protected override void OnLoad(EventArgs e)
2: {3: new MapViewerController(mgMapViewer1, //The MgMapViewer
4: mgLegend1, //The MgLegend
5: this, //The IMapStatusBar
6: mgPropertyPane1, //The MgPropertyPane
7: mgDefaultToolbar1); //The MgDefaultToolbar
8: }1: MgServiceFactory factory = new MgServiceFactory();
2: MgdFeatureService featureService = (MgdFeatureService)factory.CreateService(MgServiceType.FeatureService);1: MgPlatform.Initialize("Platform.ini");
1: using System;
2: using System.Collections.Generic;
3: using System.Linq;
4: using System.Windows.Forms;
5: using OSGeo.MapGuide;
6: 7: namespace MgDesktopSample
8: {9: static class Program
10: {11: /// <summary>
12: /// The main entry point for the application.
13: /// </summary>
14: [STAThread]15: static void Main()
16: {17: MgPlatform.Initialize("Platform.ini");
18: Application.ApplicationExit += new EventHandler(OnApplicationExit);
19: Application.EnableVisualStyles();20: Application.SetCompatibleTextRenderingDefault(false);
21: Application.Run(new Form1());
22: } 23: 24: static void OnApplicationExit(object sender, EventArgs e)
25: { 26: MgPlatform.Terminate(); 27: } 28: } 29: }1: MgServiceFactory factory = new MgServiceFactory();
2: MgdResourceService resSvc = (MgdResourceService)factory.CreateService(MgServiceType.ResourceService);3: MgResourceIdentifier mapDefId = new MgResourceIdentifier("Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition");
4: //If this map definition doesn't exist, we ask the user to
5: //load the Sheboygan package
6: if (!resSvc.ResourceExists(mapDefId))
7: {8: using (OpenFileDialog diag = new OpenFileDialog())
9: {10: diag.Filter = "MapGuide Packages (*.mgp)|*.mgp";
11: if (diag.ShowDialog() == DialogResult.OK)
12: {13: MgByteSource source = new MgByteSource(diag.FileName);
14: MgByteReader reader = source.GetReader(); 15: resSvc.ApplyResourcePackage(reader); 16: }17: else
18: {19: //No map, nothing to do here
20: Application.Exit(); 21: } 22: } 23: }1: //Create our runtime map
2: MgdMap map = new MgdMap(mapDefId);
3: //We need a rendering service instance
4: MgRenderingService renderSvc = (MgRenderingService)factory.CreateService(MgServiceType.RenderingService);5: //Create our viewer provider
6: MgMapViewerProvider provider = new MgDesktopMapViewerProvider(map, resSvc, renderSvc);
7: //Initialize our viewer with this provider
8: mgMapViewer1.Init(provider);1: protected override void OnLoad(EventArgs e)
2: {3: new MapViewerController(mgMapViewer1, //The MgMapViewer
4: mgLegend1, //The MgLegend
5: this, //The IMapStatusBar
6: mgPropertyPane1, //The MgPropertyPane
7: mgDefaultToolbar1); //The MgDefaultToolbar
8: 9: MgServiceFactory factory = new MgServiceFactory();
10: MgdResourceService resSvc = (MgdResourceService)factory.CreateService(MgServiceType.ResourceService);11: MgResourceIdentifier mapDefId = new MgResourceIdentifier("Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition");
12: //If this map definition doesn't exist, we ask the user to
13: //load the Sheboygan package
14: if (!resSvc.ResourceExists(mapDefId))
15: {16: using (OpenFileDialog diag = new OpenFileDialog())
17: {18: diag.Filter = "MapGuide Packages (*.mgp)|*.mgp";
19: if (diag.ShowDialog() == DialogResult.OK)
20: {21: MgByteSource source = new MgByteSource(diag.FileName);
22: MgByteReader reader = source.GetReader(); 23: resSvc.ApplyResourcePackage(reader); 24: }25: else
26: {27: //No map, nothing to do here
28: Application.Exit(); 29: } 30: } 31: } 32: 33: //Create our runtime map
34: MgdMap map = new MgdMap(mapDefId);
35: //We need a rendering service instance
36: MgRenderingService renderSvc = (MgRenderingService)factory.CreateService(MgServiceType.RenderingService);37: //Create our viewer provider
38: MgMapViewerProvider provider = new MgDesktopMapViewerProvider(map, resSvc, renderSvc);
39: //Initialize our viewer with this provider
40: mgMapViewer1.Init(provider); 41: }1: private void mgMapViewer1_SelectionChanged(object sender, EventArgs e)
2: { 3: MgSelectionBase selection = mgMapViewer1.GetSelection(); 4: MgReadOnlyLayerCollection layers = selection.GetLayers();5: if (layers != null)
6: {7: for (int i = 0; i < layers.GetCount(); i++)
8: { 9: MgLayerBase layer = layers.GetItem(i);10: if (layer.Name == "Parcels") //The selected layer is parcels
11: {12: //Check that we only have one selected object
13: int count = selection.GetSelectedFeaturesCount(layer, layer.FeatureClassName);
14: if (count == 1)
15: {16: MgFeatureReader reader = null;
17: try
18: {19: reader = selection.GetSelectedFeatures(layer, layer.FeatureClassName, false);
20: if (reader.ReadNext())
21: {22: //Address is in the RPROPAD property
23: if (reader.IsNull("RPROPAD"))
24: MessageBox.Show("Selected parcel has no address");
25: else
26: MessageBox.Show("Address: " + reader.GetString("RPROPAD"));
27: } 28: }29: finally //You must always close all readers, otherwise connections will leak
30: { 31: reader.Close(); 32: } 33: }34: else
35: {36: MessageBox.Show("Please select only one parcel");
37: }38: break;
39: } 40: } 41: } 42: }by Jackie Ng (noreply@blogger.com) at January 23, 2012 12:49 PM
Ok, I'm almost back behind the helm and I expect it's going to take me at least a week to catch up the geonews, but you'll get them.
During my absence last week, Slashdot ran a discussion named Ask Slashdot: Open Source vs Proprietary GIS Solution?
Their summary: "As the Project Manager for a non-profit looking to implement a tech project, I am running into a few dilemmas, and as a casual Slashdotter I could really use some help. I'll start with a brief explanation of the project. We research issues in Canadian Immigrants, and found that there was a lack of recent, unaggregated information. As we dug further, we found that some data was available, but there was no central repository. Therefore, we are building a web based service to collect this data, with the intent of having it display in Google Maps and then be downloadable as a CSV file that is readable in GIS software such as ESRI Arcsoft, so that data may be visualized."
Like a lot of Slashdot discussions, the value is in the moderated comments.
Support for MS SQL Server 2008 in QGIS is coming soon. A native QGIS provider for MS SQL Server is currently being worked on to make using, managing, and editing SQL Server data in QGIS just as easy as PostGIS.
The work is being sponsored by the Australian company Digital Mapping Solutions. So a very big thanks to them for this great feature!
There is no ETA on when it will be added to the main QGIS build, but the provider is currently in testing stage and hopefully will be in there soon.
So if you have been itching to try SQL Server data in QGIS, hang in there as a good solution is just around the corner.
P.S The other blog posts on this topic I used ogr, this method will still work fine after the native provider is added, however the native driver will add a nicer interface including integration into the QBrowser, better optimization for the QGIS code, and hopefully same feel as the PostGIS experience.
This week Sourcepole released a new addition to the Raster Terrain Analysis plugin: a sophisticated Relief tool. (More info in their announcement) This plugin is shipped with QGIS (developer version, not in 1.7.3 release) by default but you might have to activate it in Plugin Manager:
The plugin dialog is quite self-explanatory. You can chose the elevation file, output path and any of the numerous raster formats. The z factor is a bit more mysterious. We will have a look at that in a second. The rest of the dialog is the relief color editor. Pressing Create automatically will give you a color gradient to start with.
But what’s the z factor good for?
I’ve tried a few different settings using free NASA SRTM data and it seems that higher values lead to a smoother relief (Please ignore the water areas):
Update:
As Marco noted in the comments: The z factor is used if the x/y units are different from the z unit.
In the example above SRTM rasters are in WGS84 with heights in meters. That’s why the result using a z factor of 100000 looks so good.
In my opinion the results look great even with the coarse SRTM dataset I used. Looking forward to all the great QGIS maps we will see in the future.
by Jackie Ng (noreply@blogger.com) at January 18, 2012 05:53 PM
There has been a lot of fairly excitable posting recently about the continuing rise of OpenStreetMap, and how it’s now being used in place of Google Maps, in particular since Google started charging for data. People have been talking about how “authoritative” crowd-sourced spatial data can be, and to be honest, I’ve found that the discussions seem to have missed the point a little bit. For me at least. So- here’s a few of my personal thoughts about OpenStreetMap and why it will be a while before I will consider it authoritative at least.
Firstly, a caveat. I love OpenStreetMap data and the whole ecosystem of “stuff” that has evolved around it. I contribute occasionally, though not as often as I’d like to. I’m pleased that it has forced the “traditional” data providers to reconsider what they offer, and perhaps to raise their game. I think it’s one of the main reasons why the idea of “open data” is so well known that even my Gran knows about it.
However, in the process of trying out WalkingPapers (my favourite addition to the OpenStreetMap ecosphere), I printed out the area around my house- in the centre of Lancaster. Not London, I admit, but still in the centre of a city. My road wasn’t on there. Read on, before you give up in disgust, saying “pah, you should just correct any errors you find”. How did I know my road was missing? There wasn’t an unfinished stub, with a note saying “I went home for my tea and I’ll finish this section tomorrow”, it was as if my road did not exist. I only knew my road was missing because I live there, and I have no readily available tools to help me judge the accuracy of an area that I am not familiar with. So, the idea that the end-user should correct any errors they find doesn’t really hold because you’re not always going to know that there’s an error!
I am aware that the traditional data providers do not produce totally error-free data. However, I would expect Ordnance Survey (for example) to have a workflow for their surveyors that doesn’t allow them to simply give up when they get bored or have to go home for their tea, or perhaps not survey a street because they don’t go down it very often. I can also go to the site and find published information on positional accuracy if I need it. I guess I’m equating “authority” with trust, or reliability, and the issue is less about what’s there, than what’s not there.
When OpenStreetMap is being used as a static base map, by which I mean a backdrop to the information your map is really about, this is less of an issue. But, if like me, you come from a discipline where maps are collections of data to be manipulated and analysed, then you need to be able to trust your data a little more, or at least have a quantitative understanding of what the error is likely to be.
I know that this is not an easy question to answer, and I know people are trying to figure out ways of answering it. I also know it’s not that important for a lot of people, but I would like to see a more nuanced debate- I think that would be better for OpenStreetMap in the end.
by Jackie Ng (noreply@blogger.com) at January 18, 2012 04:47 PM
Participants
Representatives from the following companies have confirmed attendance and sponsorship:
These organizations have provided core developers for GeoExt 1.x and have experience as service providers building applications with ExtJS 4. We’re excited to work with them again as we help develop GeoExt 2.0
Sponsor search
A week-long gathering of eight developers calls for a budget of $52,000. This covers travel, accommodations and partly the developers themselves. While much of this cost is being borne by the participating organizations we have not been able to close the gap.
We are looking for sponsors to help. Sponsors will be named explicitly and are encouraged to input their priorities for desired functionality in GeoExt 2.0.
Call for sponsorship
The participating organizations would like to invite all organizations and users utilizing GeoExt to sponsor the code sprint. Becoming a sponsor ensures the benefits from the new functions that will be implemented.
If you have questions or interest in sponsoring the code sprint please contact us at inquiry@opengeo.org