Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,33 +1,55 @@
# Create Deployment
import { Callout } from 'nextra/components'

# Add Country

## Database updates

### Country code
Register [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) for the country within the database schema.
Add reference to `geo.countries` table using the [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) for country code.

E.g., if adding the country "Zimbabwe", should use code `zw`
E.g., if adding the country "Zimbabwe", should use code `ZW`. Use the `local_name` column to add non-english name variant if popular

```sql
ALTER TYPE country_code ADD VALUE 'zw';
INSERT INTO geo.countries (code, name, local_name)
VALUES ('ZW', 'Zimbabwe', null);
```

Once the country has been added register available languages, e.g.


### Languages
Additionally register any language codes using the [ISO 639 Set 1 standard](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)
Once the country has been added register any language codes using the [ISO 639 Set 1 standard](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)

Include an `en` variant for localised updates to English language variables, e.g. adding `shona` and `ndebele` languages

Update database
```sql
ALTER TYPE locale_code ADD VALUE 'zw_en';
ALTER TYPE locale_code ADD VALUE 'zw_sn';
ALTER TYPE locale_code ADD VALUE 'zw_nd';
INSERT INTO geo.locales (language_code, name, local_name, country_code)
VALUES
-- Zimbabwe
('en', 'English', NULL, 'ZW'),
('sn', 'Shona', 'ChiShona', 'ZW'),
('nd', 'Ndebele', 'isiNdebele', 'ZW'),
```

Additionally update the `public.translations` table to include the columns

```sql
ALTER table public.translations ADD en-ZW text;
ALTER table public.translations ADD sn-ZW text;
ALTER table public.translations ADD nd-ZW text;
Comment on lines +37 to +39
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The SQL statements for adding columns to public.translations are invalid. Column names containing hyphens, like en-ZW, must be enclosed in double quotes in PostgreSQL to be valid identifiers. Without quoting, these ALTER TABLE commands will fail.

ALTER table public.translations ADD "en-ZW" text;
ALTER table public.translations ADD "sn-ZW" text;
ALTER table public.translations ADD "nd-ZW" text;

```

### Export Definitions

When all database updates are complete export the new type-definitions via
```bash
yarn nx run picsa-server:gen-types
```

---
## TODO - Review and tidy
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This 'TODO' heading appears to be a development note and should be removed from the final documentation to keep it clean and professional.



### Data updates
Finally provide mappings in the hardcoded app data mappings

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Map Tiles
## Map Geo Data (Manual/Legacy)

When generating a new deployment hardcoded map tiles should be exported so that they are immediately available to new app users
All data is generated from [OpenStreetMap](https://www.openstreetmap.org/), using the [OverpassTurbo Api](https://overpass-turbo.eu/index.html)
Expand Down Expand Up @@ -72,20 +72,6 @@ https://mygeodata.cloud/converter/geojson-to-topojson

Larger files may first need to be optimised locally first (e.g. removing metadata fields), or converted via local scripts

----

# Future TODOs

It should be possible to integrate a single serverless function into the dashboard to handle all processing.

It can call the overpassApi directly and use mapshaper to convert geojson to topojson

---

# Legacy Docs

{/* To Migrate */}

### Admin 5 data

**Admin_5 - District/Province Boundaries**
Expand Down Expand Up @@ -130,8 +116,6 @@ Convert WSEN -> SWNE coordinates
South West North East




### Optimise
Use the scripts in this workspace to convert geoJson to boundaries to retain only minimal information required for use in the app

Expand Down
11 changes: 11 additions & 0 deletions app/deployment/02-map-geo-data/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Map Data

A combination of map tile base images and topojson data are used within the app to show map geographic areas and administrative boundaries.

A standalone repository has been setup for managing these processes, and integrated into the dashboard
https://github.com/e-picsa/geo-boundaries-topojson

## Dashboard Management
Dashboard users with `app.admin` privileges can access the Geo administration pages and interact with the function via dashboard Api

(TODO - examples)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This 'TODO' placeholder should be removed or replaced with actual examples before merging. Leaving such notes in the final documentation can be confusing for users.

5 changes: 3 additions & 2 deletions app/deployment/_meta.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {

Check warning on line 1 in app/deployment/_meta.ts

View workflow job for this annotation

GitHub Actions / build

Assign object to a variable before exporting as module default
"new-deployment":"Add New Deployment",
"map-tiles":"Map Tiles"
"01-new-country":"Add New Country",
"02-map-geo-data":"Map Data",
"02-map-geo-data--legacy":"Map Data (legacy)"
};
Loading