imageFirst a little background on what I was trying to achieve. I am developing a GIS that has both a web and desktop component. It’s built using SQL Server 2008, MapServer, OpenLayers, and using MapInfo and QGIS for desktop connections.

On the web system I have an OpenLayers map, with an OpenStreetMap background layer. As with nearly all the online tiling services, these are projected in EPSG:900913 (the Web Mercator / Google projection).

I wanted to display a road network on top of these as a WFS (Web Feature Service). The source data is defined in the Irish National Grid projection (EPSG:29902).

At the same time I also wanted people to be able to connect to the WFS via a desktop GIS client using the Irish National Grid projection. Continue reading »

image Or perhaps that should be rephrased start browser-based raster GIS?

GIS data is split into two base types – vector data – geometric shapes, usually further split into points, lines, and polygons, and raster data – cell-based or “pixelated” data.

Graphics on the web mirror this divide. On the vector side SVG – scalable vector graphics, is used in many browsers to display geometric shapes. On the raster side “dumb” images come in many well known formats such as bitmaps, GIFs, PNGs, and JPEGs.

Vector geometries are easily manipulated after drawing as they have an abstract model to work with (the SVG, or KML document), which the browser can then convert to the DOM. As an example OpenLayers includes two vector renderers – one for SVG (see source code), one for VML (used by the ever-unique IE), and since the start of this year a new canvas renderer.

The canvas renderer is used to draw features to the new canvas element which is part of the HTML5 specification. This allows access to images loaded into the canvas through new programming interfaces such as the Canvas 2D Context API.  It is this part of the HTML5 specification that could change the way we work with raster data on the web.

image This is a guest post by Adrià Mercader.

Even in the current digital era, being able to print maps from geospatial applications is still a very commonly requested feature. Traditionally, there have been two main approaches to the map printing on browser applications: handling it either on the client or on the server. In the first case, a new page is opened with the suitable size for a common paper format (e.g. A4 portrait) and is printed with the browser’s print function. This is probably the easiest way to go if you have a very basic map and you don’t need a complex layout, and big guys like Google Maps do it this way. The second option is based on sending all necessary information to a remote printing service, which will produce an output file (generally a PDF) ready to be printed. This allows for more complex layouts, different page sizes, etc. but with the drawback of being more difficult to build and maintain.

Fortunately though, the MapFish mapping framework includes a powerful printing module that allows you to define complex layouts and provides a protocol that can be integrated seamlessly with GeoExt based applications. The layouts can include legends, attribute tables, external images and custom variables sent from the client, and are configured via files with the YAML format. The MapFish site has a complete reference of the configuration file syntax.

Continue reading »

Jun 242010

image Moving to new versions in OpenSource has in the past been like playing Russian roulette. Just now clicking on “Upgrade to WordPress 3.0″ I thought would lead to a greater understanding of the database schema, template inconsistencies, and plug-in idiosynchrocies of WordPress as I met an inevitable “Upgrade Failed. Please see log for details” message.

But no! Five seconds later, all was successful, and everything looked as before. There have been numerous bug fixes and improvements, but after a brief look through the list I didn’t see any “killer” new features.

In the world of GIS however there are a number of important new versions coming up this summer.

Continue reading »

image Maybe I’m a little late in finding this, but if you have FireFox 3.5 or higher try clicking this link (you will have to agree to let your browser divulge your location to open the link). The JavaScript code run when clicking the link is as follows, and can also be pasted directly into your address bar:

javascript:navigator.geolocation.getCurrentPosition(
function(position){
window.location.href="http://maps.google.com/?ll="+position.coords.latitude+",
"+position.coords.longitude;});

I believe the navigator.geolocation object is also available in Safari, iPhone, and Chrome. The Mozilla documentation provides more details on its use. This StackOverflow question asks which browsers and devices it applies to, and this is set to grow if it becomes part of the browser standards – the W3C has an online draft Geolocation API Specification. They list the following use cases: Continue reading »

The objective of this post is to save a GeoJSON feature collected from the web to an image file, and was inspired by the Shapely manual. This will be done using Windows, Python 2.5 (although 2.6 should be almost exactly the same steps), and some additional Python packages. This example uses GeoJSON data from a CloudMade geocoding service.

image

The greatest difficulty when trying to do things in Python is getting the right packages to match your Python version, and making sure all the package dependencies are in place.

Continue reading »

I was looking around the web to try and find some services that returned GeoJSON to try out Shapely. It was surprisingly hard to find servers or web services given the amount of tools that have already been built to use GeoJSON.

Eventually I found the CloudMade’s geocoding developer samples. CloudMade is a company that builds tools and services on top of OpenStreetMap. Even though many of the people involved in both CloudMade and OSM are the same, using the two brands interchangeably has not been without controversy.

imageOnce you’ve signed up for a free account, you can then register for an API key that allows you to call their web services. See here for differences between free and paid accounts. The service I was interested in testing was the geocoding service that returns GeoJSON.

Depending on the type of feature you are looking for you can get different geometry types – the standard point, lines, and polygons, all as GeoJSON objects.

The API uses URLs and GET requests to return data. Calls can be made to either a find.html page which returns the GeoJSON object displayed on a map, as shown in the query for “england” on the left. Alternatively the query can be made to find.geojs to return just the GeoJSON itself. There is also a find.js which can be used to return geometry as JSON, although this seems a little confusing – even more so as the coordinate order is reversed from the standard GeoJSON [lon,lat].

Continue reading »