@opengis/gis 0.2.123 → 0.2.125

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.
Files changed (27) hide show
  1. package/dist/{CardIcon-B803CYEy.js → CardIcon-BLMtCXLH.js} +1 -1
  2. package/dist/{EntityTablePage-GvPAsezJ.js → EntityTablePage-C4myYlFG.js} +1 -1
  3. package/dist/{ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-DK04uTt0.js → ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-DbJh2Fwh.js} +1 -1
  4. package/dist/{HeaderActions.vue_vue_type_script_setup_true_lang-BqqrcSzn.js → HeaderActions.vue_vue_type_script_setup_true_lang-K7A_UX_L.js} +1 -1
  5. package/dist/{MapSettings-BhCdxPyE.js → MapSettings-DB00GdG3.js} +1 -1
  6. package/dist/{RastersTablePage-s3rprZMs.js → RastersTablePage-BJ8Fx2lR.js} +1 -1
  7. package/dist/{cartocss-q4t555KA.js → cartocss-C9FsDCQE.js} +5 -5
  8. package/dist/{import-utils-CdFxhsAY.js → import-utils-CGjOAbEq.js} +1 -1
  9. package/dist/{index-CwIzZDGO.js → index-DWGGabsq.js} +441 -441
  10. package/dist/index.css +1 -1
  11. package/dist/index.js +1 -1
  12. package/dist/index.umd.cjs +1 -1
  13. package/dist/{raster-DoQovQ7a.js → raster-fgKYYXVI.js} +3 -3
  14. package/dist/{register-1HxNw096.js → register-C-I3igBi.js} +3 -3
  15. package/dist/{service-DXsnWnlW.js → service-dErle1NR.js} +5 -5
  16. package/dist/{vs-datatable-BdV3ZjCU.js → vs-datatable-BKFXZaVJ.js} +1 -1
  17. package/module/test/cls/doc_status.json +31 -31
  18. package/module/test/select/core.user_uid.sql +1 -1
  19. package/package.json +1 -1
  20. package/server/plugins/mapnik/funcs/checkRasterFile.js +1 -1
  21. package/server/plugins/mapnik/funcs/mapnik.js +5 -0
  22. package/server/plugins/mapnik/map.proto +0 -6
  23. package/server/routes/map/maps/get.map.js +9 -8
  24. package/server/routes/mapnik/controllers/clearTiles.js +3 -3
  25. package/server/routes/mapnik/controllers/createXml.js +1 -1
  26. package/server/routes/mapnik/controllers/rasterInfo.js +1 -1
  27. package/server/routes/mapnik/controllers/rtile.js +3 -3
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as F, resolveDirective as Ce, openBlock as o, createElementBlock as d, createElementVNode as s, Fragment as q, renderList as B, toDisplayString as c, withDirectives as ie, createTextVNode as Re, normalizeClass as W, ref as h, watch as S, computed as g, vModelText as Ee, onMounted as Se, onBeforeUnmount as Ie, unref as je, createCommentVNode as U, createVNode as M, withCtx as ze, createBlock as L, resolveDynamicComponent as Me } from "vue";
2
2
  import { useRouter as Le, useRoute as Ne } from "vue-router";
3
3
  import { TooltipDirective as Ue, notify as D } from "@opengis/core";
