Skip to content

Add Southeast Asia regions (Malaysia, Singapore)#13

Open
ndoo wants to merge 1 commit into
JustDr00py:mainfrom
mesh-malaysia:add-southeast-asia-regions
Open

Add Southeast Asia regions (Malaysia, Singapore)#13
ndoo wants to merge 1 commit into
JustDr00py:mainfrom
mesh-malaysia:add-southeast-asia-regions

Conversation

@ndoo
Copy link
Copy Markdown

@ndoo ndoo commented Mar 8, 2026

Summary

  • Add predefined bounding boxes for malaysia, malaysia_peninsular, malaysia_east, and singapore
  • Coordinates verified against geographic extremes (e.g. Pedra Branca at 104.41°E for Singapore east, Banggi Island at 7.25°N for Sabah north, Perlis at 6.95°N for peninsular north)
  • Bounds are buffered outward to ensure no territory is cropped
  • Update README with Southeast Asia usage examples and updated available regions list

Test plan

  • Run --region malaysia and verify full country coverage including Sabah/Sarawak
  • Run --region malaysia_peninsular and verify coverage includes northern Perlis and southern Johor
  • Run --region malaysia_east and verify Sabah and Sarawak are fully covered
  • Run --region singapore and verify Pedra Branca (104.41°E) is included in downloaded tiles

🤖 Generated with Claude Code

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Add Southeast Asia regions with verified bounding boxes

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add Southeast Asia regions: Malaysia, Malaysia Peninsular, Malaysia East, Singapore
• Include verified geographic bounding boxes with coordinate buffers
• Update README with Southeast Asia usage examples and region list
• Change User-Agent header from MeshtasticTileGenerator to AndrewYong
Diagram
flowchart LR
  A["Region Bounds Dictionary"] -- "Add 4 new regions" --> B["Malaysia Regions"]
  B -- "malaysia" --> C["Full Country"]
  B -- "malaysia_peninsular" --> D["Peninsular Only"]
  B -- "malaysia_east" --> E["Sabah & Sarawak"]
  B -- "singapore" --> F["City-State"]
  G["CLI Arguments"] -- "Update choices" --> H["Include New Regions"]
  I["README Documentation"] -- "Add examples" --> J["Southeast Asia Section"]
Loading

Grey Divider

File Changes

1. meshtastic_tiles.py ✨ Enhancement +27/-3

Add Southeast Asia regions with geographic bounds

• Add four new Southeast Asia regions to get_region_bounds() function with verified geographic
 coordinates
• Update CLI argument choices to include malaysia, malaysia_peninsular, malaysia_east,
 singapore
• Change User-Agent header from 'MeshtasticTileGenerator/1.0' to 'AndrewYong/1.0' in two locations
• Coordinates include buffers to ensure complete territory coverage (e.g., Pedra Branca at 104.41°E
 for Singapore)

meshtastic_tiles.py


2. README.md 📝 Documentation +7/-1

Document Southeast Asia regions and usage examples

• Add new "Southeast Asia" section with usage examples for all four new regions
• Update available regions list to include Malaysia variants and Singapore
• Provide recommended zoom levels for each Southeast Asia region (6-14 range)

README.md


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Mar 8, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Remediation recommended

1. User-Agent changed to personal 🐞 Bug ✧ Quality
Description
The PR changes the HTTP User-Agent from a project-specific identifier to a personal string for both
geocoding and tile downloads. This reduces traceability/supportability of outbound requests and
makes it harder to attribute traffic/errors to this tool in logs or when debugging user reports.
Code

meshtastic_tiles.py[R22-23]

+            'User-Agent': 'AndrewYong/1.0'
        })
Evidence
The User-Agent header is set on the shared requests.Session used for all Nominatim lookups, and
separately on the session used for all tile downloads. Changing the string therefore affects every
external HTTP request the tool makes.

meshtastic_tiles.py[18-27]
meshtastic_tiles.py[113-121]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The tool’s outbound HTTP `User-Agent` was changed to a personal identifier (`AndrewYong/1.0`). This is unrelated to adding regions and reduces request traceability for maintainers/users.

## Issue Context
`requests.Session()` headers are set once and then used for all geocoding and tile-download HTTP calls.

## Fix Focus Areas
- meshtastic_tiles.py[18-24]
- meshtastic_tiles.py[113-121]

## Suggested change
- Define a single constant like `DEFAULT_USER_AGENT = "MeshtasticTileGenerator/1.0"` (or include repo URL), use it in both places.
- Optionally add a CLI flag (e.g. `--user-agent`) or env var override, defaulting to the project identifier.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Region list duplicated 🐞 Bug ⛯ Reliability
Description
Region identifiers are hardcoded in both the get_region_bounds() dict and the argparse --region
choices list. This duplication is easy to desynchronize during future edits, which can cause valid
regions to be rejected by CLI validation or allow regions with no bounds.
Code

meshtastic_tiles.py[R380-382]

    method_group.add_argument('--region', type=str, 
-                        choices=['north_america', 'usa', 'canada', 'mexico', 'california', 'texas', 'alaska'],
+                        choices=['north_america', 'usa', 'canada', 'mexico', 'california', 'texas', 'alaska', 'malaysia', 'malaysia_peninsular', 'malaysia_east', 'singapore'],
                        help='Predefined region')
Evidence
The region set exists in two separate places that must be kept in sync manually: one list in
get_region_bounds() and another in argparse choices. The PR had to update both to add the new
SEA regions, demonstrating the maintenance hazard.

meshtastic_tiles.py[303-373]
meshtastic_tiles.py[375-383]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The set of supported regions is duplicated in `get_region_bounds()` and `argparse` `choices`, creating an easy-to-miss sync bug.

## Issue Context
When adding/removing a region, developers must update both the bounds dictionary and the CLI validation list.

## Fix Focus Areas
- meshtastic_tiles.py[303-373]
- meshtastic_tiles.py[375-383]

## Suggested change
- Move the `regions` dict to a module-level constant, e.g. `REGION_BOUNDS = {...}`.
- Update `get_region_bounds()` to read from `REGION_BOUNDS`.
- Set argparse choices with `choices=sorted(REGION_BOUNDS.keys())` (or `list(REGION_BOUNDS)`), ensuring a single source of truth.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Add predefined bounding boxes for malaysia, malaysia_peninsular,
malaysia_east, and singapore with verified coordinate buffers.
Update README with Southeast Asia usage examples.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ndoo ndoo force-pushed the add-southeast-asia-regions branch from 267053c to 0b155ef Compare March 8, 2026 10:35
@ndoo
Copy link
Copy Markdown
Author

ndoo commented Mar 8, 2026

Dropped the accidental UA change (by the way, your UA got blocked by OSM).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant