Skip to content

Latest commit

 

History

History
104 lines (83 loc) · 3.95 KB

CONTRIBUTING.md

File metadata and controls

104 lines (83 loc) · 3.95 KB

Contributiung to Turf.dart

Welcome and thank you for deciding to contribute to the project!

Here is how cooperation works perfectly at Turf Dart

Table of Contents

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
  • Clone the repository: git clone git@github.com:dartclub/turf_dart.git
  • Navigate to project's folder in terminal & get its dependencies: dart pub get
  • Go through Implementation Process
  • Import the library in your code and use it. For example:
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
    • If you are importing tests, comments etc. from Turfjs, please make sure you refactor it so it conforms with Dart syntax.
    • Write tests―Keep an eye on Turfjs' implementation
      • run the the test: dart test test/components/XXX.dart
    • Write benchmarks―have a look at our implementation
      • run the benchmark: dart pub run benchmark
  • Commit
  • Convert to real Pull request ready for review
  • Code review / mention a reviewer from contributors list

Documentation

We follow Effective Dart guidelines for documentation.

After going through the Implementation Process, please mention the made changes in README.md

In order to add to this very documentation, please develop CONTRIBUTING.md in documentation branch

GeoJSON Object Model

If you have not read our README.md this diagram will give you a lot of information. Please consider looking our notable design decisions.
polymorphism