s2geometry 0.1.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 70

dart_s2geometry #

Dart port of the C++ s2geometry and Go geo libraries.

Usage #

A simple usage example:

import 'package:s2geometry/s2geometry.dart';

main() {
  S2LatLng latLng = new S2LatLng.fromDegrees(49.703498679, 11.770681595);
  S2CellId cellId = new S2CellId.fromLatLng(latLng);
  print(cellId.toToken());
}

Notes #

This library depends on int being a 64 bit signed integer, and thus may not work under JavaScript targets.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.1.1 #

  • Create S2CellId from S2LatLng
  • Make S2CellId token
  • Get parent levels of S2CellId

example/s2geometry_example.dart

import 'package:s2geometry/s2geometry.dart';

main() {
  S2LatLng latLng = new S2LatLng.fromDegrees(49.703498679, 11.770681595);
  S2CellId cellId = new S2CellId.fromLatLng(latLng);
  print(cellId.toToken());
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  s2geometry: ^0.1.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:s2geometry/s2geometry.dart';
  
Version Uploaded Documentation Archive
0.1.1 Aug 29, 2018 Go to the documentation of s2geometry 0.1.1 Download s2geometry 0.1.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
53
Health:
Code health derived from static analysis. [more]
93
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

We analyzed this package on Jun 25, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.2
  • pana: 0.12.18

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:s2geometry/s2geometry.dart.

Health issues and suggestions

Document public APIs. (-0.43 points)

51 out of 52 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/s2cell_id.dart. (-3.45 points)

Analysis of lib/src/s2cell_id.dart reported 7 hints, including:

line 29 col 11: The top level variable '_kFaceBits' isn't used.

line 30 col 11: The top level variable '_kNumFaces' isn't used.

line 91 col 77: Use ; instead of {} for empty constructor bodies.

line 94 col 60: Use ; instead of {} for empty constructor bodies.

line 135 col 7: DO use curly braces for all flow control structures.

Fix lib/src/s2coords.dart. (-1.99 points)

Analysis of lib/src/s2coords.dart reported 4 hints:

line 41 col 5: DO use curly braces for all flow control structures.

line 43 col 5: DO use curly braces for all flow control structures.

line 48 col 5: DO use curly braces for all flow control structures.

line 50 col 5: DO use curly braces for all flow control structures.

Fix lib/src/s1angle.dart. (-1.49 points)

Analysis of lib/src/s1angle.dart reported 3 hints:

line 23 col 30: Use ; instead of {} for empty constructor bodies.

line 25 col 60: Use ; instead of {} for empty constructor bodies.

line 27 col 75: Use ; instead of {} for empty constructor bodies.

Fix additional 3 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/r2point.dart (Run dartfmt to format lib/src/r2point.dart.)
  • lib/src/s2latlng.dart (Run dartfmt to format lib/src/s2latlng.dart.)
  • lib/src/util/bits/bits.dart (Run dartfmt to format lib/src/util/bits/bits.dart.)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
test ^1.0.0