Welcome to Infrastructure Mapper! This repository contains guidelines and conventions for a spatial database intended to be used managing infrastructure-related data.
This project consists of:
- a SQL Schema for PostgreSQL,
- a set of fixtures to load that schema with default values (particularly for lookup tables)
- a set of QGIS forms and layer styles for visualising the data
This project is licensed under the MIT License. See the LICENSE file for details.
InfrastructureMapper/
βββ img/ # Images and media resources used in this documentation
βββ qml/ # QGIS layer style and form definitions
βββ diagrams/ # Documentation and ERD diagrams
βββ presentations/ # Presentations for this project and each model created using Marp
βββ sql/ # Schema and fixtures to load into postgres
βββ scripts/ # Helper scripts
βββ README.md # Project overview and conventions
We are fine with using LLM's and Generative Machine Learning to act as general assistants, but the following three guidelines should be followed:
- Repeatability: Although we understand that repeatability is not possible generally, whenever you are verbatim using LLM or Generative Machine Learning outputs in this project, you must also provide the prompt that you used to generate the resource.
- Declaration: Sharing the prompt above is implicit declaration that a machine learning assistant was used. If it is not obvious that a piece of work was generated, include the robot (π€) icon next to a code snippet or text snippet.
- Validation: Outputs generated by a virtual assistant should always be validated by a human and you, as contributor, take ultimate responsibility for the correct functionality of any code and the correct expression in any text or media you submit to this project.
Our design aesthetic is an isometric style with a nature and environment inspired palette. We use an the color palette in the table below. The design approach can be personified by:
- Clean vector isometric projection
- Layered terrain with shadows
- Gentle color blending without gradients
- Minimal outlines for clarity
- Selective use of texture (like grass patterns or water ripples)
You can use the notes above and the table below if you are prompt engineering additional graphics for this project using tools like ChatGPT.
Our colour swatch looks like this:
| Name | Hex | Use Case | Preview |
|---|---|---|---|
| Forest Green | #2F5D50 |
Dominant vegetation tone | #2F5D50 |
| Moss Green | #7C9C75 |
Soft background greenery | #7C9C75 |
| Earth Brown | #A9825A |
Soil, tree bark | #A9825A |
| Sandstone Beige | #E0D2B2 |
Pathways, terrain shading | #E0D2B2 |
| Sky Blue | #A4DDED |
Sky, water elements | #A4DDED |
| Deep Teal | #2B7A78 |
Shadows, water depth | #2B7A78 |
| Leaf Yellow-Green | #C1E1C1 |
Highlights on foliage | #C1E1C1 |
| Rock Gray | #9FA8A3 |
Mountains, stones | #9FA8A3 |
| Cloud White | #F5F5F2 |
Clouds, light accents | #F5F5F2 |
π€ Prompt: Generate me a beautiful circular swatch with these colours. Invent nice unique, human names for each colour:
#7C9C75 #A9825A #E0D2B2 #A4DDED #2B7A78 #C1E1C1 #9FA8A3 #F5F5F2
These colors are soft but grounded, avoiding over-saturation while maintaining a naturalistic feel that suits isometric vector work.
This section describes each component of the infrastructure mapper data model. You can also find a complete diagram of the data model in diagrams/Schema.drawio (image render).
| Icon | Description |
|---|---|
![]() |
Electricity infrastructure such as power lines, transformers, and substations. |
![]() |
General infrastructure elements like bridges, dams, and towers. |
![]() |
Water-related infrastructure including pipes, tanks, and pumps. |
![]() |
Vegetation features such as trees, hedges, and planted areas. |
![]() |
Monitoring devices and their observations (e.g., sensors, cameras). |
![]() |
Buildings and associated structures. |
![]() |
Fencing and enclosure features, including standalone gates. |
![]() |
Points of Interest (POI) for notable locations or features. |
![]() |
Land use areas such as agricultural, residential, or conservation zones. |
![]() |
Gates as access points for properties or enclosures. |
![]() |
Poles for lighting, signage, or utility support. |
![]() |
Culinary facilities like kitchens, canteens, and food storage. |
![]() |
Roads, tracks, and paths for transportation infrastructure. |
Simply take the sql files in the sql folder and load them into postgres.
The scripts/ folder contains utility scripts to assist with database setup, data loading, and project maintenance. Below is a summary of each script:
| Script Name | Description |
|---|---|
start_pg.sh |
Nix specific to start a sandboxed postgresql instance with data stored in ./pgdata |
load_schema.sh |
Loads the SQL schema files into the target database, setting up all required tables. |
stop_pg.sh |
Nix specific script to stop the postgres database |
check.sh |
Git precommit check and format SQL files |
gource.sh |
Visualise the code history using gource |
vscode.sh |
Launch VSCode with all settings and extensions needed to productively work on this project |
create_presentations.sh |
Generate presentations using marp. |
scripts/codebase_size_check.sh |
Precommit hook for checking if the codebase has grown. |
scripts/commit_test_stats.py |
Precommit hook for checking if the test suite has grown. |
scripts/docstrings_check.sh |
Precommit hook for checking that docstrings were used when creating new python code. |
scripts/encoding_check.sh |
Precommit hook for checking python modules have their encoding set. |
scripts/license_check.sh |
Precommit hook for license and copyright in source files. |
βοΈ Note: Run each script from the project root. Some scripts may require environment variables or configurationβsee comments within each script for usage details.
You can use the provided flake.nix to get a fully reproducible development environment and to run QGIS with the correct profile.
- Install Nix (if you havenβt already).
- Enter the development shell:
nix developThis gives you all the tools and dependencies you need for working on this project.
- Run QGIS with the project profile:
nix run .#qgisOr, for the long-term release version:
nix run .#qgis-ltr- VSCode users:
You can launch a ready-to-use VSCode environment:
./scripts/vscode.shThis makes it easy to get started and ensures everyone is using the same environment!
We welcome contributions! Please read the CONTRIBUTING.md for guidelines on how to get started.
Have questions or feedback? Feel free to reach out!
π§ Email: [email protected]
π Website: kartoza.com
- Tim Sutton - project lead
Made with β€οΈ by Tim Sutton (@timlinux) and Kartoza Interns.
















