-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial null-safety implementation * attributes non-nullable + tests, fix meta tests * make altitude for Position and BBox nullable * update action deps, build runner * delete conflicting outputs, dart test on PR action * Strongly type and refactor geomEach meta function This commit also renames Geometry to GeometryObject * simplify geomEach * Add coverage reporting to pull requests tests * Allow PR coverage comment to fail This allows PRs from forks to still run the tests successfully * Refactor coverage reporting into its own job The coverage job is allowed to continue on error, letting the entire workflow 'pass' if we hit issues running or reporting coverage * Move coverage reporting into separate workflow * geomEach: nullable fields #36 * fix types in tests * Update to latest romeovs/lcov-reporter-action This should resolve an issue where the 'comment code coverage on PR' action fails after being merged into main. See romeovs/lcov-reporter-action#16 * raise version for release 0.0.3 * [meta] add implementation and test for featureEach and propEach (#24) * Assemble different types, refactor GeoJSON serialization, general improvements (#43) * #19, #20, #21, refactor * convert GeoJSONObjectType to enum, rename * rm overridden bboxes * Implement vector operations #23 * statically type 'round' helper func, fix unit test * gen coverage * fix typo * geojson unit tests, type fixes * fix deserialization with GeoJSONObjectType, implement hashCode * initial unit tests for new constructors * integration tests * fix path * test bbox on other geojson types * update enum tests * required params for new constructors, unit tests * license notices * bump version for release * Add basic benchmarking framework (#51) * Add pub version badge * [meta] add coordeach implementation (#50) * [meta] add coordeach implementation * [benchmark] add coordeach benchmark using test fixtures * Add implementation for getCoord & getCoords // invariant package (#53) * initial getCoord & getCoords implementation * WIP test coords/coord * test gitpod flutter config * ports invariants package (#62) * dart pub get added * wip, type problem * fixed return error of the test * Gitpod config * new test cases, changed comments * standardized the comments * wrapped List in brackets * some minor typo edit * added highlight in documentation * formatted conflicting files * deleted the gitpod files Co-authored-by: Arman Torkzaban <[email protected]> Co-authored-by: arman <[email protected]> Co-authored-by: arman <[email protected]> Co-authored-by: Arman Torkzaban <[email protected]> * Add flattenEach function and tests (#48) * Add flattenEach function and tests * Refactor flattenEach slightly * Refactor meta -- breaking of iterations tests * Explicitly do not support nested GeometryCollections * Update documentation links * Use more specific type checks in flattenEach test * rm duplicate fcMixed * remove geometryCollection clause * warning for nested GeometryCollection Co-authored-by: Lukas Himsel <[email protected]> * refactor coordEach with geomEach, change type in geomEach callback (#68) * [meta] add coordeach implementation * Rework coordEach implementation to match setup more from geomEach * cleanup * optimize for geometry collection * refactor coordEach with geomEach, change type in geomEach callback Co-authored-by: Tobrun Van Nuland <[email protected]> * Port coordAll function and test, also: refactor coordEach callback (#64) * beginning * wip coordAll * coordAll test, WIP * changes CoordEachCallback's signature * typecast removed, test corrected * changes before merging * refactor for Position in CoordEachCallback Co-authored-by: Lukas Himsel <[email protected]> * Update README.md * Feature reducers (#49) * Temporarily type geomEach callback to GeometryType * Add geomReduce function and tests * propReduce function * WIP - featureReduce() * WIP * added examples and documentations * flattenReduce WIP * WIP * coordReduce * documentation * add static types * merge readme * prepare new merge * generic types for all reducer functions * TurfJS compatible solution with type checks * add cloning * fixed types passed to callbacks, propReduce test * flattenReduce and featureReduce test * coordReduce * minor type conv. num to int Co-authored-by: Arman Torkzaban <[email protected]> Co-authored-by: Lukas Himsel <[email protected]> * Port cluster functions and tests (#69) * port functions * getCluster documentation * WIP documentation * Did the documentation * wrote tests * benchmarks - in process * moved benchmarks to separate file * exported clusters.dart Co-authored-by: armantorkzaban <[email protected]> * Port meta segment functions & lineSegment (#70) * initial commit to segment file * beginning * lineSegment() * lineSegment * refactor * lineSegment tests * polygon test * wip segmentEach * rewrite segmentEach witohut coordEach * fix flattenEachCallback * combine units * tests for segmentEach * segmentEach id check tests * segmentReduce impltd. * updated README * Documentation * benchmark init Co-authored-by: Arman Torkzaban <[email protected]> * split up meta into separate files (#72) * Meta functions extension methods (#73) * initial setup * fix export, add all *each functions * implement 'other' functions * implement *reduce functions * fix tests * rm geojson param for reducers * Update functions and packages in README.md (#67) * WIP - updating README.md * missing new functions & packages * helpers function aint needed anymore - constructor * Links added and unnecessary funtioncs deleted Co-authored-by: Lukas Himsel <[email protected]> * Raise version to 0.0.5 * Documentation (#75) * in process - early analysis of the work * linked the meta functions in readme * CONTRIBUTING.md * links to the sources * edited typos * documentation work * closes #77, closes #16 * proofread * improves pub.dev score, closes #79, #78, #75 * Added deleted model, complemented contributing.md Co-authored-by: Lukas Himsel <[email protected]> * raise to version 0.0.6 Co-authored-by: Brad Parham <[email protected]> Co-authored-by: Tobrun <[email protected]> Co-authored-by: arman <[email protected]> Co-authored-by: arman <[email protected]> Co-authored-by: Arman Torkzaban <[email protected]>
- Loading branch information
1 parent
6a36cb4
commit 0ddf01e
Showing
17 changed files
with
404 additions
and
211 deletions.
There are no files selected for viewing
This file contains 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 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,94 @@ | ||
# Contributiung to Turf.dart | ||
|
||
Welcome and thank you for deciding to contribute to the project! | ||
|
||
Here is how cooperation works perfectly at [Turf Dart](https://github.com/dartclub/turf_dart) | ||
#### Table of Contents | ||
- [Code of Conduct](#code-of-conduct) | ||
- [Get started](#get-started) | ||
- [Structure of modules](#structure-of-modules) | ||
- [Implementation Process](#implementation-process) | ||
- [Documentation](#documentation) | ||
- [GeoJSON object model](#GeoJSON-object-model) | ||
|
||
## Code of conduct | ||
By participating, you are expected to uphold international human rights and fundamental freedoms! | ||
To put it simply, be kind to each other. | ||
|
||
## Get started | ||
- Get the [Dart tools](https://dart.dev/tools) | ||
- Clone the repository: ```git clone [email protected]:dartclub/turf_dart.git``` | ||
- Navigate to project's folder in terminal & get its dependencies: ```dart pub get``` | ||
- Go through [Implementation Process](#implementation-process) | ||
- Import the library in your code and use it. For example: | ||
```dart | ||
import 'package:turf/helpers.dart'; | ||
import 'package:turf/src/line_segment.dart'; | ||
Feature<Polygon> poly = Feature<Polygon>( | ||
geometry: Polygon(coordinates: [ | ||
[ | ||
Position(0, 0), | ||
Position(2, 2), | ||
Position(0, 1), | ||
Position(0, 0), | ||
], | ||
[ | ||
Position(0, 0), | ||
Position(1, 1), | ||
Position(0, 1), | ||
Position(0, 0), | ||
], | ||
]), | ||
); | ||
var total = segmentReduce<int>(poly, (previousValue, | ||
currentSegment, | ||
initialValue, | ||
featureIndex, | ||
multiFeatureIndex, | ||
geometryIndex, | ||
segmentIndex) { | ||
if (previousValue != null) { | ||
previousValue++; | ||
} | ||
return previousValue; | ||
}, 0, combineNestedGeometries: false); | ||
// total.length == 6 | ||
``` | ||
## Structure of modules | ||
``` | ||
TURF_DART/lib/<MODULE NAME>.dart // public facing API, exports the implementation | ||
│ │ | ||
│ └───src/<MODULE NAME>.dart // the implementation | ||
│ | ||
└───benchmark/<MODULE NAME>_benchmark.dart | ||
│ | ||
└───test/components/<MODULE NAME>_test.dart // all the related tests | ||
``` | ||
## Implementation process | ||
- Check the Backlog/Issues for similar issues | ||
- Create a new branch _feature-_ from _main_ | ||
- Create a _draft Pull request_, mention in it the associated issues | ||
- **Implement** | ||
- Document everything [properly](#documentation) | ||
- If you are importing tests, comments etc. from [Turfjs](https://github.com/Turfjs/turf), please make sure you refactor it so it conforms with Dart syntax. | ||
- **Write [tests](https://dart.dev/guides/testing)**―Keep an eye on [Turfjs'](https://github.com/Turfjs/turf) implementation | ||
- run the the test: ```dart test test/components/XXX.dart``` | ||
- **Write [benchmarks](https://pub.dev/packages/benchmark)**―have a look at our [implementation](https://github.com/dartclub/turf_dart/tree/main/benchmark) | ||
- run the benchmark: ```dart pub run benchmark``` | ||
- Commit | ||
- Convert to real Pull request _ready for review_ | ||
- Code review / mention a reviewer from [contributors list](https://github.com/dartclub/turf_dart/graphs/contributors) | ||
|
||
|
||
## Documentation | ||
We follow [Effective Dart](https://dart.dev/guides/language/effective-dart/documentation) guidelines for documentation. | ||
|
||
After going through the [Implementation Process](#implementation-process), please mention the made changes in [README.md](https://github.com/dartclub/turf_dart/blob/main/README.md) | ||
|
||
In order to add to this very documentation, please develop CONTRIBUTING.md in [documentation branch](https://github.com/dartclub/turf_dart/tree/documentation) | ||
|
||
## GeoJSON Object Model | ||
If you have not read our [README.md](https://github.com/dartclub/turf_dart/blob/main/README.md) this diagram will give you a lot of information. Please consider looking our [notable design decisions](https://github.com/dartclub/turf_dart/blob/main/README.md#notable-design-decisions). | ||
![polymorphism](https://user-images.githubusercontent.com/10634693/159876354-f9da2f37-02b3-4546-b32a-c0f82c372272.png) |
This file contains 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 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 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 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 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 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 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 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.