Visualization tools suitable for geographic data.
geotify is a library that visualizes desired data on top of geographic data.
Geotify depends on the following packages:
- matplotlib
- pandas
- geopandas
- rich
from pathlib import Path
from geotify.visualization import BarChartVisualizer, RegionCodeEnum
# Set the path to the datasets directory
ASSETS_PATH = Path(__file__).parent / "datasets"
# Define paths to the GeoJSON and CSV files
map_data_path = ASSETS_PATH.joinpath("base_korea_map.json")
population_density_data = ASSETS_PATH.joinpath("강원도.csv")
# Initialize the visualizer with specific regional settings
density_visualizer = BarChartVisualizer(
map_data_path, population_density_data, RegionCodeEnum.강원특별자치도, "동별(2)"
)
# List of regions to visualize
region_names = ["평창군"]
# Column name containing the population density values
value_column = "인구밀도 (명/㎢)"
# Execute the visualization
density_visualizer.visualize(region_names, value_column)
geotify_map = HeatmapVisualizer(map_data_path, population_density_data)
geotify_map.visualize(color="lightblue")