dart_jts 0.0.5+2

Dart JTS #

pub package Build Status

dart_jts is an ongoing effort to port the Java Topology Suite to the dart programming language and make it available to its mobile, dektop and web environments.

dart_jts is derivative work of JTS Topology Suite.

It is currently developed by HydroloGIS.

Project License #

Copyright (C) 2019 HydroloGIS

The project is distributed under the Eclipse Distribution License - v 1.0, the same as the JTS project itself.

example/main.dart

import 'package:dart_jts/dart_jts.dart';

main() {
  String polygon1Wkt = "POLYGON (( 0 0, 100 0, 100 100, 0 100, 0 0 ))";
  String polygon2Wkt = "POLYGON (( 50 50, 150 50, 150 150, 50 150, 50 50 ))";

  WKTReader reader = WKTReader();

  var p1 = reader.read(polygon1Wkt);
  var p2 = reader.read(polygon2Wkt);

  if (p1.intersects(p2)) {
    print("Yeah!");
  } else {
    print("Something's very wrong!");
  }

  print("For many many many examples, have a look at the testcases!");
}

Use this package as a library

1. Depend on it

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


dependencies:
  dart_jts: ^0.0.5+2

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:dart_jts/dart_jts.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
47
Health:
Code health derived from static analysis. [more]
75
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
68
Overall:
Weighted score of the above. [more]
60
Learn more about scoring.

We analyzed this package on Jan 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health suggestions

Fix lib/src/com/hydrologis/dart_jts/algorithm/algorithm.dart. (-25 points)

Analysis of lib/src/com/hydrologis/dart_jts/algorithm/algorithm.dart reported 131 hints, including:

line 133 col 13: Unnecessary new keyword.

line 134 col 13: Unnecessary new keyword.

line 135 col 13: Unnecessary new keyword.

line 137 col 13: Unnecessary new keyword.

line 138 col 13: Unnecessary new keyword.

Fix lib/src/com/hydrologis/dart_jts/algorithm/distance.dart. (-25 points)

Analysis of lib/src/com/hydrologis/dart_jts/algorithm/distance.dart reported 73 hints, including:

line 3 col 1: Prefer using /// for doc comments.

line 13 col 3: Prefer using /// for doc comments.

line 21 col 18: Unnecessary new keyword.

line 32 col 79: Unnecessary new keyword.

line 121 col 9: Use isEmpty instead of length

Fix lib/src/com/hydrologis/dart_jts/geom/geom.dart. (-25 points)

Analysis of lib/src/com/hydrologis/dart_jts/geom/geom.dart reported 93 hints, including:

line 365 col 1: Prefer using /// for doc comments.

line 375 col 3: Prefer using /// for doc comments.

line 378 col 3: Prefer using /// for doc comments.

line 381 col 3: Prefer using /// for doc comments.

line 384 col 3: Prefer using /// for doc comments.

Fix additional 33 files with analysis or formatting issues. (-446.51 points)

Additional issues in the following files:

  • lib/src/com/hydrologis/dart_jts/geom/geometry.dart (118 hints)
  • lib/src/com/hydrologis/dart_jts/geom/linestring.dart (72 hints)
  • lib/src/com/hydrologis/dart_jts/geomgraph/geomgraph.dart (233 hints)
  • lib/src/com/hydrologis/dart_jts/index/strtree.dart (104 hints)
  • lib/src/com/hydrologis/dart_jts/math/math.dart (95 hints)
  • lib/src/com/hydrologis/dart_jts/noding/noding.dart (145 hints)
  • lib/src/com/hydrologis/dart_jts/operation/buffer.dart (210 hints)
  • lib/src/com/hydrologis/dart_jts/operation/operation.dart (129 hints)
  • lib/src/com/hydrologis/dart_jts/util/avltree.dart (70 hints)
  • lib/src/com/hydrologis/dart_jts/geomgraph/index.dart (57 hints)
  • lib/src/com/hydrologis/dart_jts/operation/relate.dart (52 hints)
  • lib/src/com/hydrologis/dart_jts/operation/predicate.dart (48 hints)
  • lib/src/com/hydrologis/dart_jts/geom/util.dart (41 hints)
  • lib/src/com/hydrologis/dart_jts/io/wkb.dart (35 hints)
  • lib/src/com/hydrologis/dart_jts/index/chain.dart (31 hints)
  • lib/src/com/hydrologis/dart_jts/operation/buffer_validate.dart (23 hints)
  • lib/src/com/hydrologis/dart_jts/util/geom_impl.dart (23 hints)
  • lib/src/com/hydrologis/dart_jts/algorithm/locate.dart (22 hints)
  • lib/src/com/hydrologis/dart_jts/operation/valid.dart (21 hints)
  • lib/src/com/hydrologis/dart_jts/geom/polygon.dart (19 hints)
  • lib/src/com/hydrologis/dart_jts/io/io.dart (17 hints)
  • lib/src/com/hydrologis/dart_jts/operation/overlay.dart (17 hints)
  • lib/src/com/hydrologis/dart_jts/geom/geometry_collection.dart (16 hints)
  • lib/src/com/hydrologis/dart_jts/util/util.dart (14 hints)
  • lib/src/com/hydrologis/dart_jts/geom/point.dart (12 hints)
  • lib/src/com/hydrologis/dart_jts/geom/multilinestring.dart (8 hints)
  • lib/src/com/hydrologis/dart_jts/geom/multipoint.dart (7 hints)
  • lib/src/com/hydrologis/dart_jts/geom/multipolygon.dart (7 hints)
  • lib/src/com/hydrologis/dart_jts/index/index.dart (5 hints)
  • lib/src/com/hydrologis/dart_jts/geom/coordinate.dart (2 hints)
  • lib/src/com/hydrologis/dart_jts/util.dart (2 hints)
  • lib/dart_jts.dart (Run dartfmt to format lib/dart_jts.dart.)
  • lib/src/com/hydrologis/dart_jts/geom/envelope.dart (Run dartfmt to format lib/src/com/hydrologis/dart_jts/geom/envelope.dart.)

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

The package description is too short. (-2 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.4.0 <3.0.0
collection ^1.14.11 1.14.12
hex ^0.1.2 0.1.2
intl ^0.16.1 0.16.1
Transitive dependencies
path 1.6.4
Dev dependencies
pedantic ^1.9.0
test ^1.11.0