GART, Geospatial Augmented Reality, Bing Maps and Windows 8

Today's Windows Wednesday project by Ricky Brundritt, is about one of our favorite things Augmented Reality. And the fact we can also include using the Bing SDK and Windows 8.1 AND something that would be awesome on the Surface, well..!

Augmented Reality with Bing Maps in a Windows Store App

In this blog post we are going to take a look at augmented reality apps and how to create them as Windows Store apps. When many people hear the words “augmented reality” the first thought that comes to mind is the large helmet type video games that never really took off in the 90’s. This was largely due to the high costs and bulky hardware that was required. This is also a bit inaccurate, as these video games were actually “virtual reality” games. Augmented reality (AR) is when an object that is not present in the real world, but appears to be because of a view showing a modified version of reality. Virtual reality is similar, but instead of being in the real world, the user is viewing a simulated version of the world.

...

If you are interested in creating this type of AR application, then I recommend taking a look at the following projects for starters:

· SLARToolkit

· ARTag

Also take a look at these blog posts:

· Augmented Reality with SLARToolkit on Windows Phone

· Augmented Reality Using C# and OpenCV

...

Geospatial Augmented Reality

Geospatial AR is when items are displayed in view based on their physical location. The most common app of this type shows nearby points of interests. A good example is the Nokia Here City Lens app for Windows Phone 8.

As mentioned at the start of this blog, we are going to focus on creating this type of AR app. One of the best starting points for creating this type of app for Windows Store and Windows Phone is the GART CodePlex project. GART stands for geo augmented reality toolkit and was originally created for Windows Phone 7. Since then, support for Windows Phone 8 and, just recently, Windows Store apps has been added. This provides us with a great AR framework that already handles the orientation sensors and other calculations for us.

Creating a Bing Maps Powered App with GART

I’ve put together a nice sample app that is built on top of GART. This app makes use of Bing Maps in a four different of ways:

1. An interactive map is used to give an overhead view of all the nearby locations.

2. The app then uses the NAVTEQ point of interest data in the Bing Spatial Data Services as the data source that powers the app. By using the Bing Spatial Data Services anyone can easily create their own data source and modify this sample to use their data in minutes.

3. Rather than adding in all the functionality for calculating routes to selected locations the app launches the built-in Maps app in Windows 8 to provide this functionality. This greatly simplifies the sample application and also puts the user into an app they are familiar with when calculating directions.

4. The Bing Maps Imagery REST services are used to generate a static map image of a location which is included into an email when sharing a location.

The sample app consists of a Windows Store and a Windows Phone 8 app which includes a lot of features and functionalities, many of which are mainly customizations to the UI. Rather than going through all 1,000+ lines of the sample app the remaining section of this blog post will show how to create a simplified version of the sample. This will allow us to focus on the key aspects of creating an AR app using GART and Bing Maps. You can access the full source code for the sample application here. You can find instructions on how to run that sample on the download page. When you run the full sample application, you will be able to find nearby locations simply by pointing your computer towards them. Here is a screenshot of the full sample application.

...

image

...

Make sure you click-through and read Ricky's entire post as he does a great job of walking you through creating the app.

Just want to jump to the code?

Augmented Reality with Bing Maps in a Windows Store App

This sample shows how to create an augmented reality application for Windows 8 and Windows Phone 8 that makes use of Bing Maps. The point of interest data being used in the app is being pulled from the NAVTEQ point of interest data sources in the Bing Spatial Data Services. You can create your own data sources in the Bing Spatial Data Services and easily modify this application to use your data instead.
In addition to showing nearby points of interest you can also generate driving directions, and share them. When the directions button is selected the Maps app in Windows 8 is launched and preconfigured to display walking directions from your current location to the selected point of interest location. When sharing a point of interest the generated email includes the details of the selected location along with a static map image of where the item is located. The static map image is generated using the Bing Maps REST Imagery Service.

This project is built on top of an open source project called GART which stands for Geo AR Toolkit.  GART was originally created to make it easy to build location based augmented reality apps for Windows Phone and is now has support for Windows 8 as well. Note that a rear facing camera is required for this application as the user experience consists of looking at the screen while pointing the back of the screen in the direction you want to view.

Software Requirements

• Windows 8
• Visual Studios 2012
• Bing Maps for Windows Store Apps SDK

Hardware Requirements

• Orientation Sensor
• Location Sensor
• Rear Facing Camera (Optional but recommended)

Building the Sample

To run this sample you must install the Bing Maps SDK for Windows Store apps and get a Bing Maps key for Windows Store apps. You must also have Windows 8 and Visual Studio 2012.

Open the sample in Visual Studio and insert your Bing Maps key in the App.xaml file in the BingMapsAR project where it says “YOUR_BING_MAPS_KEY” in the source code. You must perform the following steps for your app project to work correctly with Bing Maps. Detailed instructions are provided below.

...

image

...

Wet your appetite for build Bing apps? 

Bing Maps for Windows Store Apps Training Kit

...

This training kit consists of a power point slide deck which gives an overview of how to create a Windows Store App that uses Bing Maps. This slide deck also includes some information on existing applications which use Bing Maps that are in the Windows Store. In addition to the training slide deck there are also 2 labs. The first one is designed for the JavaScript developer and the second one is for the Native code developer. Each lab is made up of multiple exercises and should take around 90 minutes to complete.

JavaScript Lab:

  • Exercise 1: Creating a Bing Maps Account and Key
  • Exercise 2: Loading the Bing Maps control
  • Exercise 3: Integrating Location Services 
  • Exercise 4: Implement Bing Maps Modules
  • Exercise 5: Implementing Geocoding and Routing
  • Exercise 6: Access the Bing Maps REST Services

Native Lab:

  • Exercise 1: Creating a Bing Maps Account and Key
  • Exercise 2: Loading the Bing Maps control
  • Exercise 3: Integrating Location Services 
  • Exercise 4: Implementing Geocoding and Routing

Now go get your Bing Maps on!

Tags:

Follow the Discussion

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.