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
<PackageReference Include="Meziantou.Framework.Geo.Maps" Version="1.0.3" />
<PackageVersion Include="Meziantou.Framework.Geo.Maps" Version="1.0.3" />
<PackageReference Include="Meziantou.Framework.Geo.Maps" />
paket add Meziantou.Framework.Geo.Maps --version 1.0.3
#r "nuget: Meziantou.Framework.Geo.Maps, 1.0.3"
#:package Meziantou.Framework.Geo.Maps@1.0.3
#addin nuget:?package=Meziantou.Framework.Geo.Maps&version=1.0.3
#tool nuget:?package=Meziantou.Framework.Geo.Maps&version=1.0.3
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 | Versions 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. |
-
net10.0
- Meziantou.Framework.Geo (>= 1.0.2)
-
net11.0
- Meziantou.Framework.Geo (>= 1.0.2)
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.