{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\nHighways, railways and hidrographies\n====================================\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "In this example, we'll get and plot brazil highways, railways and higrographies.\nAll we need to do is request the right layer in the right IBGE ArcGIS server service.\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from mapsbr import ibgemaps, arcgis\n\nrailways = arcgis.get_map(\"BASEMAP\", layer=2)\nhighways = arcgis.get_map(\"BASEMAP\", layer=3)\nhidrographies = arcgis.get_map(\"BASEMAP\", layer=4)\n\ntransports = railways, highways, hidrographies\ntitles = [\"Railways\", \"Highways\", \"Hidrographies\"]"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "Once we have it, let's now plot it.\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as plt\n\nfig, axes = plt.subplots(nrows=1, ncols=3, figsize=(15, 10), constrained_layout=True)\nbr = ibgemaps.get_map(\"BR\")\nfor ax, transport, title in zip(axes.flat, transports, titles):\n    br.plot(ax=ax, color=\"white\", edgecolor=\"gray\")\n    transport.plot(ax=ax, column=transport.columns[1])\n    ax.set_title(title)\n    ax.axis(\"off\")"
      ]
    }
  ],
  "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.7.3"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}