百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

Geo

> 编程语言
开源

一个用于 .NET 的地理空间库

192 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

一个用于 .NET 的地理空间库

Geo — a geospatial library for .NET

Geo is a spatial library for .NET built specifically for geographic data — coordinates on the surface of the Earth — rather than planar/projected data. It provides geometry and GPS types, serializers for common spatial and GPS file formats, and geodetic and geomagnetic calculations.

Wondering how it compares to NetTopologySuite? See Geo vs. NetTopologySuite.

Documentation · Changelog · Issues · NuGet

Contents

  • Installation
  • Quick start
  • Features
  • Conventions
  • Building from source
  • Contributing
  • License

Installation

Geo targets .NET Standard 2.0, so it runs on .NET 5+, .NET Core 2.0+, and .NET Framework 4.6.1+. Install it from NuGet:

bash
dotnet add package Geo

Quick start

…

Features

Geometry types

  • Point
  • LineString, LinearRing
  • Polygon, Triangle
  • Circle
  • GeometryCollection, MultiPoint, MultiLineString, MultiPolygon

Coordinates come in four flavours: Coordinate (lat/lon), CoordinateZ (with elevation), CoordinateM (with a measure), and CoordinateZM (both).

GPS types

  • GpsData, Route, Track, Waypoint

Serialize / deserialize geometries

Format Read Write
WKT (Well-Known Text) ✓ ✓
WKB (Well-Known Binary) ✓ ✓
GeoJSON ✓ ✓

Don't know a string's format up front? GeoFormat.Detect / GeoFormat.TryParse sniff whether it is a coordinate pair, WKT, or GeoJSON and parse it — see the parsing guide.

Serialize / deserialize GPS files

Format Read Write
GPX (1.0 & 1.1) ✓ ✓
NMEA ✓
IGC ✓
Garmin flightplan ✓
SkyDemon flightplan ✓
PocketFMS flightplan ✓

Links are read and written for both versions - GpsData, Waypoint, Route and Track each expose a Links collection of GpsLink (href, text, media type). GPX 1.1 allows any number; GPX 1.0 has a single / pair, so writing 1.0 keeps the first.

GPX extensions are read and written for both versions, so vendor content such as Garmin's gpxx or the Topografix gpx_style line styling survives a round-trip. GpsData, Track, TrackSegment, Route and Waypoint each expose the foreign content of their element as XElements:

csharp
XNamespace style = "http://www.topografix.com/GPX/gpx_style/0/2";

var colour = data.Tracks[0]
    .Extensions.FirstOrDefault(x => x.Name == style + "line")
    ?.Element(style + "color")?.Value;

Geographic calculations

  • Distance and bearing
  • Area
  • Great-circle lines
  • Rhumb lines

Geomagnetism calculations

  • IGRF and WMM models (through 2025)
  • Declination, inclination, intensity, and more

Conventions

  • All ordinates are in degrees, unless specified otherwise.
  • All measurements are in S.I. units (metres, seconds, etc.), unless specified otherwise.
  • The coordinate reference system is assumed to be WGS-84.
  • Ordinate order in constructors is latitude, longitude (e.g. new Coordinate(lat, lon)).

Building from source

The project uses NUKE for build automation. Use the bootstrap scripts, which pin the SDK and run the same targets as CI:

bash
./build.sh            # compile (default target)
./build.sh Test       # build and run tests

On Windows, use build.cmd / build.ps1. See AGENTS.md for a full description of the repository layout, build targets, and coding conventions.

Contributing

Issues and pull requests are welcome. Formatting is enforced by CSharpier and checked in CI — run dotnet csharpier format . before committing (a pre-commit hook does this for staged files). New library code must remain compatible with .NET Standard 2.0.

License

Geo is licensed under the terms of the GNU Lesser General Public License, version 3 or later (LGPL-3.0-or-later), as published by the Free Software Foundation. See LICENSE for details.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言