diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 23ce0c7..ca18fa3 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -77,11 +77,13 @@ SELECT ( [${layer1} [|| ${layer2} [|| ...]] ) as data - ~~Move database to [Serverless Aurora PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.how-it-works.html) to reduce monthly costs.~~ Won't do. Resume after pause is 30s+ and keeping 2 ACUs hot at all times is too expensive. - ~~Evaluate [Data API for Aurora Serverless](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html).~~ Won't do. See above. According to [this review](https://www.jeremydaly.com/aurora-serverless-data-api-a-first-look/), performance also seems bad compared to API-calls. +- move terraform-state to s3-bucket. - Security-Review for Lambda-Code (e.g. SQL-Injection, ...) - Change all scripts to use Postgres environment variables (PGUSER, ...) - Omit Postgres credentials altogether and use IAM-role instead - move lambda-function out of VPC to reduce cold-start-time - Add raster endpoint with node-mapbox-gl-native to serve pre-rendered raster-images. +- Check how blue-green deployments could be realized with API Gateway and Lambda. ## References diff --git a/README.md b/README.md index cf625ad..dc35e0a 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ Serve mapbox vectortiles via AWS stack. -**THIS README IS WORK-IN-PROGRESS** - ## Goals These are the main project goals: @@ -33,6 +31,8 @@ Checked items are already fulfilled. ![](docs/img/CloudFront-tiles-simple.png) +A more detailled description can be found in [DEVELOPMENT.md](DEVELOPMENT.md) + ## Screenshots, Live Demo The Live-Demo is available at: [cyclemap.link](https://cyclemap.link) @@ -73,7 +73,3 @@ extend | `number` | tile extent in pixels (see [ST_AsMVTGeom](https://postgis.ne buffer | `number` | buffer in pixels around each tile (see [ST_AsMVTGeom](https://postgis.net/docs/manual-dev/ST_AsMVTGeom.html)) | `256` clip_geom | `boolean` | clip geometries that lie outside the current tile incl. buffer (see [ST_AsMVTGeom](https://postgis.net/docs/manual-dev/ST_AsMVTGeom.html)) | `true` - -## Software Design, Implementation Details - -A more detailled description can be found in [DEVELOPMENT.md](DEVELOPMENT.md) \ No newline at end of file diff --git a/TUTORIAL.md b/TUTORIAL.md deleted file mode 100644 index 5867e10..0000000 --- a/TUTORIAL.md +++ /dev/null @@ -1,21 +0,0 @@ -# Tutorial - -This tutorial will explain step-by-step, how to set-up the tileserver and all dependencies. Some day... - -## Prerequisites - -To set up the whole environment you will need: - -- Account with [Amazon Web Services (AWS) - Cloud Computing Services](https://aws.amazon.com). Make sure you set up [Multi-Factor Authentication](https://aws.amazon.com/iam/details/mfa/) to ensure account security! -- [Node.jsĀ® JavaScript runtime](https://nodejs.org/en/) installed on your local machine. -- [AWS Command Line Interface](https://aws.amazon.com/cli/) installed on your local machine. -- [Terraform](https://learn.hashicorp.com/terraform/getting-started/install.html) installed on your local machine. -- A database with imported and preprocessed openstreetmap-data that is accessible from your AWS account. It could be a RDS-Instance in AWS or something totally different with another provider. - -## Initial Setup - -### AWS Credentials - -- go to IAM and create a new user -- create an access key for that user -- run `aws configure` and enter the access keys incl. secret key as prompted. diff --git a/docs/stack.odg b/docs/stack.odg index a3b0f29..1569326 100644 Binary files a/docs/stack.odg and b/docs/stack.odg differ diff --git a/html/index.html b/html/index.html index f5610da..9972253 100644 --- a/html/index.html +++ b/html/index.html @@ -152,6 +152,9 @@ }) ); + // disable map rotation using touch rotation gesture + map.touchZoomRotate.disableRotation(); + // Debug output map.showTileBoundaries = true; // map.showCollisionBoxes = true; diff --git a/src/sources.json b/src/sources.json index 6ec2121..85601a4 100644 --- a/src/sources.json +++ b/src/sources.json @@ -5,10 +5,26 @@ "database": "shapes", "layers": [ { - "minzoom": 7, + "minzoom": 3, "name": "water", - "table": "public.simplified_water_polygons", + "table": "public.water_gen3", "variants": [ + { + "minzoom": 4, + "table": "public.water_gen4" + }, + { + "minzoom": 5, + "table": "public.water_gen5" + }, + { + "minzoom": 6, + "table": "public.water_gen6" + }, + { + "minzoom": 7, + "table": "public.simplified_water_polygons" + }, { "minzoom": 8, "table": "public.water_polygons" @@ -26,7 +42,7 @@ "variants": [ { "minzoom": 4, - "table": "public.bathymetry_gen3" + "table": "public.bathymetry_gen4" }, { "minzoom": 5, diff --git a/src/sources.toml b/src/sources.toml index 745a978..8d602b0 100644 --- a/src/sources.toml +++ b/src/sources.toml @@ -3,9 +3,21 @@ database = "shapes" [[sources.layers]] - minzoom = 7 + minzoom = 3 name = "water" - table = "public.simplified_water_polygons" + table = "public.water_gen3" + [[sources.layers.variants]] + minzoom = 4 + table = "public.water_gen4" + [[sources.layers.variants]] + minzoom = 5 + table = "public.water_gen5" + [[sources.layers.variants]] + minzoom = 6 + table = "public.water_gen6" + [[sources.layers.variants]] + minzoom = 7 + table = "public.simplified_water_polygons" [[sources.layers.variants]] minzoom = 8 table = "public.water_polygons" @@ -18,7 +30,7 @@ postfix = "ORDER BY depth" [[sources.layers.variants]] minzoom = 4 - table = "public.bathymetry_gen3" + table = "public.bathymetry_gen4" [[sources.layers.variants]] minzoom = 5 table = "public.bathymetry" diff --git a/tsconfig.json b/tsconfig.json index 5a4f010..a34a922 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -58,7 +58,7 @@ /* Experimental Options */ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - "resolveJsonModule": true, + "resolveJsonModule": true }, "include": [ "src/**/*.ts"