@opengis/gis 0.2.190 → 0.2.192

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/gis",
3
- "version": "0.2.190",
3
+ "version": "0.2.192",
4
4
  "type": "module",
5
5
  "author": "Softpro",
6
6
  "main": "./dist/index.js",
@@ -17,14 +17,14 @@ import { SphericalMercator } from '@mapbox/sphericalmercator';
17
17
  const mercator = new SphericalMercator({ size: 256 });
18
18
 
19
19
  import {
20
- getColumnCLS, getTemplate, getMeta, getFilterSQL, getSelect,
21
- pgClients,
22
- getFilterSQLParametrized,
20
+ getColumnCLS, getTemplate, getMeta, getSelect, pgClients
23
21
  } from '@opengis/fastify-table/utils.js';
24
22
 
25
23
  import rootFolder from '../../../plugins/mapnik/funcs/rootFolder.mjs';
26
24
  import { NotFoundError } from '@opengis/fastify-table/errors.js';
27
25
 
26
+ import getFilterSQLParametrized from '../../registers/functions/getFilterSQLParametrized/index.js';
27
+
28
28
  const propsCache = {};
29
29
 
30
30
  const types = { point: 'ST_Point' /* ,ST_MultiPoint */, polygon: 'ST_Polygon,ST_MultiPolygon' };
@@ -72,13 +72,13 @@ export default async function vtile({
72
72
  const bbox = mercator.bbox(+y, +x, +z, false/* , '900913' */);
73
73
  const bbox2d = `'BOX(${bbox[0]} ${bbox[1]},${bbox[2]} ${bbox[3]})'::box2d`;
74
74
 
75
- const filterData = queryFilter ? await getFilterSQLParametrized({
76
- filter: queryFilter, table, filterList, pg,
77
- }) : { args: [] };
78
-
79
75
  // meta
80
76
  const metaTable = table ? await getMeta({ pg, table }) : {};
81
77
 
78
+ const filterData = table && queryFilter ? getFilterSQLParametrized({
79
+ table, fields: metaTable?.columns, filter: queryFilter, filterList,
80
+ }, pg) : { args: [] };
81
+
82
82
  const { pk: pkey = data.key, columns = [] } = metaTable; // if view - specify via template
83
83
 
84
84
  // props
@@ -83,17 +83,190 @@ const serviceBodySchema = {
83
83
  type: 'object',
84
84
  additionalProperties: false,
85
85
  properties: {
86
- type: { type: 'string', enum: ['point', 'line', 'polygon'] },
87
- color: { type: 'string' },
88
- width: { type: 'integer', minimum: 0, maximum: 10 },
89
- icon: { type: ['string', 'null'] },
90
- iconAttr: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
91
- iconZoom: { type: 'integer', minimum: 0, maximum: 22 },
92
- cluster: { type: 'boolean' },
93
- clusterMaxZoom: { type: 'integer', minimum: 0, maximum: 22 },
94
- label: { type: 'string', pattern: "^\\{[\\d\\w_.-]+\\}$", },
95
- border: { type: 'number', minimum: 0, maximum: 10 },
96
- opacity: { type: 'number', minimum: 0, maximum: 1 },
86
+ type: {
87
+ type: 'string',
88
+ enum: ['point', 'line', 'polygon'],
89
+ },
90
+
91
+ label: {
92
+ type: 'string',
93
+ pattern: '^\\{[\\d\\w_.-]+\\}$',
94
+ },
95
+
96
+ color: {
97
+ type: 'string',
98
+ },
99
+
100
+ stroke: {
101
+ type: 'string',
102
+ },
103
+
104
+ opacity: {
105
+ type: 'number',
106
+ minimum: 0,
107
+ maximum: 1,
108
+ },
109
+
110
+ strokeOpacity: {
111
+ type: 'number',
112
+ minimum: 0,
113
+ maximum: 1,
114
+ },
115
+
116
+ width: {
117
+ type: 'integer',
118
+ minimum: 0,
119
+ maximum: 10,
120
+ },
121
+
122
+ radius: {
123
+ type: 'integer',
124
+ minimum: 1,
125
+ maximum: 20,
126
+ },
127
+
128
+ pointZoom: {
129
+ type: 'integer',
130
+ minimum: 1,
131
+ maximum: 22,
132
+ },
133
+
134
+ clusterMaxZoom: {
135
+ type: 'integer',
136
+ minimum: 0,
137
+ maximum: 22,
138
+ },
139
+
140
+ clusterZoom: {
141
+ type: 'integer',
142
+ minimum: 0,
143
+ maximum: 22,
144
+ },
145
+
146
+ colorAttr: {
147
+ type: 'string',
148
+ pattern: '^([\\d\\w._-]+)$',
149
+ },
150
+
151
+ colorSet: {
152
+ type: 'object',
153
+ },
154
+
155
+ icon: {
156
+ type: ['string', 'null'],
157
+ },
158
+
159
+ iconZoom: {
160
+ type: 'integer',
161
+ minimum: 0,
162
+ maximum: 22,
163
+ },
164
+
165
+ iconAttr: {
166
+ type: 'string',
167
+ pattern: '^([\\d\\w._-]+)$',
168
+ },
169
+
170
+ iconSet: {
171
+ type: 'object',
172
+ },
173
+
174
+ iconPrefix: {
175
+ type: 'string',
176
+ },
177
+
178
+ cluster: {
179
+ type: 'boolean',
180
+ },
181
+
182
+ sizeAttr: {
183
+ type: 'string',
184
+ pattern: '^([\\d\\w._-]+)$',
185
+ },
186
+
187
+ sizeScale: {
188
+ type: 'number',
189
+ },
190
+
191
+ pattern: {
192
+ type: 'string',
193
+ },
194
+
195
+ gradient: {
196
+ type: 'boolean',
197
+ },
198
+
199
+ dashArray: {
200
+ type: 'array',
201
+ items: {
202
+ type: 'number',
203
+ minimum: 0,
204
+ },
205
+ },
206
+
207
+ rotationAttr: {
208
+ type: 'string',
209
+ pattern: '^([\\d\\w._-]+)$',
210
+ },
211
+
212
+ rotationOffset: {
213
+ type: 'number',
214
+ minimum: 0,
215
+ maximum: 360,
216
+ },
217
+
218
+ textColor: {
219
+ type: 'string',
220
+ },
221
+
222
+ textHaloColor: {
223
+ type: 'string',
224
+ },
225
+
226
+ textHaloWidth: {
227
+ type: 'number',
228
+ minimum: 1,
229
+ maximum: 5,
230
+ },
231
+
232
+ minZoom: {
233
+ type: 'integer',
234
+ minimum: 0,
235
+ maximum: 22,
236
+ },
237
+
238
+ maxZoom: {
239
+ type: 'integer',
240
+ minimum: 0,
241
+ maximum: 22,
242
+ },
243
+
244
+ hoverStyle: {
245
+ type: 'object',
246
+ },
247
+
248
+ selectStyle: {
249
+ type: 'object',
250
+ },
251
+
252
+ zIndex: {
253
+ type: 'number',
254
+ },
255
+
256
+ blendMode: {
257
+ type: 'string',
258
+ enum: ['normal', 'multiply', 'overlay'],
259
+ },
260
+
261
+ border: {
262
+ type: 'number',
263
+ minimum: 0,
264
+ maximum: 10,
265
+ },
266
+
267
+ colors: {
268
+ type: 'object',
269
+ },
97
270
  },
98
271
  },
99
272