Skip to content

Commit

Permalink
update to 0.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed Jan 26, 2022
1 parent 0c8bbf2 commit ceac0e8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"webpack-cli": "^4.7.0",
"worker-loader": "^3.0.8"
},
"version": "0.2.7",
"version": "0.2.8",
"description": "A javascript library for spatial data analysis",
"main": "./lib/index.js",
"repository": {
Expand Down
9 changes: 6 additions & 3 deletions src/geoda-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,18 +292,21 @@ export default class GeoDaWasm {

let i = 0;
let j = 0;
let k = 0;
const n = xx.size();
let count = 0;
const multiPolygon = [];
const multiPolygon = Array(parts.size());

while (i < n) {
if (i === count) {
multiPolygon.push([[]]);
multiPolygon[j] = [Array(parts.get(j)).fill(null)];
count += parts.get(j);
j += 1;
k = 0;
}
multiPolygon[j - 1][0].push([xx.get(i), yy.get(i)]);
multiPolygon[j - 1][0][k] = [xx.get(i), yy.get(i)];
i += 1;
k += 1;
}
const tmpGeojson = { type: 'Feature', geometry: { type: 'MultiPolygon', coordinates: multiPolygon }, properties: {} };
return tmpGeojson;
Expand Down
2 changes: 1 addition & 1 deletion src/jsgeoda-wasm.json

Large diffs are not rendered by default.

Binary file modified src/jsgeoda.wasm
Binary file not shown.

0 comments on commit ceac0e8

Please sign in to comment.