Meziantou.Framework.Geo.Maps 1.0.3

Prefix Reserved
dotnet add package Meziantou.Framework.Geo.Maps --version 1.0.3
                    
NuGet\Install-Package Meziantou.Framework.Geo.Maps -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Meziantou.Framework.Geo.Maps" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Meziantou.Framework.Geo.Maps" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Meziantou.Framework.Geo.Maps" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Meziantou.Framework.Geo.Maps --version 1.0.3
                    
#r "nuget: Meziantou.Framework.Geo.Maps, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Meziantou.Framework.Geo.Maps@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Meziantou.Framework.Geo.Maps&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Meziantou.Framework.Geo.Maps&version=1.0.3
                    
Install as a Cake Tool

Meziantou.Framework.Geo.Maps

Loads offline map bundles: the borders, states and provinces, cities, rivers, lakes, coastline, land, ocean, seas and physical regions of a region (the world, a continent or a country), stored next to the application as folders of FlatGeobuf or GeoJSON files, or as GeoPackage files with Meziantou.Framework.Geo.Maps.GeoPackage. The layers are read as the features of Meziantou.Framework.Geo, and draw maps with Meziantou.Framework.Charts.

Usage

// The packages of bundles copy their regions to the maps folder next to the application
var map = MapCatalog.Default.GetMap("Switzerland");
Assert.Equal("Switzerland", map.Name);
Assert.StartsWith("© OpenStreetMap contributors", map.Attribution);

// The layers are read when they are loaded
var cantons = map.Load(MapLayer.StatesProvinces);
Assert.HasCount(26, cantons);
Assert.Contains("Vaud", cantons.Select(canton => (string?)canton.Properties["name"]));

var cities = map.Load(MapLayer.Cities);
var bern = cities.Single(city => city.Properties["name"] is "Bern");
Assert.Equal(true, bern.Properties["capital"]);

// Switzerland has no sea: it has no coastline, land or ocean layer
Assert.False(map.HasLayer(MapLayer.Coastline));

The package has no map of its own: add the package of the bundle of each region you need, such as Meziantou.Framework.Geo.Maps.Data.Switzerland, or build the bundles with the tools/Meziantou.Framework.Geo.Maps.Tool tool of the repository.

Formats

MapCatalog reads the folders of FlatGeobuf files (MapFormat.FlatGeobuf, the default of the tool) and of GeoJSON files (MapFormat.GeoJson). MapFormat.Write writes a map in a format, such as a GeoJSON copy for a web page:

// Write the map of a region in another format: a folder of GeoJSON files, which web libraries read
var output = Directory.CreateTempSubdirectory().FullName;
var map = MapCatalog.Default.GetMap("Switzerland");
MapFormat.GeoJson.Write(MapFormat.GeoJson.GetPath(output, map.Region), map);
Assert.True(File.Exists(Path.Combine(output, "Switzerland", "states-provinces.geojson")));

// The default catalog reads both folder formats
var copy = new MapCatalog(output).GetMap("Switzerland");
Assert.HasCount(26, copy.Load(MapLayer.StatesProvinces));

Data

The borders and subdivisions are derived from OpenStreetMap (© OpenStreetMap contributors, ODbL) through country-levels; the cities, rivers, lakes, coastline, land, ocean, marine areas and physical regions come from Natural Earth (public domain). Show Map.Attribution on the maps you publish.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (258)

Showing the top 5 NuGet packages that depend on Meziantou.Framework.Geo.Maps:

Package Downloads
Meziantou.Framework.Geo.Maps.GeoPackage

Reads and writes the map bundles of Meziantou.Framework.Geo.Maps as GeoPackage files: one SQLite file per region, with a table and a spatial index per layer, that QGIS and GDAL open.

Meziantou.Framework.Geo.Maps.Data.Europe

The map of Europe: borders, states and provinces, cities, rivers, lakes, coastline, land, ocean, seas and gulfs and physical regions, as FlatGeobuf, embedded in an assembly for Meziantou.Framework.Geo.Maps: use Map.Region_Europe. Generated by Meziantou.Framework.Geo.Maps.Tool. © OpenStreetMap contributors (ODbL): borders and subdivisions via country-levels. Cities, rivers, lakes, land, ocean, coastline, marine areas and physical regions: Natural Earth (public domain).

Meziantou.Framework.Geo.Maps.Data.Botswana

The map of Botswana: borders, states and provinces, cities, rivers, lakes and physical regions, as FlatGeobuf, embedded in an assembly for Meziantou.Framework.Geo.Maps: use Map.Region_Botswana. Generated by Meziantou.Framework.Geo.Maps.Tool. © OpenStreetMap contributors (ODbL): borders and subdivisions via country-levels. Cities, rivers, lakes, land, ocean, coastline, marine areas and physical regions: Natural Earth (public domain).

Meziantou.Framework.Geo.Maps.Data.Albania

The map of Albania: borders, states and provinces, cities, rivers, lakes, coastline, land, ocean, seas and gulfs and physical regions, as FlatGeobuf, embedded in an assembly for Meziantou.Framework.Geo.Maps: use Map.Region_Albania. Generated by Meziantou.Framework.Geo.Maps.Tool. © OpenStreetMap contributors (ODbL): borders and subdivisions via country-levels. Cities, rivers, lakes, land, ocean, coastline, marine areas and physical regions: Natural Earth (public domain).

Meziantou.Framework.Geo.Maps.Data.Mauritius

The map of Mauritius: borders, states and provinces, cities, coastline, land, ocean, seas and gulfs and physical regions, as FlatGeobuf, embedded in an assembly for Meziantou.Framework.Geo.Maps: use Map.Region_Mauritius. Generated by Meziantou.Framework.Geo.Maps.Tool. © OpenStreetMap contributors (ODbL): borders and subdivisions via country-levels. Cities, rivers, lakes, land, ocean, coastline, marine areas and physical regions: Natural Earth (public domain).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 40 11/13/2026
1.0.2 92 11/8/2026
1.0.1 98 11/8/2026
1.0.0 2,673 11/7/2026