Skip to content

Commit

Permalink
fix staging path for zone data
Browse files Browse the repository at this point in the history
  • Loading branch information
billyc committed Apr 11, 2024
1 parent f67380e commit 222c134
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 3 additions & 4 deletions public/zones/zones.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
# Only GeoJSON files are supported. Shapefiles are too slow and often have coordinate problems.
# Use GeoJSON and pre-convert all coordinates to long/lat (WGS84 or EPSG:4326)
#
# URLs can be
# URLs can be
# - `/zones/filename.geojson` if you place the file in the /zones folder of the SimWrapper build
# - full HTTP urls if the remote server allows external access

# 'sizes' helps SimWrapper guess which zone systems are appropriate for which matrix sizes.

SF-2454:
url: /staging/zones/dist15.geojson.gz
url: /zones/dist15.geojson.gz
lookup: TAZ
sizes: 981,2454,2475,3717

MTC-1454:
url: /staging/zones/mtc1454.geojson.gz
url: /zones/mtc1454.geojson.gz
lookup: TAZ1454
sizes: 1454,1475

5 changes: 4 additions & 1 deletion src/plugins/matrix/H5MapViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ import ZoneLayer from './ZoneLayer'
import { MapConfig, ZoneSystems } from './MatrixViewer.vue'
import dataScalers from './util'
const BASE_URL = import.meta.env.BASE_URL
naturalSort.insensitive = true
const PLUGINS_PATH = '/plugins' // path to plugins on EMScripten virtual file system
Expand Down Expand Up @@ -449,7 +451,8 @@ const MyComponent = defineComponent({
boundaries = await this.loadShapefileFeatures(shapeConfig)
} else if (shapeConfig.startsWith('/')) {
// hard-coded shapefile from /public folder, special treatment
console.log('LOADING LOCAL geojson:', shapeConfig)
const localPath = BASE_URL + url.substring(1) // no double-slash at beginning
console.log('LOADING LOCAL geojson:', localPath)
const blob = await fetch(shapeConfig).then(async r => await r.blob())
const buffer = await blob.arrayBuffer()
const rawtext = gUnzip(buffer)
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/matrix/MatrixViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ const MyComponent = defineComponent({
async setupAvailableZoneSystems() {
try {
const url = BASE_URL + '/zones/zones.yaml'
const url = BASE_URL + 'zones/zones.yaml'
const config = await (await fetch(url)).text()
const zoneSystemConfigs = YAML.parse(config)
Expand Down

0 comments on commit 222c134

Please sign in to comment.