System Architecture

Django Apps

  • apps.core: home, shared map config, root templates
  • apps.authentication: auth/profile/role support
  • apps.parcels: parcel domain model, views, APIs, upload/export, analytics

Frontend Module Layout (Parcels)

  • static/parcels/js/map/*: map init/data/render/controls/selection
  • static/parcels/js/map/raster-layers.js: basemap + DEM/landcover panel controls and overlay layering
  • static/parcels/js/analytics/*: statistics dashboard behavior
  • static/parcels/js/shared/*: selection store, form lock, style settings, icons, side panels

Selection Architecture

  • Single tab-scoped selection store (sessionStorage)
  • Shared by map and list/search workflows
  • Emits change events to synchronize UI components

Map Data Architecture

  • parcel_geojson_view handles viewport requests
  • Uses services.get_viewport_map_data(...)
  • At low zoom/high density: returns centroid-grid summaries
  • At high zoom/lower density: returns individual parcel geometries

Spatial Computation Strategy

Preference is PostGIS-native operations where available:

  • selection predicates (intersects, within, centroid-in-shape)
  • area calculations (ST_Area, transformed CRS)
  • centroid bucketing and grid summaries

Fallback Python paths exist for non-PostGIS local contexts.