
Working with maps usually means working with numbers β lots of numbers.
If you want to render a map of a country, region, or continent, you normally need to know its exact bounding box:
bbox = [-73.6, -55.1, -53.6, -21.7] # Argentina
Not exactly readable. Not memorable. Not friendly.
What if you could just say:
bbox: :argentina
With the latest update to libgd-gis, you can.
π§ Named Geographic Extents
LibGD-GIS now includes a global dataset of predefined geographic areas.
Each area maps a human-readable name to a WGS84 bounding box.
Instead of coordinates, you use concepts.
:world:europe:asia:north_america:argentina:japan- β¦and many more
π Example: Render Argentina in Seconds
require "gd/gis"
map = GD::GIS::Map.new(
bbox: :argentina,
zoom: 5,
width: 800,
height: 600,
basemap: :osm
)map.render
map.save("argentina.png")

No coordinates. No GIS lookup. No guesswork.
π Example: Entire World
map = GD::GIS::Map.new(
bbox: :world,
zoom: 2,
width: 1000,
height: 600,
basemap: :osm
)map.render
map.save("world.png")

Perfect for dashboards, reports, or quick visualizations.
π Continents and Regions
Because extents include continents, you can generate regional maps just as easily.
regions = [:europe, :asia, :south_america]regions.each do |region|
map = GD::GIS::Map.new(
bbox: region,
zoom: 3,
width: 900,
height: 600,
basemap: :osm
) map.render
map.save("#{region}.png")
end


This is extremely useful for batch generation of visuals.
π Under the Hood
You can also query the dataset directly:
GD::GIS::Extents.fetch(:argentina)
# => [min_lng, min_lat, max_lng, max_lat]GD::GIS::Extents.all
# => [:world, :europe, :asia, :argentina, ...]
Coordinates use:
- WGS84 (EPSG:4326)
- Longitude/Latitude order
- Approximate bounds for visualization

β Why This Matters
Named extents turn raw geometry into meaningful geography.
Instead of thinking:
βWhat are the coordinates?β
You think:
βWhat place do I want?β
This makes code:
βοΈ More readable
βοΈ Easier to maintain
βοΈ Faster to prototype
βοΈ Ideal for automation
βοΈ Friendly for non-GIS developers
π Conclusion
Symbolic geographic extents bring a simple but powerful idea to server-side mapping:
Use names instead of numbers.
For many applications β dashboards, reporting, monitoring, education, or demos β this is exactly what you need.
And sometimes, the biggest usability improvements come from removing complexity, not adding features.
