GeoDesk 1.0.0-pre.8

This is a prerelease version of GeoDesk.
dotnet add package GeoDesk --version 1.0.0-pre.8
                    
NuGet\Install-Package GeoDesk -Version 1.0.0-pre.8
                    
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="GeoDesk" Version="1.0.0-pre.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GeoDesk" Version="1.0.0-pre.8" />
                    
Directory.Packages.props
<PackageReference Include="GeoDesk" />
                    
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 GeoDesk --version 1.0.0-pre.8
                    
#r "nuget: GeoDesk, 1.0.0-pre.8"
                    
#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 GeoDesk@1.0.0-pre.8
                    
#: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=GeoDesk&version=1.0.0-pre.8&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=GeoDesk&version=1.0.0-pre.8&prerelease
                    
Install as a Cake Tool

GeoDesk for .NET

NuGet

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 .gol from an .osm.pbf extract 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, IWay and IRelation objects. 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?

  1. We open a feature library (switzerland.gol). FeatureLibrary is IDisposable, so using closes it for us.
  2. We iterate through all the features ...
  3. ... that are pubs (GeoDesk query languagesimilar to MapCSS).
  4. ... in downtown Zurich (a bounding box with West/South/East/North coordinates, in degrees).
  5. We print the name of each pub.
  6. The using block 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):

  • 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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