Eric Angeles
Eric Angeles

Reputation: 11

How do I use Bing maps - Building Footprints feature? Specifically in a an embed map using javascript

Background: Bing maps offers building footprints src which uses A.I to polygon out all the buildings in a map and give total surface area information.

Problem: Using an existing lat/long I want to be able to embed a bing map with the building polygon on the map. This is currently done in OSM Id map (screenshot below)

enter image description here

This is my latest attempt but I cannot seem to find the module I need to use for this functionality docs

var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {});
var vMap;
Microsoft.Maps.loadModule('Microsoft.Maps.VenueMaps', function () {
    var venueMapFactory = new Microsoft.Maps.VenueMaps.VenueMapFactory(map);
    venueMapFactory.create({
        venueMapId: 'testVenue',
        metadataUrl: 'https://bingmapsisdk.blob.core.windows.net/isdksamples/MicrosoftBuilding2.json',
        success: function (venueMap) {
            vMap = venueMap;
            map.setView(venueMap.bestMapView);
        }
    });
});
  1. download bings map npm module
  2. create instance of bings map
  3. attempted to find build footprint module on bings map

Upvotes: 1

Views: 276

Answers (1)

rbrundritt
rbrundritt

Reputation: 18004

The Venue Maps has a small subset of commercial buildings and their internal layouts and is not related to the Building footprint project you mentioned. The building footprint project is a data dump of the output of the AI process in its raw form. To use it, you need to download and process the data into a form that suits your scenario. There is no module for the building footprint data (it's just raw data).

If you want to be able to query the data set and get one or more buildings within an area or that intersect a single coordinate, you would most likely want to import the data into a database that supports spatial querying (Azure SQL, Postgres + PostGIS, and Cosmos all support this).

If you want to be able to visualize all the building footprints, you would most likely want to tile the data (raster or vector) and then overlay it on top of the map.

Upvotes: 2

Related Questions