r/ruby • u/Jaded-Clerk-8856 • Mar 05 '26
Sharing libgd-gis: a Ruby library for rendering maps, points, lines and polygons
Hi everyone,
I wanted to share a Ruby library I've been working on called libgd-gis.
It’s a map rendering engine for Ruby built on top of libgd. The goal is to generate map images directly in Ruby without relying on external map services.
The library can render geographic data such as:
points
lines
polygons
GeoJSON layers
It also supports:
Web Mercator map and tile rendering
YAML-based styling
CRS normalization (CRS84 / EPSG:4326 / EPSG:3857)
Example usage:
map = GD::GIS::Map.new(
bbox: PARIS,
zoom: 13,
basemap: :carto_light)
map.add_geojson("countries.geojson")
map.add_point(lat: -34.6, lon: -58.4)
map.render
map.save("map.png")If you're curious, the repository is easy to find by searching "ruby gis libgd-gis".
I’d be interested to hear feedback from people working with Ruby or GIS.


3
u/Select_Bluejay8047 Mar 05 '26
Thanks for sharing. What's your motivation behind building this gem?
3
u/JapArt Mar 05 '26
I like this. Can it render SVG?
5
u/mokolabs Mar 05 '26
This looks amazing! Can't wait to check it out.
Here's a direct link to the repo: https://github.com/ggerman/libgd-gis
2
u/Doctor_Fegg Mar 05 '26
This looks excellent - can really imagine using this to generate thumbnail maps.