diff --git a/app/deployment/new-deployment/page.mdx b/app/deployment/01-new-country/page.mdx similarity index 53% rename from app/deployment/new-deployment/page.mdx rename to app/deployment/01-new-country/page.mdx index 07d1a57..69d4108 100644 --- a/app/deployment/new-deployment/page.mdx +++ b/app/deployment/01-new-country/page.mdx @@ -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; ``` +### 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 + + ### Data updates Finally provide mappings in the hardcoded app data mappings diff --git a/app/deployment/map-tiles/admin-4-layer.png b/app/deployment/02-map-geo-data--legacy/admin-4-layer.png similarity index 100% rename from app/deployment/map-tiles/admin-4-layer.png rename to app/deployment/02-map-geo-data--legacy/admin-4-layer.png diff --git a/app/deployment/map-tiles/admin-4-query.png b/app/deployment/02-map-geo-data--legacy/admin-4-query.png similarity index 100% rename from app/deployment/map-tiles/admin-4-query.png rename to app/deployment/02-map-geo-data--legacy/admin-4-query.png diff --git a/app/deployment/map-tiles/admin-boundaries.png b/app/deployment/02-map-geo-data--legacy/admin-boundaries.png similarity index 100% rename from app/deployment/map-tiles/admin-boundaries.png rename to app/deployment/02-map-geo-data--legacy/admin-boundaries.png diff --git a/app/deployment/map-tiles/export-geojson.png b/app/deployment/02-map-geo-data--legacy/export-geojson.png similarity index 100% rename from app/deployment/map-tiles/export-geojson.png rename to app/deployment/02-map-geo-data--legacy/export-geojson.png diff --git a/app/deployment/map-tiles/osm-baselayer.png b/app/deployment/02-map-geo-data--legacy/osm-baselayer.png similarity index 100% rename from app/deployment/map-tiles/osm-baselayer.png rename to app/deployment/02-map-geo-data--legacy/osm-baselayer.png diff --git a/app/deployment/map-tiles/page.mdx b/app/deployment/02-map-geo-data--legacy/page.mdx similarity index 93% rename from app/deployment/map-tiles/page.mdx rename to app/deployment/02-map-geo-data--legacy/page.mdx index 59e6a82..2df869a 100644 --- a/app/deployment/map-tiles/page.mdx +++ b/app/deployment/02-map-geo-data--legacy/page.mdx @@ -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) @@ -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** @@ -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 diff --git a/app/deployment/02-map-geo-data/page.mdx b/app/deployment/02-map-geo-data/page.mdx new file mode 100644 index 0000000..d61f65c --- /dev/null +++ b/app/deployment/02-map-geo-data/page.mdx @@ -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) \ No newline at end of file diff --git a/app/deployment/_meta.ts b/app/deployment/_meta.ts index 1c8d1e0..c0c4e05 100644 --- a/app/deployment/_meta.ts +++ b/app/deployment/_meta.ts @@ -1,4 +1,5 @@ export 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)" };