Skip to content

What HTML5 Means to Large Geospatial Datasets

In my previous post I talked about bringing large geospatial datasets to the web using existing standards and technologies. But what does the future hold? Within the web industry, for...

We'll take a look at how HTML5 and the related technologies can help when working with large geospatial datasets.In my previous post I talked about bringing large geospatial datasets to the web using existing standards and technologies. But what does the future hold? Within the web industry, for the past few years, HTML5 has been a somewhat overused buzz word. I want to dig a little deeper and look at how HTML5 and the related technologies (Web workers, Indexed Database API, and Canvas) can help when working with large geospatial datasets.

Web Workers
Introduction
Web workers allow the web application to spawn tasks for the browser to work on in the background without freezing the execution of the main application. The result is that no matter how much processing a worker is doing, the UI remains responsive and the user will not receive a script timeout message.

How will it help the geospatial world?
Accessed through a JavaScrip API, web workers are a huge win when working with large datasets as they allow tasks to be carried out in parallelization which makes use of multi-core processors. An example would be allowing the user to edit a polyline. This would involve looping through all the points in the polyline and creating a draggable point on the map. Using web workers the edit mode switch can be run in the background and the user can continue working in the app.

The other win is speeding up the processing times. The edit task could be split up into specific chunks and assigned to multiple web workers. This example shows you the sort of improvements in performance you can get when scaling web workers to process data.

What is the current availability?

  • Firefox 3.5+
  • Chrome 4+
  • Safari 4+
  • Internet Explorer: Unfortunately IE9 does not support web workers so a fallback method will be required for some time.

Full support for web workers is detailed here.

Indexed Database API
Introduction
One of the most exciting developments for me is that of Web-based databases. IndexedDB has emerged as the forerunner after the WebSQL spec was abandoned. And judging by this presentation from Google, it looks like IndexedDB is here to stay. IndexedDB allows the developer to store and manipulate significant amounts of structured data in the browser using high performance searches.

IndexedDB sits between a full-on SQL and unstructured key-value pairs in local storage. Values are stored as structured JavaScript objects, and an indexing system facilitates filtering and lookup. The other advantage of Web-based databases is that data can be stored and accessed when you are offline. A more in-depth look can be found here.

How will it help the geospatial world?

  • Since data can be accessed very quickly using indexes, large datasets can be handled with ease as specific features can be accessed without iterating through an entire array.
  • The ability to store structured data in the browser and for it to persist even when offline redefines the type of GIS/Mapping application we could build in the browser.

What is the current availability?
Using IndexedDB comes with a health warning as it is in extremely early stages. I wouldn’t recommend using it in production for now as the support is limited to Firefox and the Chrome Dev channel. However, what I would say is that because the technology is in such early stage, we can help drive the outcome, so have a play and let people know if it doesn’t work for you. Who knows, maybe we can get support for geometry types added!

Canvas
Introduction
The other functionality, I wanted to mention, which compliments the data storage/manipulation technologies is the canvas element. The canvas element provides a bitmap canvas which can be used by a script to render graphs, game graphics, or images on the fly.

How will it help the geospatial world?
What this means to the mapping world is that rather than sending pre-rendered tiles to the web browser, we can now render vector objects directly in the web browser. Check out what MIT have been doing with the Cartagen project. The possibilities are endless.

So these technologies are what excites me when I think about the future of GIS and mapping on the web. What about you? Is anyone using any of these technologies at the moment?

Safe product icons
Reach out and get started with FME today

Real change is just a platform away.