Bing Maps: SQL Server Denali CTP3

At the beginning of the week, there was a new version of the Bing Maps AJAX API rolled out (version 7.0.20110630165515.17). There’s a list of changes at http://msdn.microsoft.com/en-us/library/gg675211.aspx but, to summarise them here:

  • Directions and Traffic information (both features that were included in the core 6.x control) have been added back into v7 using the new optional module functionality.
  • New venue maps mode allows you to see layouts in the inside of shopping malls etc.(Haven’t seen much use for this yet – don’t know if it really exists outside the US)
  • You can now disable birdseye mode – very useful since it prevents you accidentally breaching the Terms of Use if not licensed to use it!
  • Polygons and polylines have a new dashstyle property, which means you can style vector shapes so that, for example, electricity lines and railways show as dashed lines (as in an Ordnance Survey map).

I’m particularly pleased about the last two features, since these are both things that I’ve suggested about on the MSDN forums… whether it’s coincidence or not, I’m glad they’ve now been implemented.

SQL Server Denali CTP3

A download link to the latest preview version of SQL Server was announced on Twitter, and a rapid rush of tweets followed as people clammered to see what new features were included.

image

I’m only interested in summarising changes for the spatial toolset, which as far as I’ve found out so far, are as follows:

Firstly, the Spatial Results tab is back! Introduced in SQL Server 2008, broken in CTP1, and back again, it’s everyone’s favourite quick way of visualising geometry or geography data. The 5,000 object limit still seems to be in place:

image

My next test was to see whether it could plot the new curved geometry types. Initial results were disappointing, when selecting a CircularString resulted in nothing but a white screen, while a LineString drawn between the same set of points was displayed as expected:

image

This same problem occurred across all curved geometry types – to display a curved geometry in the spatial results tab, it seems you have to linearise it first – for example, using STCurveToLine(), or creating a linear buffer around it using STBuffer() as shown here:

image

(Note that, although these features look curved, they’re really just a many-sided LineString and Polygon, respectively). Hopefully displaying true curved features will make it into the next release.

As for new functionality, there’s a new extended method, IsValidDetailed() – which tells you not only whether a geometry is valid (which is what the OGC STIsValid() method does), but why it’s invalid. Here’s an example script to test it:

DECLARE @g geometry = 'LINESTRING(0 0, 5 10, 8 2)';
DECLARE @h geometry = 'LINESTRING(0 0, 10 0, 5 0)';
DECLARE @i geometry = 'POLYGON((0 0, 2 0, 2 2, 0 2, 0 0), (1 0, 3 0, 3 1, 1 1, 1 0))';
SELECT
  @g.STIsValid() AS STIsValid, @g.IsValidDetailed() AS IsValidDetailed
UNION ALL SELECT
  @h.STIsValid(), @h.IsValidDetailed()
UNION ALL SELECT
  @h.STIsValid(), @i.IsValidDetailed()

And this is the output – which is much more useful when it comes to fixing invalid data than a simple Boolean obtained from STIsValid():

image

As with some of the updates to the Bing Maps control, I was particularly pleased to see this feature get included since it was something I’d raised in the MSDN forum – Microsoft are certainly scoring lots of points with customer responsiveness with me this week!

The only other functional addition I could see was the AsBinaryZM() method, which retrieves the Well-Known Binary of a geometry, complete with Z values. Previously, the only way to retrieve (or input) geometries containing Z and M values was via Well-Known Text, since the WKB representation stored 2d coordinates only.

The new method works pretty much as you’d expect, and the resulting serialised value also demonstrates some of the flags indicating this geometry has Z values:

DECLARE @g geography = 'POINT(1.6 52.5 100)';
SELECT
  @g.STAsBinary(),
  @g.AsBinaryZM()

Bing Maps: Streetside

Bing Maps Streetside – London UK

Bing Maps Streetside - London UK

Streetside is now available for some parts of London, England

Bing Maps Streetside - Westminster Bridge London UK

Westminister Bridge, London Bus and London Eye Iconic Landmarks, but do not expect ‘Google Streetview’ type functionality this is more a slide-show of images.

More information on Streetside

http://www.microsoft.com/maps/en-GB/streetside.aspx

View Streetside – London UK (click the icon next to Traffic)

http://www.bing.com/maps/?v=2&cp=51.50085314131346~-0.12088798043215165&lvl=14&dir=0&sty=r&trfc=1&form=LMLTCC

Disasters and maps

7 February 2011 marked the second anniversary of the worst bushfire tragedy in Australian history – 173 people died and 414 were injured as the result of infernos raging around the State of Victoria. The Black Saturday Bushfire was a very traumatic event for many Australians, those directly affected by the fires but also those thousands who got emotionally and personally involved in post event forensic studies, clean up, counselling, rebuilding, Royal Commission and general assistance through voluntary work or collection of donations. The whole nation felt the pain and helplessness in the wake of such an enormous tragedy.

