Skip to content

Commit

Permalink
Release v0.1.0 (#7)
Browse files Browse the repository at this point in the history
* refactor: remove currentPass from default function

* chore: improve prettierrc setup

* chore: update readme

* chore: update version

* chore: Add minify option to tsup.config.ts

* chore: Update branch restrictions for unit tests workflow

* chore: update readme

* chore: add eslint and remove unused dependencies

* chore: run lint and format

* chore: update version to v0.1.0
  • Loading branch information
juanpujol authored Mar 3, 2024
1 parent b284056 commit 911ac67
Show file tree
Hide file tree
Showing 12 changed files with 2,140 additions and 166 deletions.
9 changes: 9 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.DS_Store
node_modules
/dist
.env

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
15 changes: 15 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
root: true,
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
},
env: {
browser: true,
es2017: true,
node: true
}
};
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Run unit tests

on:
push:
branches: [main]
branches: [develop, main]
pull_request:
branches: [develop, main]

Expand Down
3 changes: 0 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/src
/node_modules

.env
.DS_Store

tsconfig.json
tsup.config.js

NOTES.md
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"useTabs": true,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"mutipolygons",
"polyunion",
"rbush",
"tsup"
"tsup",
"turfjs"
],
"githubPullRequests.ignoredPullRequestBranches": ["develop"]
}
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

# PolyUnion Changelog

## v0.1.0 (2024-03-03)

The code is stable enough for use and I'm proud to release it as v0.1.0 🤣. Will improve along with more tests as needed.

### Refactors & Improvements ✨

- Removed some unnecessary dependencies
- Added eslint
- Implemented minification on build
- Simplified function by removing unnecessary parameters

## v0.0.2 (2024-03-03)

### Refactors & Improvements ✨
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PolyUnion

A fast and efficient js utility function designed for merging multiple polygons within a GeoJSON FeatureCollection. It utilizes spatial indexing provided by rbush and the geospatial processing of Turf to achieve high performance.
A fast and efficient js utility function designed for merging multiple polygons within a GeoJSON FeatureCollection. It utilizes spatial indexing provided by **[rbush](https://github.com/mourner/rbush)** and the geospatial processing of **[Turfjs](https://github.com/Turfjs/turf)** to achieve high performance.

## Performance

Expand Down Expand Up @@ -50,11 +50,7 @@ const mergedFeatureCollection = polyunion(features);
console.log(mergedFeatureCollection);
```

The function has 3 parameters:
The function has 2 parameters:

- `featureCollection` (required): A GeoJSON FeatureCollection containing polygons to merge.
- `currentPass` (optional, default: 1): The current pass number. This is used internally for recursive calls and should not be set manually.
- `totalPasses` (optional, default: 3): The total number of passes for internal use in recursive calls. This parameter should not be set manually. The larger the number of iterations, the better the results, but the function will run slower. It depends on the number of polygons being merged. For the case above, 3 passes worked grat.

Feel free to adjust or expand upon this section as needed!

- `totalPasses` (optional, defaults to 3): The total number of passes for internal use in recursive calls. The larger the number of iterations, the better the results, but the function will run slower. It depends on the number of polygons being merged. For the case in the picture above, 4 passes worked great.
Loading

0 comments on commit 911ac67

Please sign in to comment.