PostGIS integration for geospatial data management, map visualization, and spatial querying. Adds geo field types (point, line, polygon) to any model, renders interactive maps with configurable layers, and enables location-based searches. Extends spp.area with coordinate and polygon fields.
- Define geo fields (
geo_point,geo_line,geo_polygon) on any model using PostGIS spatial types - Visualize records on interactive maps via the GIS view type
- Configure background raster layers (OpenStreetMap, WMS, satellite imagery); map widgets fall back to OpenStreetMap styling when no MapTiler API key is configured
- Configure data layers with basic or choropleth (color-by-value) rendering
- Perform spatial queries (intersects, contains, within, distance-based) via
gis_locational_query(), including complex geometries (MultiPolygon,GeometryCollection) with distance buffering - Save geographic areas of interest as geofences, classify them with tags, and export them as GeoJSON features
- Import area boundaries from GeoJSON/shapefiles via area import wizard
- Manage color schemes for thematic mapping with sequential, diverging, or qualitative palettes
| Model | Description |
|---|---|
spp.gis.raster.layer |
Background map layers (OSM, WMS, image) |
spp.gis.geofence |
Saved geographic areas of interest (GeoJSON in/out) |
spp.gis.geofence.tag |
Tags for classifying geofences |
spp.gis.data.layer |
Vector data layers referencing geo fields from any model |
spp.gis.color.scheme |
Color palettes for choropleth and thematic visualizations |
spp.gis.raster.layer.type |
Raster layer type definitions (WMS services) |
After installing:
- PostGIS extension is initialized automatically via pre-init hook
- Add geo fields to models via Settings > Technical > Database Structure > Fields
- Create GIS views via Settings > Technical > User Interface > Views with type "GIS"
- Configure map layers on GIS views by adding raster (background) and data (vector) layers
- GIS View: Available as a view mode on models with geo fields (e.g.,
spp.area) - Area Form: "Coordinates" and "Polygon" tabs appear when editing areas (Social Protection > Configuration > Areas)
- No standalone menu: This module does not define menu items; GIS functionality is accessed through existing models
| Group | Access |
|---|---|
spp_security.group_spp_admin |
Full CRUD on all GIS models |
spp_registry.group_registry_read |
Read-only on color schemes and layers |
spp_gis.group_gis_user |
View GIS data and maps |
spp_gis.group_gis_admin |
Full GIS management including configuration |
- Inherit
baseand callgis_locational_query(longitude, latitude, layer_type, spatial_relation)for location-based searches - Override
_get_choropleth_config()onspp.gis.data.layerto customize thematic mapping logic - Inherit any model and add
geo_point,geo_line, orgeo_polygonfields to enable spatial storage - Create GIS views by setting
type="gis"inir.ui.viewXML and linkingspp.gis.data.layerrecords
base, web, contacts, spp_security, spp_area
External Python libraries: shapely, pyproj, geojson