Loading...

Enhance Azure Maps with Overture Maps Data using PMTiles!

Enhance Azure Maps with Overture Maps Data using PMTiles!

 

Supercharge Azure Maps with Overture Maps Data using PMTiles!

We’ve got some exciting news. Azure Maps now supports PMTiles! This means you can overlay massive geospatial datasets on Azure Maps with incredible efficiency and ease. PMTiles lets your data-intensive mapping applications access large datasets seamlessly, without the need to load the entire dataset on the client side. The result? Faster performance and more powerful, responsive mapping applications on Azure Maps.

What exactly are PMTiles?

Think of PMTiles as a supercharged ZIP file for tiled data. It’s a single-file archive format that consolidates numerous individual tiles into one neat package. This makes storage a breeze and managing your data way simpler compared to juggling thousands of small files.

 

PMTiles are perfect for cloud-native deployments and can be hosted on Azure Blob Storage. This means you can build low-cost, serverless map applications without needing a custom backend or third-party tile provider. With PMTiles, you can directly request data from the file over HTTP, accessing specific map tiles without any intermediaries. Whether you’re dealing with vector data, raster data, or terrain mesh data, PMTiles has got you covered.

 

image.png

How to create PMTiles

If you’re looking to create PMTiles for vector data, Tippecanoe is your go-to tool. It produces optimized vector tiles for visualization, simplifying or removing small features at low zoom levels to keep the tiles compact and manageable. This ensures a smooth user experience on the client side.

Displaying and Using PMTiles on Azure Maps

Azure Maps now supports custom protocols like pmtiles:// for referencing PMTiles archives. By using this custom protocol, Azure Maps can access tiles within a PMTiles archive using HTTP range requests, fetching only the data you need when you need it. To get started with PMTiles, the Azure Maps Web SDK offers the addProtocol function. This registers a callback that intercepts and modifies requests, allowing PMTiles data to be processed dynamically for rendering on the map.

 

Here’s a quick guide to setting up PMTiles support:

 

  1. Reference the PMTiles Library:

    <script src="https://unpkg.com/[email protected]/dist/pmtiles.js"></script>
    
  2. Initialize the PMTiles Protocol:

    const protocol = new pmtiles.Protocol();
    atlas.addProtocol("pmtiles", (request) => {
        return new Promise((resolve, reject) => {
            protocol.tile(request, (err, data) => {
                if (err) reject(err);
                else resolve({ data });
            });
        });
    });
    

    This setup registers the pmtiles:// schema, enabling Azure Maps to process requests specifically for PMTiles sources.

  3. Add and Configure PMTiles Data Source: Use the following example to overlay Overture Maps’ building data on top of the Azure Maps basemap:

    const PMTILES_URL = "https://overturemaps-tiles-us-west-2-beta.s3.amazonaws.com/2024-07-22/buildings.pmtiles";
    protocol.add(new pmtiles.PMTiles(PMTILES_URL));
    
    map.sources.add(new atlas.source.VectorTileSource("pmtiles", {
        type: "vector",
        url: `pmtiles://${PMTILES_URL}`,
    }));
    

    This code defines a vector tile source that uses the PMTiles URL. The map then dynamically fetches only the tiles that the user’s view requires, improving both performance and data usage.

What is Overture Maps?

Overture Maps is an open data project launched in 2022 by a coalition led by the Linux Foundation. Supported by Meta, Microsoft, AWS, and TomTom, this initiative aims to provide reliable, interoperable geospatial data for the public. The Overture Maps Foundation aggregates open and commercial datasets, offering a unified schema that makes it easier to work with geospatial data across different platforms and applications.

 

Each dataset in Overture Maps is organized by themes that classify different types of geospatial information, like building footprints, roads, water bodies, and points of interest. This thematic organization ensures a structured approach to incorporating diverse types of location data, making it accessible for developers across various projects.

 

pmtiles-building.png

 

With PMTiles support in Azure Maps, we can’t wait to see how you’ll use this capability to power dynamic and data-rich applications. Stay tuned for more updates, and start integrating PMTiles into your Azure Maps applications to unlock new potential with Overture Maps data today!

Published on:

Learn more
Azure Maps articles
Azure Maps articles

Azure Maps articles

Share post:

Related posts

Introducing the Data-Bound Reference Layer in Azure Maps Visual for Power BI

Imagine managing a nationwide sales team and needing to understand how your sales align with factors like population density, competitor locat...

1 year ago

Where do I go if I have questions about Azure Maps?

As you might expect, just looking around on your own, or asking Co-pilot, you can find comprehensive help like Samples.AzureMaps.com, wit...

1 year ago

Tailor your Reference Layers in Azure Maps Visual for Power BI

  We’re excited to share the latest enhancements to the Azure Maps visual in Power BI, designed to make your data visualization even mor...

2 years ago

Enhancing Logistics with Azure Maps and NVIDIA cuOpt for Multi-Itinerary Optimization

The logistics industry is always finding ways to optimize vehicle routing to enhance efficiency. The Vehicle Routing Problem (VRP) and Pickup ...

2 years ago

Introducing the Unified Azure Maps Experience

Microsoft has recently announced the unification of Bing Maps for Enterprise (BME) with Azure Maps, marking a remarkable advancement in their ...

2 years ago

Power BI Azure Maps Visual: Enhanced Reference Layer & Embedded Support

The Power BI Azure Maps visual has received a major update which includes an expansion of the reference layer and the addition of Power BI Emb...

2 years ago

Enhance your indoor maps with real-time map feature styling

The ability to dynamically update and visualize the state of rooms or areas within a building is critical to understanding the status of any b...

2 years ago

Dynamic Clustering Aggregation with Custom Styling in Bubble Layer

The Power BI Azure Maps visual allows you to create stunning geospatial visualizations with your data. Today, we are excited to announce a new...

2 years ago

HO HO HO Two Point OH!

You might notice some big changes have come to the North Pole experience at NORADSanta.ORG this year.  Developer elves have implemented a...

2 years ago

Navigate Microsoft Ignite with Azure Maps Creator

If you are attending the Microsoft Ignite event this year, you are in for a treat! Not only will you get to experience the latest innovations ...

2 years ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy