Skip to content

Commit c1be69d

Browse files
authored
Merge pull request #17 from rowanwins/better-handle-endpoint
Add more robust intersection checking, inc for end of segments
2 parents 3a111b4 + 6f1d3c8 commit c1be69d

25 files changed

+269
-150
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.0.0
2+
- More robust detection of intersections (inc on endpoints)
3+
- Remove webpack and ava as dev dependencies, and move to vite & vitest
4+
15
## 1.5.0
26
- Add buble to rollup build
37

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ Tested against
8383
// - Fastest is sweepline (this library)
8484
8585
// Chile - Vertical geometry (17,000 vertices)
86-
// bentleyOttmann x 50.22 ops/sec ±1.75% (65 runs sampled)
8786
// sweepline x 35.64 ops/sec ±1.20% (62 runs sampled)
88-
// - Fastest is bentleyOttmann (although it doesn't find intersection)
8987
````
9088

9189
## Contributing
-1.43 KB
Binary file not shown.
-2.41 KB
Binary file not shown.
-618 Bytes
Binary file not shown.
-1.23 KB
Binary file not shown.

debug/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Vue 3 + Vite
2+
3+
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4+
5+
## Recommended IDE Setup
6+
7+
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)
-696 Bytes
Binary file not shown.

debug/build.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

debug/gj.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import {createFilter, dataToEsm} from '@rollup/pluginutils'
2+
3+
export default function json (options = {
4+
include: ['**/*.json', '**/*.geojson']
5+
}) {
6+
const filter = createFilter(options.include, options.exclude)
7+
const indent = 'indent' in options ? options.indent : '\t'
8+
9+
return {
10+
name: 'geojson',
11+
12+
// eslint-disable-next-line no-shadow
13+
transform (json, id) {
14+
if (!filter(id)) return null
15+
try {
16+
const parsed = JSON.parse(json)
17+
return {
18+
code: dataToEsm(parsed, {
19+
preferConst: options.preferConst,
20+
compact: options.compact,
21+
namedExports: options.namedExports,
22+
indent
23+
}),
24+
map: {mappings: ''}
25+
}
26+
} catch (err) {
27+
const message = 'Could not parse GeoJSON file'
28+
const position = parseInt(/[\d]/.exec(err.message)[0], 10)
29+
this.warn({message, id, position})
30+
return null
31+
}
32+
}
33+
}
34+
}

0 commit comments

Comments
 (0)