{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Load Geneva dataset\nIn this tutorial, we will learn how to load Geneva 3D buildings datasets.\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "Geneva Geneva 3D buildings datasets can be loaded thanks to the geneva.load_data()\nfunction.\nThis function will first check if the city's building geometries files are already\npresent in the dataset folder.\nYou can acces the local geneva dataset directory using the following function:\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from ipybuilding.utils import get_config\n\nconfig = get_config()\npath = config[\"GENEVA_DATASET_PATH\"]\npath"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "If not already present on your computer, this function will automatically\ndownload the 3 .gpkg files containing the city building's geometries from a remote serveur\nand save them in the local geneva dataset directory for futur use.\nIf the file are already present in the local geneva dataset directory, the function will\ncheck the hash in case of modification and redownload clean versions if needed.\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from ipybuilding.datasets import geneva\n\nbase_path, facade_path, roof_path = geneva.load_data()\nbase_path"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "base_path, facade_path, roof_path are the respective path to the files\nof base, roof and facade geometries of geneva's buildings.\ntheses files can esaly be loaded thanks to geopandas:\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import geopandas\n\nbases = geopandas.read_file(base_path)\nbases"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.8.6"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}