Repository navigation
feat (buffer): add buffer parameter to intersect and within #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
NtnHgr
wants to merge
33
commits into
main
Choose a base branch
from
buffer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
7933025
feat: add buffer parameter to intersect, nearest-neighbour and within…
NtnHgr 84fc444
feat (buffer): unused vars fixed
NtnHgr 7431b3f
feat (buffer): format:check carried out
NtnHgr 8fbd9a0
fix(buffer): returnBufferGeometry, unit: meters
NtnHgr f6162d1
fix(buffer): format:check
NtnHgr 5b3f91b
docs: buffer parameters documented
NtnHgr 432f57e
fix(buffer) getBufferQuadSegs as util-module
NtnHgr fe015ba
fix(buffer) sprecification of returnBufferGeometry depends on buffer
NtnHgr cb8846c
fix(buffer): calculation of getBufferQuadSegs
NtnHgr 3f8b6d1
fix(buffer): added upper bound for buffer distance
NtnHgr ac518d6
fix(buffer): resolved comments
NtnHgr 1c0991c
fix(buffer): make returnBufferGeometry schema compatible with the val…
sebeweiss 81d5ef9
test(buffer): add e2e tests
NtnHgr ee94c2d
fix(buffer): adjust test for maximum quadSegs to maximum buffer distance
NtnHgr 6c1966b
fix(buffer): deleted unused variable
NtnHgr 6337c7b
fix(buffer): set upper bound for buffer distance to 20000
NtnHgr e400ad6
fix(buffer): adjust e2e-test (within) for upper bound of buffer distance
NtnHgr 5c19fc4
adjust documentation for upper bound of buffer distance
NtnHgr 6a460cf
fix(buffer): returnBufferGeometry, unit: meters
NtnHgr 18e8043
fix(buffer): format:check
NtnHgr 8e7751f
docs: buffer parameters documented
NtnHgr 108f41c
fix(buffer) getBufferQuadSegs as util-module
NtnHgr 252754b
Merge main into buffer
NtnHgr 381dfa3
docs (buffer): update changelog
NtnHgr 7775156
fix(buffer): preserve geometry identifiers on buffer features
NtnHgr e40ccc4
fix(buffer): remove tsconfig.build.tsbuildinfo
NtnHgr 1f0415b
docs(buffer): correct wording and rename getBufferGeometry to returnB…
NtnHgr d19b79d
docs(buffer): delete comments
NtnHgr 1e837ed
feat(buffer): remove buffer from nearestNeighbour
NtnHgr 0f09fc2
test(buffer): adjust e2e-tests to removal of buffer from nearestNeigh…
NtnHgr 73714cf
docs(buffer): adjust docs to removal of buffer from nearestNeighbour
NtnHgr f15645f
docs(buffer): adjust docs to removal of buffer from nearestNeighbour
NtnHgr e2e28cf
Merge branch 'buffer' of https://github.com/geobakery/GeospatialAnaly…
NtnHgr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { getBufferQuadSegs } from './buffer.util'; | ||
|
|
||
| describe('getBufferQuadSegs', () => { | ||
| it('returns the minimum (8) for buffer distance <= 0', () => { | ||
| expect(getBufferQuadSegs(0)).toBe(8); | ||
| expect(getBufferQuadSegs(-5)).toBe(8); | ||
| }); | ||
|
|
||
| it('returns more segments for larger buffer distances (finer approximation needed)', () => { | ||
| const small = getBufferQuadSegs(1); | ||
| const large = getBufferQuadSegs(10000); | ||
| expect(large).toBeGreaterThan(small); | ||
| }); | ||
|
|
||
| it('never exceeds the maximum of 256', () => { | ||
| expect(getBufferQuadSegs(20000)).toBeLessThanOrEqual(256); | ||
| }); | ||
|
|
||
| it('never falls below the minimum of 8', () => { | ||
| expect(getBufferQuadSegs(0.001)).toBeGreaterThanOrEqual(8); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| export function getBufferQuadSegs(bufferDistance: number): number { | ||
| const maxError = 0.1; | ||
| const minQuadSegs = 8; | ||
| const maxQuadSegs = 256; | ||
|
|
||
| if (bufferDistance <= 0) { | ||
| return minQuadSegs; | ||
| } | ||
|
|
||
| if (maxError >= 2 * bufferDistance) { | ||
| return minQuadSegs; | ||
| } | ||
|
|
||
| const quadSegs = Math.ceil( | ||
| Math.PI / (4 * Math.acos(1 - maxError / bufferDistance)), | ||
| ); | ||
|
|
||
| return Math.min(maxQuadSegs, Math.max(minQuadSegs, quadSegs)); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.