Skip to content

kartoza/InfrastructureMapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

🌐 Infrastructure Mapper

Logo

Welcome to Infrastructure Mapper! This repository contains guidelines and conventions for a spatial database intended to be used managing infrastructure-related data.


πŸ“– Table of Contents


πŸš€ Project Overview

Animation


QA Status

Test Description
πŸ“ƒ License Checks..... Check all files have license, copyright and attribution.
πŸ‹πŸ½ PostGIS Load Test... Check that PostgreSQL / PostGIS fixtures load.
✏️ Markdown Checks..... Check that all markdown files are well formed.
🐍 Python Checks....... Python code QA checks.
βš’οΈ QA Checks........... General codebase QA checks.
πŸ‘οΈ Spelling Checks..... Check spelling in all files containing text.
πŸ‘¨πŸ½ SQL Checks.......... Check that all SQL files
πŸ—œοΈ Yaml Checks......... Check that all yaml files are well formed.

This project consists of:

  1. a SQL Schema for PostgreSQL,
  2. a set of fixtures to load that schema with default values (particularly for lookup tables)
  3. a set of QGIS forms and layer styles for visualising the data

πŸ“œ License

This project is licensed under the MIT License. See the LICENSE file for details.


πŸ“‚ Folder Structure

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

πŸ€– Using 'AI' (Large Language Models)

We are fine with using LLM's and Generative Machine Learning to act as general assistants, but the following three guidelines should be followed:

  1. 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.
  2. 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.
  3. 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.

🌿 Design Aesthetic

Collage

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:

Electricity

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.


Data Model

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 Electricity infrastructure such as power lines, transformers, and substations.
Infrastructure General infrastructure elements like bridges, dams, and towers.
Water Water-related infrastructure including pipes, tanks, and pumps.
Vegetation Vegetation features such as trees, hedges, and planted areas.
Monitoring Monitoring devices and their observations (e.g., sensors, cameras).
Buildings Buildings and associated structures.
Fencing Fencing and enclosure features, including standalone gates.
POI Points of Interest (POI) for notable locations or features.
Land use Land use areas such as agricultural, residential, or conservation zones.
Gates Gates as access points for properties or enclosures.
Poles Poles for lighting, signage, or utility support.
Culinary Culinary facilities like kitchens, canteens, and food storage.
Roads Roads, tracks, and paths for transportation infrastructure.

βš’οΈ Using

Simply take the sql files in the sql folder and load them into postgres.


πŸ› οΈ Scripts Overview

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.


🧊 Using the Nix Flake

You can use the provided flake.nix to get a fully reproducible development environment and to run QGIS with the correct profile.

  1. Install Nix (if you haven’t already).
  2. Enter the development shell:
nix develop

This gives you all the tools and dependencies you need for working on this project.

  1. Run QGIS with the project profile:
  nix run .#qgis

Or, for the long-term release version:

nix run .#qgis-ltr
  1. VSCode users:

You can launch a ready-to-use VSCode environment:

./scripts/vscode.sh

This makes it easy to get started and ensures everyone is using the same environment!

✨ Contributing

We welcome contributions! Please read the CONTRIBUTING.md for guidelines on how to get started.


πŸ“§ Contact

Have questions or feedback? Feel free to reach out!
πŸ“§ Email: [email protected]
🌐 Website: kartoza.com

Contributors


Made with ❀️ by Tim Sutton (@timlinux) and Kartoza Interns.

About

An Open Source PostgreSQL schema and QGIS project for Infrastructure Mapping

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 12