dart_jts 0.0.4+2

  • Readme
  • Example
  • Installing
  • new24

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.4+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]
22
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
68
Overall:
Weighted score of the above. [more]
24
Learn more about scoring.

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

  • Dart: 2.6.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

Fix lib/src/com/hydrologis/dart_jts/geomgraph/geomgraph.dart. (-69.05 points)

Analysis of lib/src/com/hydrologis/dart_jts/geomgraph/geomgraph.dart reported 234 hints, including:

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

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

line 17 col 12: Unnecessary new keyword.

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

line 29 col 35: Unnecessary new keyword.

Fix lib/src/com/hydrologis/dart_jts/operation/operation.dart. (-47.62 points)

Analysis of lib/src/com/hydrologis/dart_jts/operation/operation.dart reported 129 hints, including:

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

line 19 col 24: Unnecessary new keyword.

line 20 col 28: Unnecessary new keyword.

line 22 col 19: Unnecessary new keyword.

line 22 col 31: Unnecessary new keyword.

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

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

line 140 col 10: Don't explicitly initialize variables to null.

line 320 col 21: Unnecessary new keyword.

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

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

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

Fix additional 29 files with analysis or formatting issues. (-409.40 points)

Additional issues in the following files:

  • lib/src/com/hydrologis/dart_jts/index/strtree.dart (106 hints)
  • lib/src/com/hydrologis/dart_jts/algorithm/algorithm.dart (98 hints)
  • lib/src/com/hydrologis/dart_jts/math/math.dart (93 hints)
  • lib/src/com/hydrologis/dart_jts/geom/linestring.dart (72 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/algorithm/distance.dart (46 hints)
  • lib/src/com/hydrologis/dart_jts/geom/geom.dart (45 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/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/util/util.dart (17 hints)
  • lib/src/com/hydrologis/dart_jts/geom/geometry_collection.dart (16 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/operation/overlay.dart (4 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.0 0.16.0
Transitive dependencies
path 1.6.4
Dev dependencies
pedantic ^1.8.0+1
test ^1.9.4