Map of Birds Eye Coverage in EMEA & APAC (Part 1)

A couple of days ago I posted about a slide-deck which contains the current coverage with Bird’s Eye images in EMEA and APAC. In the meantime I also published a Virtual Earth mash-up which provides a tile-layer for the coverage and database access to retrieve the regions we have by country. A flag near the region will show you what we have recently updated or added.

VE-Demo02

Do you want to know how I created this mashup? Oh really? It is a long story and it involves some beautiful software-previews I could get hold of.

The basic idea I had was, that I not only wanted to know the region where we have coverage, I wanted to know the exact extends of those areas. For example if we claim to have Bird’s Eye coverage for London it is actually a much bigger area but if we look at Madrid it is a relatively small area in the north of the city center. My first idea was to use the Virtual Earth method GetBirdseyeScene() to determine if there is an Bird’s Eye image or not. Well, the challenge is that I have to do that on every tile and there are quite a lot. The Virtual Earth tile-system is based on a quadkey. Joe Schwarz has explained that excellently in an article on MSDN.

VE-TileSystem 

Of course I can reduce the number of roundtrips by selecting a lower zoom-level. To use the function GetBirdseyeScene() I have to be at a minimum zoom-level of 13 and I figured that level 14 might be a good compromise between accuracy and number of roundtrips but hey there are still almost 270 million tiles at this level if you look at the whole world.

Zoom-Level

Number of Tiles

1

4

2

16

3

64

4

256

5

1,024

6

4,096

7

16,384

8

65,536

9

262,144

10

1,048,576

11

4,194,304

12

16,777,216

13

67,108,864

14

268,435,456

15

1,073,741,824

16

4,294,967,296

17

17,179,869,184

18

68,719,476,736

19

274,877,906,944

Let’s stay with that figure for a while. If we have 270 million tiles and I need to make a thorough check by positioning the map and then executing this GetBirdseyeScene()-method. Let’s assume it takes me 1 second each. In that case I have 2 seconds for each tile which would at level 14 add up to almost 540 million seconds or 17 years in a single-threaded process. I didn’t really want to wait that long :-).

So, the most important task was to reduce the area in which I have to perform these checks. Our data-provider Blom was kind enough to send me an ESRI Shape-file with the regions they have completed or currently work on. Unfortunately these regions may not be exactly what we have already published so I couldn’t overlay these data directly but I had a good starting point to narrow down the search area. How do I have to go on from here?

  1. I have to load and validate the date.
  2. I have to determine which tiles – i.e. which quadkeys – are within those region.
  3. Then I move the map to the center-point of these tiles and execute the GetBirdseyeScene()-method for these locations.
  4. If we have a Bird’s Eye image I create a colored PNG-image which matches the name (quadkey) and the size (256 x 256) pixels of the Virtual Earth tiles.
  5. Once I have completed that for level 14 I use some GDI classes to create the tiles for lower zoom-levels.
  6. Finally I create my mashup which overlays these tiles as tile-layer on Virtual Earth.

Advertisements
This entry was posted in SQL Server Spatial. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s