After a period of a relative calm over the last two years Australia has been struck again by several major natural disasters, such as flush floods in Queensland and Victoria, tropical cyclone Yasi, or bushfires in Western Australia. Events like these bring online crowds of people: those caught inadvertently in the incidents, or those concerned about safety of their family members and friends, but above all, “curious onlookers” from around the world who just would like to know what is happening. All those people are looking for basic information, such as maps of places to identify where “these things” reported in commercial and social media are happening, as well as anything that relates to progress of the event, likely scenarios it may evolve into and the impact on people, infrastructure and the surrounding environment.

In the first instance they turn to official sites run by State authorities – those that issue the alerts and warnings – and of course the Australian Bureau of Meteorology. When they can’t find what they are looking for, or the information is not in the format that is meaningful, they turn to online search engines seeking more details about the event. It is therefore not a coincidence that during the times of natural disasters the traffic to sites providing information on maps goes through the roof. A question comes to mind if there really is enough tools in the public domain to keep general public fully informed. Has anything changed since Victorian bushfires of 2009?

In an ideal world, all the relevant information would be provided by the authorities, along with alerts, warnings, evacuation orders, road closures and detour routes, situation briefs etc. And through all possible channels: online, stationary and mobile phones, radio and TV, and in all formats: text, audio and video broadcasts and online streaming, printed as well as static and interactive maps, and above all, web services for republishing the information through media and social channels. But that is still only a distant dream. The reality is that information is very fragmented, differs in formats and content from State to State and ultimately in reliability, accuracy and timeliness.

So, what information is actually available, in spatial format, to an average person interested in a particular event? Let’s start with bushfire related information as there is quite a few resources available…

Part 1: Mapping Bushfires

Detection of fire hotspots from satellites has been around for quite a while and Australia has two systems delivering such information that pre-dates Victorian bushfires of 2009: Geoscience Australia’s Sentinel and Landgate’s FireWatch. Both are using data obtained from the NASA Earth Observation Satellites Terra and Aqua which pass over Australia up to three times a day (although a revisit of the same area is only two times a day). Although data has some limitations, like timeliness due to infrequent revisit cycle or inability to detect hotspots through thick smoke and clouds, these applications provide excellent location reference for larger fire outbreaks throughout Australia. Geoscience Australia publishes the data in KML, WFS and WMS formats. I use those in my Hazard Monitor Bushfire Incidents map to publish an alternative view of the information. FireLocator from PitneyBowes provides yet another version of the same data in Silverlight format and with Bing Map in the background.

North Australia Fire Information is an application dedicated to monitoring fires in the northern part of Australia. In addition to satellite detected fire hotspots it also includes information on fire scars from past bushfires. Some of the information available on this site can be accessed in KML and WMS formats.

State authorities responsible for emergency alerts and response to natural disasters are publishing on their respective websites summaries of information on the latest incidents. Victorian Country Fire Authority (CFA) publishes a summary of incidents in a tabular format and on a Google Map. The information is also available as RSS feeds (locations are not georeferenced, hence cannot be directly imported into maps).

In NSW Rural Fire Service (RFS) publishes its version of summary of incidents – as a list and a map. Georeferenced RSS feed is also provided.

Both Bushfire Incidents map and FireLocator (developed in late 2009) are using the above feeds to display information about the latest incidents on the maps. During the peak of Victorian bushfires Google released its own application that mapped these feeds and showed satellite imagery of smoke and cloud cover.

Tasmania Fire Service (TFS) is another agency that publishes fire incidents information and a map as well as distributes the information via RSS (non-georeferenced) and KML. And South Australian Country Fire Service (CFS) publishes map and incidents in a similar fashion to already mentioned States (their RSS feed is also not georeferenced).


There are no interactive maps with the latest incidents for Queensland and Western Australia and those states do not publish RSS feeds in the format that could be easily reused for displaying the information in third party mapping applications.

The most recent additions to the list of online bushfire related information sources are BushfireConnect and everymap.com.au. Built with Ushahidi, these online mapping applications aim to publish information supplied by the public located in the affected areas, either by lodging reports online, or via SMS or Twitter (ie. crowd sourcing). They also republish RSS alerts from State authorities. Not the easiest and the most intuitive tools to use but these initiatives are attempting to engage a wider community in reporting of incidents so, deserving all the support.

At the time of major disasters media and private individuals create maps and various applications to share the information about a particular event. Examples include a Black Saturday feature created by ABC that allows users to explore timeline of events on an interactive map, or Google’s MyMap version created by a private individual as a static record of events (presented here on aus-emaps.com shareable map).