English | 简体中文
A visual browser for scene boundary data — POIs, residential communities and other geographic areas. Built on Flask + Shapely + Tianditu (天地图), it filters, queries and renders vector boundaries across multiple provinces and mobile network operators.
This repository is the open-source edition of the internal VisualArea tool. The internal account system and database credentials have been stripped out. With no database configured it automatically starts in offline mode, using bundled administrative-boundary data, so the full UI can be demonstrated without any setup.
- Boundary visualization — Tianditu basemap with vector boundary overlay
- Multi-level filtering — province → city → district → scene type → scene name / ID
- Multi-operator — China Mobile (
dw_area_mobile), China Unicom (dw_area_unicom), China Telecom (dw_area_telecom) and system (dw_area_system) tables - Flexible queries — single-condition and multi-scene batch queries, WKT boundary parsing
- File upload — parse and display uploaded boundary files (CSV / SHP)
- Responsive UI — usable from both desktop and mobile browsers
- Offline mode — runs on bundled static data with no database, for full UI demos
# Install dependencies
pip install flask pandas shapely psycopg2-binary
# Start (offline mode, no configuration needed)
DISABLE_AUTH=1 python scene_viewer_lite.py --web --port 5000Then open http://localhost:5000.
Create db_config.json (see db_config.example.json):
[
{
"host": "db-host",
"port": 5432,
"user": "user",
"password": "password",
"databases": ["hubei", "fujian"]
}
]The environment variable DB_CONFIG_JSON and the user-level path
~/.scene_viewer/db_config.json are also supported.
| Operator | Table | Notes |
|---|---|---|
| China Mobile | dw_area_mobile |
Scene boundaries; boundaries encoded as lng_lat;lng_lat |
| China Unicom | dw_area_unicom |
Same |
| China Telecom | dw_area_telecom |
Same |
| System | dw_area_system |
System scene table |
Two conventions matter when supplying your own data:
boundariesuses a customlng_lat;lng_lat;string encoding rather than standard WKT.- The schema stores one boundary per row — MultiPolygon is not supported, so a scene with several disjoint boundaries must be stored as several rows.
├── scene_viewer_lite.py # Main program (single-file Flask app)
├── provinces_cities.json # Province / city list cache
├── provinces_area_types.json # Scene type list cache
├── provinces_zones.json # District list cache
├── provinces_type_counts.json # Scene type statistics cache
├── provinces_admin_areas.json # Administrative boundary data
├── db_config.example.json # Example database configuration
└── LICENSE # MIT
- Python 3 + Flask (web server)
- Shapely (WKT geometry parsing)
- psycopg2 (PostgreSQL connectivity)
- Tianditu WebGIS (basemap tiles)
- pywebview (optional desktop build)
MIT © Retter Wang