@nshiab/simple-data-analysis-core 0.1.5 → 1.0.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregateGeoQuery.d.ts","sourceRoot":"","sources":["../../src/methods/aggregateGeoQuery.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,GAAG,cAAc,EAChC,OAAO,GAAE;IACP,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B,
|
|
1
|
+
{"version":3,"file":"aggregateGeoQuery.d.ts","sourceRoot":"","sources":["../../src/methods/aggregateGeoQuery.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,GAAG,cAAc,EAChC,OAAO,GAAE;IACP,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B,UA6BP"}
|
|
@@ -7,7 +7,8 @@ export default function aggregateGeoQuery(table, column, method, options = {}) {
|
|
|
7
7
|
? ` ${categories.map((d) => `"${d}"`).join(", ")},`
|
|
8
8
|
: ""}`;
|
|
9
9
|
if (method === "union") {
|
|
10
|
-
query +=
|
|
10
|
+
query +=
|
|
11
|
+
` CASE WHEN ST_IsEmpty(ST_Union_Agg("${column}")) THEN NULL ELSE ST_Union_Agg("${column}") END AS "${column}"`;
|
|
11
12
|
}
|
|
12
13
|
else if (method === "intersection") {
|
|
13
14
|
query += ` ST_Intersection_Agg("${column}") AS "${column}"`;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregateGeoQuery.d.ts","sourceRoot":"","sources":["../../src/methods/aggregateGeoQuery.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,GAAG,cAAc,EAChC,OAAO,GAAE;IACP,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B,
|
|
1
|
+
{"version":3,"file":"aggregateGeoQuery.d.ts","sourceRoot":"","sources":["../../src/methods/aggregateGeoQuery.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,GAAG,cAAc,EAChC,OAAO,GAAE;IACP,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B,UA6BP"}
|
|
@@ -13,7 +13,8 @@ function aggregateGeoQuery(table, column, method, options = {}) {
|
|
|
13
13
|
? ` ${categories.map((d) => `"${d}"`).join(", ")},`
|
|
14
14
|
: ""}`;
|
|
15
15
|
if (method === "union") {
|
|
16
|
-
query +=
|
|
16
|
+
query +=
|
|
17
|
+
` CASE WHEN ST_IsEmpty(ST_Union_Agg("${column}")) THEN NULL ELSE ST_Union_Agg("${column}") END AS "${column}"`;
|
|
17
18
|
}
|
|
18
19
|
else if (method === "intersection") {
|
|
19
20
|
query += ` ST_Intersection_Agg("${column}") AS "${column}"`;
|