Notebook 2: Boundary Setup

Overview

Create the boundary hierarchy and upload boundary masters for a city tenant.

File: 2_BoundarySetup.ipynb

Creates:

  • Boundary hierarchy definition (example: City → Zone → Ward → Block → Locality)

  • Boundary values for all levels

circle-exclamation

Steps

Step 1: Open the notebook

  • Open Jupyter and go to the Notebooks folder.

  • Open 2_BoundarySetup.ipynb.

Step 2: Authenticate (city-level)

Authenticate the same way as Notebook 1, but use the city tenant credentials.

Use these typical values:

  • User Type: EMPLOYEE

  • Tenant ID: pg.citya (your city tenant)

Step 3: Select tenant

Enter your tenant code (example: pg.citya).

Step 4: Create or select the boundary hierarchy

Option A: Create a new hierarchy (first-time setup)

  1. Select Create New Hierarchy.

  1. Enter Hierarchy type: ADMIN.

  2. Define the levels.

Level
Boundary Type

Level 1

City

Level 2

Zone

Level 3

Ward

Level 4

Block

Level 5

Locality

  1. Click Create Hierarchy.

Option B: Use an existing hierarchy

If a hierarchy already exists, select it from the dropdown.

Step 5: Generate and download the template

  1. Click Generate Boundary Template.

  2. Wait for generation (typically 30–60 seconds).

  3. Click Download Template.

Step 6: Fill the boundary template

Open the downloaded Excel file and fill in the boundary rows.

Example:

Code
Name
Parent Code

PG_CITYA

City A

(empty)

PG_CITYA_Z1

Zone 1

PG_CITYA

PG_CITYA_Z1_W1

Ward 1

PG_CITYA_Z1

Rules:

  • Level 1 has no parent (leave Parent Code empty).

  • All other levels must have a valid Parent Code.

  • Codes must be unique.

Step 7: Upload and process boundaries

  1. Upload the filled template.

  1. Click 📤 Upload File.

  1. Click ⚙️ Process Boundaries.

  1. Wait for processing (typically 1–5 minutes).

  2. Click Check processing status.

  1. Download the processed template and review the results.

Step 8: Handle errors (if any)

If any rows fail in the processed file:

  • Filter to rows with FAILED.

  • Read the error message column.

  • Fix the source data in those rows.

  • Delete the status columns (example: _STATUS, _STATUS_CODE, _ERROR_MESSAGE).

  • Re-upload the corrected file.

The system skips rows that were already successful.

Last updated

Was this helpful?