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
4 changes: 2 additions & 2 deletions map180/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Postgres 9.* with Postgis 2.*
## Using the Assembled Data

* Create the tables (and associated indexed) `public.map180_layers` and `public.map180_labels`. See `etc/nz_map180_layer.ddl`
* Load the data e.g., for the fits db: `psql -h 127.0.0.1 fits postgres -f data/new_zealand_map_layers.ddl`
* Load the data e.g.: `psql -h 127.0.0.1 example_db postgres -f data/new_zealand_map_layers.ddl`

If necessary change the schema, table, and user access as required. They can be specificed in map180.Init()

Expand All @@ -37,7 +37,7 @@ was made from shape files that where loaded into the DB and then cut and transfo
The files `etc/load-nz-shp.sh` and `etc/nz_map180_layer.ddl` document the process of creating `public.map180_layers`. This was then dumped using:

```
pg_dump -h 127.0.0.1 --table=public.map180_layers --table=public.map180_labels --data-only -U postgres fits -f data/new_zealand_map_layers.ddl
pg_dump -h 127.0.0.1 --table=public.map180_layers --table=public.map180_labels --data-only -U postgres example_db -f data/new_zealand_map_layers.ddl
```

The assembled New Zealand data set uses data sourced from:
Expand Down
32 changes: 16 additions & 16 deletions map180/etc/load-nz-shp.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#!/bin/sh

# adjust the database being connected to as you require. This uses 'fits'.
# adjust the database being connected to as you require. This uses 'example_db'.

shp2pgsql -d -s 4326 -I /work/shp/ne_50m_land.shp public.ne50land | psql -h localhost fits postgres
shp2pgsql -d -W "LATIN1" -s 4326 -I /work/shp/ne_50m_lakes.shp public.ne50lakes | psql -h localhost fits postgres
shp2pgsql -d -s 4326 -I /work/shp/ne_10m_minor_islands.shp public.ne10minorislands | psql -h localhost fits postgres
shp2pgsql -d -s 4326 -I /work/shp/ne_10m_land.shp public.ne10land | psql -h localhost fits postgres
shp2pgsql -d -W "LATIN1" -s 4326 -I /work/shp/ne_10m_lakes.shp public.ne10lakes | psql -h localhost fits postgres
shp2pgsql -d -s 4326 -I /work/shp/ne_50m_land.shp public.ne50land | psql -h localhost example_db postgres
shp2pgsql -d -W "LATIN1" -s 4326 -I /work/shp/ne_50m_lakes.shp public.ne50lakes | psql -h localhost example_db postgres
shp2pgsql -d -s 4326 -I /work/shp/ne_10m_minor_islands.shp public.ne10minorislands | psql -h localhost example_db postgres
shp2pgsql -d -s 4326 -I /work/shp/ne_10m_land.shp public.ne10land | psql -h localhost example_db postgres
shp2pgsql -d -W "LATIN1" -s 4326 -I /work/shp/ne_10m_lakes.shp public.ne10lakes | psql -h localhost example_db postgres

shp2pgsql -d -s 4326 -I /work/shp/nz-chatham-is-island-polygons-topo-1250k.shp public.nztopo_1250k_chathams_land | psql -h localhost fits postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-chatham-is-lagoon-polygons-topo-1250k.shp public.nztopo_1250k_chathams_lagoon | psql -h localhost fits postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-coastlines-and-islands-polygons-topo-1500k.shp public.nztopo_1500k_land | psql -h localhost fits postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-coastlines-and-islands-polygons-topo-150k.shp public.nztopo_150k_land | psql -h localhost fits postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-lake-polygons-topo-1500k.shp public.nztopo_1500k_lakes | psql -h localhost fits postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-mainland-lake-polygons-topo-150k.shp public.nztopo_150k_lakes| psql -h localhost fits postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-chatham-is-island-polygons-topo-1250k.shp public.nztopo_1250k_chathams_land | psql -h localhost example_db postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-chatham-is-lagoon-polygons-topo-1250k.shp public.nztopo_1250k_chathams_lagoon | psql -h localhost example_db postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-coastlines-and-islands-polygons-topo-1500k.shp public.nztopo_1500k_land | psql -h localhost example_db postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-coastlines-and-islands-polygons-topo-150k.shp public.nztopo_150k_land | psql -h localhost example_db postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-lake-polygons-topo-1500k.shp public.nztopo_1500k_lakes | psql -h localhost example_db postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-mainland-lake-polygons-topo-150k.shp public.nztopo_150k_lakes| psql -h localhost example_db postgres

