RustAtlas 🌍
RustAtlas is a terminal-based (TUI) application written in Rust for exploring geographic data directly in your console. Leveraging the power of ratatui and crossterm, RustAtlas provides an interactive interface to navigate world, continent, and country maps, view detailed information, and seamlessly travel through historical selections.
Main interface showing country selection and map
GDP historical data visualization
-
Hierarchical Navigation: Explore data at three levels:
- World: View all continents.
- Continent: Drill down into countries within a selected continent.
- Country: See an individual country boundary and details.
-
Interactive Map Rendering: Render GeoJSON outlines as vector graphics in the terminal. Automatically filters out minor polygon components to focus on the primary shape.
-
Detailed Country Info: Display capital, area, population, and currency for each country (loaded from a JSON data source).
-
GDP Data Visualization: View historical GDP data from World Bank for selected countries, with both summary and detailed chart views.
-
Keyboard Controls:
↑/↓: Move selection up/down in lists.Enter: Dive into the selected geographic level.Esc/Backspace: Go back to the previous level.Tab: Toggle GDP chart display for the selected country.q: Quit the application.
-
State Persistence: Keeps a navigation history to allow seamless backward navigation.
-
Clone the repository:
git clone https://github.com/yourusername/RustAtlas.git cd RustAtlas -
Prepare data:
-
Create a
data/directory at the project root. -
Place the following files inside
data/:world.geojsonandcontinent_{name}.geojsonfiles for drawing.continent_{name}.jsonandcountry_{name}.jsonlists of names.country_info.jsoncontaining a map of country keys to metadata.gdp_data.csvcontaining World Bank GDP data (from https://data.worldbank.org/indicator/NY.GDP.MKTP.CD).
-
-
Build & Run:
cargo run --release -- data
-
GeoJSON Files:
continent_world.geojson: All continents.country_{continent}.geojson: Countries for each continent.country_{country}.geojson: Detailed geometry for a single country.
-
JSON Lists:
continent_world.json: List of continent names.country_{continent}.json: List of countries for that continent.
-
Country Info:
{ "united_states_of_america": { "name": "United States of America", "capital": "Washington, D.C.", "area": 9833520.0, "population": 331002651, "currency": "USD" }, // ... } -
GDP Data:
The application uses GDP data from the World Bank (https://data.worldbank.org/indicator/NY.GDP.MKTP.CD) in CSV format. The data includes GDP values in current USD for countries across multiple years.
main.rs: Initializes terminal in raw mode, sets up alternate screen, and drives the main event loop.data.rs: ImplementsDataCachefor loading JSON lists, GeoJSON data, and country metadata.map_draw.rs: Converts GeoJSON intogeolibrary types, filters polygons, computes bounds, and draws shapes usingratatui::widgets::canvas::Canvas.state.rs: DefinesAppStateto track current level, selection, navigation history, loaded map, and UI panels.ui.rs: Composes the terminal layout: left list panel, center map canvas, and right info panel.gdp_reader.rs: Parses and processes GDP data from World Bank CSV format.
- Zoom & Pan: Allow dynamic scaling and movement of map view.
- Search: Quick search for countries by name.
- Styling: Add colored fills or gradients for different regions.
- Additional Data: Integrate ISO codes, time zones, and real-time statistics.
Project developed as part of the "Programming in Rust" course, Computer Science, AGH University of Krakow, 2025.