4
- import { _ as qe, u as Be, f as Te, M as De, i as Pe, j as re, F as Fe } from "./index-CwIzZDGO.js";
5
- import { _ as Ve, a as Qe, b as Ge, c as Ae } from "./HeaderActions.vue_vue_type_script_setup_true_lang-BqqrcSzn.js";
6
- import { _ as Oe } from "./ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-DK04uTt0.js";
4
+ import { _ as qe, u as Be, f as Te, M as De, i as Pe, j as re, F as Fe } from "./index-DWGGabsq.js";
5
+ import { _ as Ve, a as Qe, b as Ge, c as Ae } from "./HeaderActions.vue_vue_type_script_setup_true_lang-K7A_UX_L.js";
6
+ import { _ as Oe } from "./ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-DbJh2Fwh.js";
7
7
  const We = { class: "flex-1 overflow-y-auto p-4 sm:p-6" }, Xe = { class: "space-y-3" }, Ye = { class: "bg-white p-3 rounded-xl border border-gray-200 shadow-sm" }, Ke = { class: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2" }, Ze = { class: "text-xs text-gray-500 mb-1" }, He = {
8
8
  key: 0,
9
9
  class: "text-base text-md font-semibold text-gray-900"
@@ -2,9 +2,9 @@ import { defineComponent as B, mergeModels as j, useModel as S, computed as h, d
2
2
  import { useRoute as Z, useRouter as ee } from "vue-router";
3
3
  import { notify as F } from "@opengis/core";
4
4
  import { _ as te } from "./TableFormHeader.vue_vue_type_script_setup_true_lang-Mci_tseM.js";
5
- import { V as N } from "./vs-datatable-BdV3ZjCU.js";
6
- import { _ as z, n as R, m as E, r as H } from "./import-utils-CdFxhsAY.js";
7
- import { a as ae, b as le, c as se, d as oe, e as ie } from "./index-CwIzZDGO.js";
5
+ import { V as N } from "./vs-datatable-BKFXZaVJ.js";
6
+ import { _ as z, n as R, m as E, r as H } from "./import-utils-CGjOAbEq.js";
7
+ import { a as ae, b as le, c as se, d as oe, e as ie } from "./index-DWGGabsq.js";
8
8
  import { LucideChevronRight as re } from "lucide-vue-next";
9
9
  import { _ as ne } from "./MapSettingsTabs.vue_vue_type_script_setup_true_lang-CKCK3NqY.js";
10
10
  const ue = { class: "vs-form" }, de = { class: "vs-form__body auto-rows-max container" }, ce = { class: "flex flex-wrap" }, me = { class: "h-fit w-full mb-6 bg-white border border-gray-200 rounded-lg p-6" }, ve = { class: "h-fit w-full flex flex-wrap" }, pe = { class: "w-full" }, fe = /* @__PURE__ */ B({
@@ -1,12 +1,12 @@
1
1
  import { openBlock as C, createElementBlock as M, createElementVNode as v, defineComponent as Z, ref as S, watch as T, createTextVNode as Di, createVNode as j, createBlock as N, createCommentVNode as P, defineAsyncComponent as Ri, unref as ve, withCtx as qe, withDirectives as Be, vModelText as Ye, normalizeClass as he, Fragment as Nn, renderList as Mn, toDisplayString as te, getCurrentInstance as Dn, onBeforeUnmount as Rn, toRef as $i, computed as Se, onMounted as ji, resolveDynamicComponent as Ui } from "vue";
2
2
  import { useRoute as Bi, useRouter as Yi } from "vue-router";
3
3
  import { notify as z } from "@opengis/core";
4
- import { _ as Ne, u as $n, f as Pi, M as Hi, g as Vi, h as qi, i as Ki, j as mn, k as zi, l as Gi, m as Qi, s as hn } from "./index-CwIzZDGO.js";
5
- import { _ as Wi, a as Ji, b as Zi, c as Xi } from "./HeaderActions.vue_vue_type_script_setup_true_lang-BqqrcSzn.js";
6
- import { S as el, C as nl } from "./CardIcon-B803CYEy.js";
4
+ import { _ as Ne, u as $n, f as Pi, M as Hi, g as Vi, h as qi, i as Ki, j as mn, k as zi, l as Gi, m as Qi, s as hn } from "./index-DWGGabsq.js";
5
+ import { _ as Wi, a as Ji, b as Zi, c as Xi } from "./HeaderActions.vue_vue_type_script_setup_true_lang-K7A_UX_L.js";
6
+ import { S as el, C as nl } from "./CardIcon-BLMtCXLH.js";
7
7
  import { _ as jn } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-D3ZPeXMw.js";
8
- import { V as Me } from "./vs-datatable-BdV3ZjCU.js";
9
- import { _ as Je, m as Ze, r as xe } from "./import-utils-CdFxhsAY.js";
8
+ import { V as Me } from "./vs-datatable-BKFXZaVJ.js";
9
+ import { _ as Je, m as Ze, r as xe } from "./import-utils-CGjOAbEq.js";
10
10
  /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
11
11
  function Un(e) {
12
12
  return typeof e > "u" || e === null;
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as F, mergeModels as O, defineAsyncComponent as I, useModel as R, ref as y, watch as K, openBlock as o, createElementBlock as s, createElementVNode as e, createVNode as $, unref as x, withCtx as S, createStaticVNode as V, useSlots as P, computed as H, Fragment as b, createTextVNode as U, createCommentVNode as N, renderList as A, normalizeStyle as Q, toDisplayString as M, normalizeClass as z, withModifiers as X, createBlock as Y, resolveDynamicComponent as ee, withDirectives as te, renderSlot as ne } from "vue";
2
2
  import { notify as E } from "@opengis/core";
3
3
  import { Edit as le, Trash as oe } from "lucide-vue-next";
4
- import { _ as u } from "./index-CwIzZDGO.js";
4
+ import { _ as u } from "./index-DWGGabsq.js";
5
5
  const se = { class: "flex items-center justify-center col-span-3 gap-2" }, re = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, ie = /* @__PURE__ */ F({
6
6
  __name: "vs-datatable-controls",
7
7
  props: /* @__PURE__ */ O({
@@ -1,32 +1,32 @@
1
- [
2
- {
3
- "id": "1",
4
- "text": "Діючий",
5
- "color": "#1ab394"
6
- },
7
- {
8
- "id": "2",
9
- "text": "Зупинений",
10
- "color": "#ed82c8"
11
- },
12
- {
13
- "id": "3",
14
- "text": "Скасований",
15
- "color": "#4a4a4a"
16
- },
17
- {
18
- "id": "5",
19
- "text": "Проектний",
20
- "color": "#6495ed"
21
- },
22
- {
23
- "id": "7",
24
- "text": "Очікує розгляду",
25
- "color": "#92b8ef"
26
- },
27
- {
28
- "id": "10",
29
- "text": "Архівний",
30
- "color": "#d48428"
31
- }
1
+ [
2
+ {
3
+ "id": "1",
4
+ "text": "Діючий",
5
+ "color": "#1ab394"
6
+ },
7
+ {
8
+ "id": "2",
9
+ "text": "Зупинений",
10
+ "color": "#ed82c8"
11
+ },
12
+ {
13
+ "id": "3",
14
+ "text": "Скасований",
15
+ "color": "#4a4a4a"
16
+ },
17
+ {
18
+ "id": "5",
19
+ "text": "Проектний",
20
+ "color": "#6495ed"
21
+ },
22
+ {
23
+ "id": "7",
24
+ "text": "Очікує розгляду",
25
+ "color": "#92b8ef"
26
+ },
27
+ {
28
+ "id": "10",
29
+ "text": "Архівний",
30
+ "color": "#d48428"
31
+ }
32
32
  ]
@@ -1 +1 @@
1
- select uid, coalesce(coalesce(sur_name,'')||coalesce(' '||user_name,'') ||coalesce(' '||father_name,''),login) as text from admin.users
1
+ select uid, coalesce(coalesce(sur_name,'')||coalesce(' '||user_name,'') ||coalesce(' '||father_name,''),login) as text from admin.users
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/gis",
3
- "version": "0.2.123",
3
+ "version": "0.2.125",
4
4
  "type": "module",
5
5
  "author": "Softpro",
6
6
  "main": "./dist/index.js",
@@ -35,7 +35,7 @@ export default async function checkRasterFile({ rows, reply, nocache }) {
35
35
  relpath, srid, idx,
36
36
  }) => {
37
37
  callback(`${idx + 1}/${rows.length} (${relpath})`);
38
- const relpath1 = [config.mapnik?.folder, 'raster', relpath].filter(Boolean).join('/');
38
+ const relpath1 = ['raster', config.mapnik?.folder, relpath].filter(Boolean).join('/');
39
39
 
40
40
  // check raster upload status, skip for directories
41
41
  const uploadStatus = !path.extname(relpath) ? {} : await GetRasterStatus({ path: relpath1 });
@@ -12,6 +12,11 @@ const dirname = path.dirname(filepath);
12
12
  const PROTO_PATH = path.join(dirname, '../', 'map.proto');
13
13
  // const PROTO_PATH = config.mapServerAddress && config.mapServerAddress.startsWith('127.0.0.1') ? path.join(dirname, '../../../../../../service/mapnikp/map.proto') : path.join(dirname, '../', 'map.proto');
14
14
 
15
+ // temporary support of old style environment variables
16
+ if (!config.mapnik?.server) {
17
+ config.mapnik = { server: config.mapServerAddress };
18
+ }
19
+
15
20
  const { mapnik } = config;
16
21
 
17
22
  if (!mapnik?.server) {
@@ -31,9 +31,7 @@ message RenderTileRequest {
31
31
  string path = 2;
32
32
  repeated double bbox = 3; // [minx, miny, maxx, maxy]
33
33
  int32 width = 4;
34
- string ttl = 5; // "5m", "1h", "1d" or "0"
35
34
  string debug = 6;
36
- optional bool skipSubdir = 7;
37
35
  }
38
36
 
39
37
  message RenderTileOut {
@@ -115,7 +113,6 @@ message CreateXMLRequest {
115
113
  string debug = 7;
116
114
  string nocache = 8;
117
115
  string proj4 = 9;
118
- bool skipSubdir = 10;
119
116
  }
120
117
 
121
118
  message UploadXMLRequest {
@@ -156,7 +153,6 @@ message GetStatusOut {
156
153
 
157
154
  message GetStatRequest {
158
155
  string period = 1; // "5m", "1h", "1d"
159
- string ttl = 2; // "0"
160
156
  }
161
157
 
162
158
  message GetStatOut {
@@ -184,10 +180,8 @@ message GetLogsOut {
184
180
 
185
181
  message GetRasterInfoRequest {
186
182
  string path = 1;
187
- string ttl = 2;
188
183
  int64 srid = 3;
189
184
  string proj4 = 4;
190
- bool skipSubdir = 5;
191
185
  }
192
186
 
193
187
  message FileItem {
@@ -20,7 +20,7 @@ export default async function getMap({ params = {}, pg = pgClients.client }, rep
20
20
  const fields = columns.map(({ name, dataTypeID, title }) => ({
21
21
  name,
22
22
  type: columnType[pg.pgType?.[dataTypeID] || 'text'],
23
- label: title || name
23
+ label: title || name,
24
24
  }));
25
25
 
26
26
  const mapList = getTemplates('map').map(el => el[0]);
@@ -50,7 +50,7 @@ export default async function getMap({ params = {}, pg = pgClients.client }, rep
50
50
  ...(Array.isArray(obj?.layers) ? obj.layers : []),
51
51
  ...(Array.isArray(obj?.ogc) ? obj.ogc : []),
52
52
  ...(Array.isArray(obj?.cartocss) ? obj.cartocss : []),
53
- ...(Array.isArray(obj?.rasters) ? obj.rasters : [])
53
+ ...(Array.isArray(obj?.rasters) ? obj.rasters : []),
54
54
  ];
55
55
  const layerIds = [...new Set(rawIds.map(id => id?.toString().trim()).filter(Boolean))];
56
56
 
@@ -58,17 +58,17 @@ export default async function getMap({ params = {}, pg = pgClients.client }, rep
58
58
 
59
59
  if (layerIds.length > 0) {
60
60
  const [resServices, resOgc, resRasters, resCarto] = await Promise.all([
61
- pg.query(`SELECT service_id::text as id, *, st_asgeojson(bbox)::json as bbox, st_asgeojson(center)::json as center FROM gis.services WHERE is_active = true AND is_public = true AND service_id::text = ANY($1)`, [layerIds]),
61
+ pg.query(`SELECT service_id::text as id, *, st_asgeojson(bbox)::json as bbox, st_asgeojson(center)::json as center, coalesce('/api/vtile/'||service_id||'/ua/{z}/{x}/{y}.vmt',null) as url FROM gis.services WHERE is_active = true AND is_public = true AND service_id::text = ANY($1)`, [layerIds]),
62
62
  pg.query(`SELECT ogc_service_id::text as id, url as service_url, * FROM gis.ogc_service WHERE enabled = true AND ispublic = true AND ogc_service_id::text = ANY($1)`, [layerIds]),
63
- pg.query(`SELECT raster_id::text as id, *, st_asgeojson(bbox)::json as bbox, st_asgeojson(center)::json as center FROM gis.rasters WHERE is_active = true AND is_public = true AND isadmin = false AND raster_id::text = ANY($1)`, [layerIds]),
64
- pg.query(`SELECT cartocss_id::text as id, *, st_asgeojson(geom)::json as bbox FROM gis.cartocss WHERE enabled = true AND is_public = true AND cartocss_id::text = ANY($1)`, [layerIds])
63
+ pg.query(`SELECT raster_id::text as id, *, st_asgeojson(bbox)::json as bbox, st_asgeojson(center)::json as center, coalesce('/api/gis-rtile/'||raster_id||'/{z}/{x}/{y}.png',null) as url FROM gis.rasters WHERE is_active = true AND is_public = true AND isadmin = false AND raster_id::text = ANY($1)`, [layerIds]),
64
+ pg.query(`SELECT cartocss_id::text as id, *, st_asgeojson(geom)::json as bbox, coalesce('/api/gis-rtile/'||cartocss_id||'/{z}/{x}/{y}.png',null) as url FROM gis.cartocss WHERE enabled = true AND is_public = true AND cartocss_id::text = ANY($1)`, [layerIds]),
65
65
  ]);
66
66
 
67
67
  const allFetchedLayers = [
68
68
  ...resServices.rows.map(row => ({ ...row, type: row.service_type || 'layer' })),
69
69
  ...resOgc.rows.map(row => ({ ...row, type: 'ogc', source_path: row.table_name })),
70
70
  ...resRasters.rows.map(row => ({ ...row, type: 'raster' })),
71
- ...resCarto.rows.map(row => ({ ...row, type: 'cartocss' }))
71
+ ...resCarto.rows.map(row => ({ ...row, type: 'cartocss' })),
72
72
  ];
73
73
 
74
74
  const dbLayersMap = new Map(allFetchedLayers.map(l => [String(l.id), l]));
@@ -91,7 +91,8 @@ export default async function getMap({ params = {}, pg = pgClients.client }, rep
91
91
  if (layerData.style && typeof layerData.style === 'string') {
92
92
  if (layerData.type === 'cartocss') {
93
93
  layerData.style = layerData.style.replace(/\s+/g, ' ').trim();
94
- } else if (layerData.type !== 'ogc') {
94
+ }
95
+ else if (layerData.type !== 'ogc') {
95
96
  layerData.style = yml2json(layerData.style);
96
97
  }
97
98
  }
@@ -110,4 +111,4 @@ export default async function getMap({ params = {}, pg = pgClients.client }, rep
110
111
  }
111
112
 
112
113
  return reply.status(200).send(params.id ? { ...rows[0], fields } : { rows, fields });
113
- }
114
+ }
@@ -54,12 +54,12 @@ export default async function clearTiles({
54
54
 
55
55
  const getParams = () => {
56
56
  if (carto.cartocss_id && carto.source_path) {
57
- return { name: [config.mapnik?.folder, 'vector', carto.source_path].filter(Boolean).join('/') };
57
+ return { name: ['vector', config.mapnik?.folder, carto.source_path].filter(Boolean).join('/') };
58
58
  }
59
59
  if (carto.cartocss_id) {
60
- return { name: [config.mapnik?.folder, 'xml', carto.cartocss_id].filter(Boolean).join('/') };
60
+ return { name: ['xml', config.mapnik?.folder, carto.cartocss_id].filter(Boolean).join('/') };
61
61
  }
62
- return { path: [config.mapnik?.folder, 'raster', raster.source_path].filter(Boolean).join('/') };
62
+ return { path: ['raster', config.mapnik?.folder, raster.source_path].filter(Boolean).join('/') };
63
63
  };
64
64
 
65
65
  const { path: relpath, name } = getParams();
@@ -33,7 +33,7 @@ export default async function createXml({
33
33
  }
34
34
 
35
35
  // const relpath = `/map/raster/${data.source_path}`;
36
- const relpath = [config.mapnik?.folder, 'raster', data.source_path].filter(Boolean).join('/');
36
+ const relpath = ['raster', config.mapnik?.folder, data.source_path].filter(Boolean).join('/');
37
37
 
38
38
  // check raster upload status, skip for directories
39
39
  const uploadStatus = path.extname(data.source_path) ? await GetRasterStatus({ path: relpath }) : {};
@@ -31,7 +31,7 @@ export default async function rasterInfo({
31
31
 
32
32
  const proj4 = raster.proj4 || (raster.srid && pg.pk?.['public.spatial_ref_sys'] ? await pg.query('select proj4text from public.spatial_ref_sys where srid=$1', [raster.srid]).then(el => el.rows?.[0]?.proj4text) : undefined);
33
33
 
34
- const relpath = [config.mapnik?.folder, 'raster', raster.source_path].filter(Boolean).join('/');
34
+ const relpath = ['raster', config.mapnik?.folder, raster.source_path].filter(Boolean).join('/');
35
35
 
36
36
  const { data, cache, error } = await GetRasterInfo({
37
37
  path: relpath,
@@ -95,12 +95,12 @@ export default async function gisRtile({
95
95
 
96
96
  const getParams = () => {
97
97
  if (data.type === 'css' && data.source_path) {
98
- return { name: path.posix.join(config.mapnik?.folder || '', 'vector', data.source_path) };
98
+ return { name: path.posix.join('vector', config.mapnik?.folder || '', data.source_path) };
99
99
  }
100
100
  if (data.type === 'css') {
101
- return { name: path.posix.join(config.mapnik?.folder || '', 'xml', id) };
101
+ return { name: path.posix.join('xml', config.mapnik?.folder || '', id) };
102
102
  }
103
- return { path: path.posix.join(config.mapnik?.folder || '', 'raster', data.source_path) };
103
+ return { path: path.posix.join('raster', config.mapnik?.folder || '', data.source_path) };
104
104
  };
105
105
 
106
106
  const { path: rpath, name } = getParams();