s2geometry 0.1.1

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

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 packages get

Alternatively, your editor might support pub get or flutter packages 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]
46
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
69
Learn more about scoring.

We analyzed this package on Sep 18, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.3

Platforms

Detected platforms: Flutter, web, other

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

Suggestions

The description is too short.

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Format lib/src/r2point.dart.

Run dartfmt to format lib/src/r2point.dart.

Fix lib/src/s2cell_id.dart.

Analysis of lib/src/s2cell_id.dart reported 2 hints:

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

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

Format lib/src/s2coords.dart.

Run dartfmt to format lib/src/s2coords.dart.

Format lib/src/s2latlng.dart.

Run dartfmt to format lib/src/s2latlng.dart.

Format lib/src/util/bits/bits.dart.

Run dartfmt to format lib/src/util/bits/bits.dart.

Dependencies

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