@golemio/fypr 1.7.2-dev.2602634331 → 1.7.2-dev.2607926676

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ var dbm;
4
+ var type;
5
+ var seed;
6
+ var fs = require('fs');
7
+ var path = require('path');
8
+ var Promise;
9
+
10
+ exports.setup = function(options, seedLink) {
11
+ dbm = options.dbmigrate;
12
+ type = dbm.dataType;
13
+ seed = seedLink;
14
+ Promise = options.Promise;
15
+ };
16
+
17
+ exports.up = function(db) {
18
+ var filePath = path.join(__dirname, 'sqls', '20260616000000-add-mvt-information-panels-with-routes-view-up.sql');
19
+ return new Promise( function( resolve, reject ) {
20
+ fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
21
+ if (err) return reject(err);
22
+ console.log('received data: ' + data);
23
+ resolve(data);
24
+ });
25
+ })
26
+ .then(function(data) {
27
+ return db.runSql(data);
28
+ });
29
+ };
30
+
31
+ exports.down = function(db) {
32
+ var filePath = path.join(__dirname, 'sqls', '20260616000000-add-mvt-information-panels-with-routes-view-down.sql');
33
+ return new Promise( function( resolve, reject ) {
34
+ fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
35
+ if (err) return reject(err);
36
+ console.log('received data: ' + data);
37
+ resolve(data);
38
+ });
39
+ })
40
+ .then(function(data) {
41
+ return db.runSql(data);
42
+ });
43
+ };
44
+
45
+ exports._meta = {
46
+ "version": 1
47
+ };
@@ -0,0 +1,5 @@
1
+ DROP VIEW v_information_panels_for_mvt_with_routes;
2
+
3
+ DROP INDEX idx_information_panels_mvt_geom;
4
+
5
+ ALTER TABLE information_panels DROP COLUMN geometry;
@@ -0,0 +1,30 @@
1
+ -- Generated geometry column on information_panels (computed once at row write)
2
+ ALTER TABLE information_panels
3
+ ADD COLUMN geometry public.geometry(Point, 4326)
4
+ GENERATED ALWAYS AS (public.ST_SetSRID(public.ST_MakePoint(lon, lat), 4326)) STORED;
5
+
6
+ -- Partial GiST index for bbox-driven tile lookups
7
+ CREATE INDEX idx_information_panels_mvt_geom
8
+ ON information_panels USING GIST (geometry)
9
+ WHERE state = 'Hotovo' AND data_source = 'Golemio' AND geometry IS NOT NULL;
10
+
11
+ -- New MVT view enhanced with routes/lines/notes for app-side filterability
12
+ CREATE VIEW v_information_panels_for_mvt_with_routes AS
13
+ SELECT
14
+ ip.id,
15
+ ip.preset,
16
+ ip.geometry,
17
+ concat_ws(' ', ip.name, ip.stop_name, STRING_AGG(p.note, ' ')) AS search_fields,
18
+ JSONB_AGG(JSONB_BUILD_OBJECT(
19
+ 'route_name', p.route_name,
20
+ 'route_type', r.route_type,
21
+ 'route_short_name', r.route_short_name
22
+ )) AS routes
23
+ FROM information_panels ip
24
+ INNER JOIN information_panels_presets p
25
+ ON p.information_panel_document_id = ip.document_id AND NOT p.is_testing
26
+ INNER JOIN information_panels_presets_routes r ON r.preset_id = p.id
27
+ WHERE ip.state = 'Hotovo'
28
+ AND ip.geometry IS NOT NULL
29
+ AND ip.data_source = 'Golemio'
30
+ GROUP BY ip.id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/fypr",
3
- "version": "1.7.2-dev.2602634331",
3
+ "version": "1.7.2-dev.2607926676",
4
4
  "description": "Golemio FYPR Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",