{
  "cells": [
    {
      "cell_type": "markdown",
      "id": "americas-intro",
      "metadata": {},
      "source": "# Mexico and Canada: offline administrative maps\n\nInstall the matching `mexico.anermap` and `canada.anermap` files with `aner maps install FILE.anermap`, then restart and Run All with the updated native development runtime and compatible editor. The source side `plot` collection supplies both packs. For a custom store, set `ANER_MAPS_DIR` for the notebook process as well as the terminal. Installation and rendering need no network access. Values are synthetic; generalized boundaries use the pinned Natural Earth June 2022 snapshot.\n"
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "americas-imports",
      "metadata": {},
      "outputs": [],
      "source": [
        "// Requires the updated native development runtime and the mexico/canada packs.\n",
        "// Install the matching local .anermap files before running offline.\n",
        "// Values are synthetic. Boundaries: generalized Natural Earth 1:10m, 2022 snapshot.\n",
        "import aner.plot\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "mexico-national-context",
      "metadata": {},
      "source": "## Mexico: named federal entities\n\nThe catalogue has 31 states plus Mexico City. It retains all source geometry of those named units and excludes one unnamed, unassigned offshore pseudo unit; no state assignment is invented. Albers is a spherical equal area display projection for this broad regional view. The map does not add municipal boundaries.\n"
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "mexico-national",
      "metadata": {},
      "outputs": [],
      "source": [
        "let mexico = plot.map(\"mexico\",\n",
        "    keys: List(\"MX-DIF\", \"MX-JAL\", \"MX-NLE\"), values: List(8.0, 12.0, 10.0))\n",
        "mexico.projection(\"albers\")\n",
        "    .title(\"Mexico: synthetic federal-entity values\")\n",
        "    .caption(\"Natural Earth 2022 snapshot; 32 named entities; unassigned offshore pseudo-unit excluded.\")\n",
        "    .show()\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "mexico-city-context",
      "metadata": {},
      "source": "## Mexico City: legacy source identity\n\nThe pinned source identifies this federal entity as `MX-DIF` and labels it “Distrito Federal.” Keep that legacy join key explicit; it does not establish a current administrative name or ISO identifier. Focus uses the existing federal entity polygon with local Lambert azimuthal equal area. It does not imply finer city streets or neighborhoods.\n"
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "mexico-city",
      "metadata": {},
      "outputs": [],
      "source": [
        "// Preserve the pinned source key/name; MX-DIF is a legacy code for Mexico City.\n",
        "mexico.focus(\"MX-DIF\").projection(\"lambert_azimuthal_equal_area\")\n",
        "    .title(\"Mexico City: federal-entity boundary\")\n",
        "    .caption(\"Synthetic index; source key MX-DIF, source label Distrito Federal; no municipality or street layer.\")\n",
        "    .show()\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "canada-national-context",
      "metadata": {},
      "source": "## Canada: provinces and territories\n\nAll ten provinces and three territories retain their source geometry, including Arctic islands. Provincial values join source ISO style keys; unprovided values remain no data. Use broad Albers to compare this national view.\n"
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "canada-national",
      "metadata": {},
      "outputs": [],
      "source": [
        "let canada = plot.map(\"canada\",\n",
        "    keys: List(\"CA-BC\", \"CA-ON\", \"CA-QC\"), values: List(9.0, 14.0, 11.0))\n",
        "canada.projection(\"albers\")\n",
        "    .title(\"Canada: synthetic provincial values\")\n",
        "    .caption(\"Natural Earth 2022 snapshot; all 10 provinces and 3 territories; missing values have no data.\")\n",
        "    .show()\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "canada-ontario-context",
      "metadata": {},
      "source": "## Ontario: focus on an administrative unit\n\nFocus fits the source province, keeps neighboring boundaries and retains the full chart color range. A focused view selects local Lambert azimuthal equal area; no new geometry is loaded. These display projections are separate from analysis CRS transformations or distance/area calculations.\n"
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "canada-ontario",
      "metadata": {},
      "outputs": [],
      "source": [
        "canada.focus(\"CA-ON\").projection(\"lambert_azimuthal_equal_area\")\n",
        "    .title(\"Ontario: focused provincial extent\")\n",
        "    .caption(\"Synthetic index; generalized provincial boundary; focus retains the full chart color range.\")\n",
        "    .show()\n",
        "\n",
        "// These spherical display projections do not transform coordinates for analysis.\n",
        "// Country subdivisions remain distinct from municipalities, cities and street maps.\n"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "name": "aner",
      "display_name": "Aner",
      "language": "aner"
    },
    "language_info": {
      "name": "aner",
      "file_extension": ".aner",
      "mimetype": "text/x-aner"
    },
    "aner": {
      "status": "example",
      "execution_mode": "persistent-session"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}
