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

geodesk

> 数据库
开源

用于 OpenStreetMap 数据的快速且存储效率高的空间数据库引擎

189 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

用于 OpenStreetMap 数据的快速且存储效率高的空间数据库引擎

GeoDesk is a fast and storage-efficient geospatial database for OpenStreetMap data. Also available for C++ and for Python.

[!IMPORTANT] For Version 2.0, you will need to build GOLs with GOL Tool 2.0.

To read GOLs built with GOL Tool 1.x, use Version 1.1.0 of this toolkit.

Why GeoDesk?

  • Small storage footprint — GeoDesk's GOL files are only 20% to 50% larger than the original OSM data in PBF format — that's less than a tenth of the storage consumed by a traditional SQL-based database.

  • Fast queries — typically 50 times faster than SQL.

  • Fast to get started — Converting .osm.pbf data to a GOL is 20 times faster than an import into an SQL database. Alternatively, download pre-made data tiles for just the regions you need and automatically assemble them into a GOL.

  • Intuitive API — No need for object-relational mapping; GeoDesk queries return Node, Way and Relation objects. Quickly discover tags, way-nodes and relation members. Get a feature's Geometry, measure its length/area.

  • Proper handling of relations — (Traditional geospatial databases deal with geometric shapes and require workarounds to support this unique and powerful aspect of OSM data.)

  • Seamless integration with the Java Topology Suite (JTS) for advanced geometric operations, such as buffer, union, simplify, convex and concave hulls, Voronoi diagrams, and much more.

  • Modest hardware requirements — If it can run a 64-bit JVM, it'll run GeoDesk.

Get Started

Maven

Include this dependency in your project's pom.xml:

xml

    com.geodesk
    geodesk
    2.1.0

Alternatively, to build the latest version from source:

bash
git clone https://github.com/clarisma/geodesk.git
cd geodesk
mvn install

Example Application

java
import com.geodesk.feature.*;
import com.geodesk.geom.*;

public class PubsExample
{
    public static void main(String[] args)
    {
        var library = Features.open("switzerland.gol");  // 1
        
        for(Feature pub: library                         // 2
            .select("na[amenity=pub]")                   // 3
            .in(Box.ofWSEN(8.53,47.36,8.55,47.38)))      // 4
        {
            System.out.println(pub.stringValue("name")); // 5
        }
        
        library.close();                                 // 6
    }
}

What's going on here?

  1. We're opening a feature library (switzerland.gol)

  2. We iterate through all the features ...

  3. ... that are pubs (GeoDesk query language — similar to MapCSS)

  4. ... in downtown Zurich (bounding box with West/South/East/North coordinates).

  5. We print the name of each pub.

  6. We close the library.

That's it, you've created your first GeoDesk application!

More Examples

Find all movie theaters within 500 meters from a given point:

java
Features 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:

java
for(Feature route: street.parents("[route=bus]"))
{
    System.out.format("- %s from %s to %s",
        route.stringValue("ref"),
        route.stringValue("from"),
        route.stringValue("To"));
}

Count the number of entrances of a building:

java
int numberOfEntrances = building.nodes("[entrance]").size();

Documentation

  • GeoDesk Developer's Guide
  • API Reference

Related Repositories

  • geodesk-gol — command-line utility for building, maintaining and querying GOL files
  • geodesk-examples — example applications
  • geodesk-tests — integration tests
  • libgeodesk — GeoDesk for C++
  • geodesk-py — GeoDesk for Python
  • gol-tool — legacy GOL Tool (supports GOL 1.0 files)

Issues· 0 开放

查看全部 Issues在 GitHub 打开

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

> 标签

Javadatabasegeodeskgeospatialgis

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

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库