shp2pgsql -d -s 4326 -I /work/shp/nz-kermadec-is-lake-polygons-topo-125k/nz-kermadec-is-lake-polygons-topo-125k.shp public.nztopo_125k_kermadec_lakes | psql -h localhost fits postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-kermadec-is-lake-polygons-topo-125k/nz-kermadec-is-lake-polygons-topo-125k.shp public.nztopo_125k_kermadec_lakes | psql -h localhost example_db postgres

shp2pgsql -d -s 4326 -I /work/shp/nz-geographic-names-topo-1500k.shp public.nztopo_1500k_names | psql -h localhost fits postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-chatham-is-geographic-names-topo-1250k.shp public.nztopo_1250k_chatham_names | psql -h localhost fits postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-kermadec-is-geographic-names-topo-125k/nz-kermadec-is-geographic-names-topo-125k.shp public.nztopo_125k_kermadec_names | psql -h localhost fits postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-geographic-names-topo-1500k.shp public.nztopo_1500k_names | psql -h localhost example_db postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-chatham-is-geographic-names-topo-1250k.shp public.nztopo_1250k_chatham_names | psql -h localhost example_db postgres
shp2pgsql -d -s 4326 -I /work/shp/nz-kermadec-is-geographic-names-topo-125k/nz-kermadec-is-geographic-names-topo-125k.shp public.nztopo_125k_kermadec_names | psql -h localhost example_db postgres
14 changes: 7 additions & 7 deletions weft/assets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ func TestLoadAssets(t *testing.T) {
},
{
"Load JS file",
"testdata/gnss-map-plot.js",
"testdata/test.js",
&asset{
path: "/gnss-map-plot.js",
hashedPath: "/e83a0b0f-gnss-map-plot.js",
path: "/test.js",
hashedPath: "/7ae97332-test.js",
mime: "text/javascript",
fileType: "js",
sri: "sha384-haxRijtRHhpn6nbt+JNpioqOj0AwB+THIaVdUZ34R9sQrQL2vmf/pn6GPnQq+AI1",
sri: "sha384-QpJfAj2w6B/9M/RPFCW5SdxSs8wf4DRuer8K06bMu8cqj0Cu91WZYh4spHDPmKO/",
},
8513,
56,
},
{
"Load MJS file",
Expand Down Expand Up @@ -107,8 +107,8 @@ func TestCreateSubResourceTag(t *testing.T) {
},
{"abcdefgh",
"async",
"testdata/gnss-map-plot.js",
`<script src="/e83a0b0f-gnss-map-plot.js" type="text/javascript" integrity="sha384-haxRijtRHhpn6nbt+JNpioqOj0AwB+THIaVdUZ34R9sQrQL2vmf/pn6GPnQq+AI1" nonce="abcdefgh" async></script>`,
"testdata/test.js",
`<script src="/7ae97332-test.js" type="text/javascript" integrity="sha384-QpJfAj2w6B/9M/RPFCW5SdxSs8wf4DRuer8K06bMu8cqj0Cu91WZYh4spHDPmKO/" nonce="abcdefgh" async></script>`,
},
{"ijklmnop",
"defer",
Expand Down
234 changes: 0 additions & 234 deletions weft/testdata/gnss-map-plot.js

This file was deleted.

3 changes: 3 additions & 0 deletions weft/testdata/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function helloWorld() {
console.log("hello world")
}
Loading