GeoDesk 1.0.0-pre.8
dotnet add package GeoDesk --version 1.0.0-pre.8
NuGet\Install-Package GeoDesk -Version 1.0.0-pre.8
<PackageReference Include="GeoDesk" Version="1.0.0-pre.8" />
<PackageVersion Include="GeoDesk" Version="1.0.0-pre.8" />
<PackageReference Include="GeoDesk" />
paket add GeoDesk --version 1.0.0-pre.8
#r "nuget: GeoDesk, 1.0.0-pre.8"
#:package GeoDesk@1.0.0-pre.8
#addin nuget:?package=GeoDesk&version=1.0.0-pre.8&prerelease
#tool nuget:?package=GeoDesk&version=1.0.0-pre.8&prerelease
GeoDesk for .NET
GeoDesk is a fast and storage-efficient geospatial database for OpenStreetMap data. This package is a C# port of the GeoDesk Java library, bringing the same query model to .NET. (GeoDesk is also available for Java, for C++ and for Python.)
You query a GOL (Geographic Object Library) file — a compact, pre-indexed snapshot of OSM data —
and get back Node, Way and Relation features with their tags and geometry.
GOL files are read, not built, by this library. Build a
.golfrom an.osm.pbfextract with GOL Tool 2.0, then open it here. This package targets the GOL 2.0 format.
Why GeoDesk?
Small storage footprint — GOL files are only 20% to 50% larger than the original OSM data in PBF format — less than a tenth of what a traditional SQL-based database consumes.
Fast queries — typically 50 times faster than SQL.
Intuitive API — no object-relational mapping; queries return
INode,IWayandIRelationobjects. Discover tags, way-nodes and relation members; get a feature's geometry; measure its length or area.Proper handling of relations — traditional geospatial databases deal in geometric shapes and need workarounds for this unique and powerful aspect of OSM data.
Seamless integration with NetTopologySuite (NTS) — the .NET port of JTS — for advanced geometric operations: buffer, union, simplify, convex and concave hulls, Voronoi diagrams, and more.
Modest hardware requirements — runs anywhere .NET runs: Windows, Linux and macOS.
Status: this is a faithful in-progress port. The full read + query path is implemented and validated against real GOL data. Writing/building GOLs is handled by the external GOL Tool, not this library.
Get Started
Install from NuGet:
dotnet add package GeoDesk
…or add a PackageReference to your project (the package targets .NET 10):
<PackageReference Include="GeoDesk" Version="1.0.0" />
To build the latest version from source instead:
git clone https://github.com/alethic/geodesk-net.git
cd geodesk-net
dotnet build
Example Application
using GeoDesk.Feature;
using GeoDesk.Geom;
using FeatureLibrary library = FeatureLibrary.Open("switzerland.gol"); // 1
foreach (IFeature pub in library // 2
.Select("na[amenity=pub]") // 3
.In(Box.OfWSEN(8.53, 47.36, 8.55, 47.38))) // 4
{
Console.WriteLine(pub.StringValue("name")); // 5
} // 6
What's going on here?
- We open a feature library (
switzerland.gol).FeatureLibraryisIDisposable, sousingcloses it for us. - We iterate through all the features ...
- ... that are pubs (GeoDesk query language — similar to MapCSS).
- ... in downtown Zurich (a bounding box with West/South/East/North coordinates, in degrees).
- We print the name of each pub.
- The
usingblock disposes the library when we're done.
That's it — your first GeoDesk application!
More Examples
Find all movie theaters within 500 meters of a given point:
IFeatures movieTheaters = library
.Select("na[amenity=cinema]")
.MaxMetersFromLonLat(500, myLon, myLat);
Remember, OSM uses British English for its terminology.
Discover the bus routes that traverse a given street:
foreach (IFeature route in street.Parents("[route=bus]"))
{
Console.WriteLine($"- {route.StringValue("ref")} " +
$"from {route.StringValue("from")} to {route.StringValue("to")}");
}
Count the number of entrances of a building:
long numberOfEntrances = building.Nodes("[entrance]").Count();
Differences from the Java edition
The API mirrors the Java library closely; the main adaptations are idiomatic .NET:
| Java | .NET |
|---|---|
Features.open(path) |
FeatureLibrary.Open(path) |
library.close() |
using / IDisposable |
feature.stringValue("name") |
feature.StringValue("name") (PascalCase throughout) |
Feature, Features |
IFeature, IFeatures (interfaces) |
| Java Topology Suite (JTS) | NetTopologySuite (NTS) — Geometry, GeometryFactory, … |
Coordinates as int "imps" |
identical (integer Web-Mercator projection) |
The GeoDesk query language (GOQL) is identical.
Documentation
The Java API is mirrored closely, so the official GeoDesk documentation applies (translate method names to PascalCase):
Related Repositories
- geodesk-gol — command-line tool for building and querying GOL files
- geodesk — GeoDesk for Java (the upstream this port mirrors)
- libgeodesk — GeoDesk for C++
- geodesk-py — GeoDesk for Python
License
Licensed under the Apache License 2.0. GeoDesk is a project of Clarisma; this .NET port is maintained separately.
| 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. |
-
net10.0
- NetTopologySuite (>= 2.6.0)
- System.IO.Hashing (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-pre.8 | 1,035 | 7/3/2026 |
| 1.0.0-pre.7 | 93 | 6/22/2026 |
| 1.0.0-pre.6 | 77 | 6/21/2026 |
| 1.0.0-pre.5 | 90 | 6/19/2026 |