godot-gis

Crates.iogodot-gis
lib.rsgodot-gis
version0.3.0-rc2
created_at2025-10-24 19:36:08.641919+00
updated_at2025-12-23 06:07:58.413991+00
descriptionGodot GDExtension for saving, loading, and manipulating GIS data
homepage
repositoryhttps://github.com/Paperback/godot-gis
max_upload_size
id1899158
size589,992
Paperback (Paperback)

documentation

README

CI crates.io crates.io

Godot-GIS

Godot-GIS

Use GIS data and algorithms in your Godot projects.




Features

  • ResourceFormatSaver and ResourceFormatLoader for reading and writing of GIS files.
    • GisMvtTile, GisMvtTileLayer
    • GisGpkg, GisGpkgLayer
    • GisShapefile
  • Features have geometry
    • GisPoint, GisMultipoint
    • GisLine, GisMultiLine, GisLineString
    • GisPolygon, GisMultiPolygon
    • GisRect
    • GisTriangle
    • GisGeometryCollection
  • Spatial index using rstar, query nearby features
    • GisFeatureIndex2D
  • Algorithms thanks to georust
    • centroid, extent
    • intersects, contains, within
    • area, length, distance,
    • simplify, densify,
    • buffer, grow, shrink
  • polylabel
  • proj transform

Supports Godot 4.2+ thanks to godot-rust

Getting started

⚠️ Notice: This project is not complete and some features have not been fully tested for production use. Please report any issues you encounter.

Godot addon

To use this addon in your project download the addon from the releases page. Extract inside your project, ensuring godot-gis is inside your addons folder.

Using rust?

Add godot-gis to your Cargo.toml file:

[dependencies]
godot-gis = { version = "0.2", features = ["no-extension-library"] }

When defining your gdextension, register godot-gis:

#[gdextension]
unsafe impl ExtensionLibrary for Example {
    fn on_level_init(level: InitLevel) {
        if level == InitLevel::Scene {
            godot_gis::register();
        }
    }

    fn on_level_deinit(level: InitLevel) {
        if level == InitLevel::Scene {
            godot_gis::unregister();
        }
    }
}

Example

var tile: MvtTile = load("res://tile.mvt")
# or shapefile
# or gpkg

for layer in tile.layers:
    for feature in layer.features:
        if feature is GisPolygon:
            # convert feature to Polygon2D
            var polygon := feature.to_polygon2d()
            # convert feature to ArrayMesh
            var mesh := feature.to_array_mesh()
            ### etc

For more detailed examples, see the examples folder.

  1. Load MVT tile
  2. Construct line meshes
  3. Collision meshes
  4. Transform with Proj
  5. Find features next to other features with rstar
Commit count: 0

cargo fmt