Skip to content

Commit

Permalink
refactors boolean_equal
Browse files Browse the repository at this point in the history
  • Loading branch information
armantorkzaban committed Jul 8, 2022
1 parent 5c863e0 commit 29ff2b8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
6 changes: 0 additions & 6 deletions lib/src/booleans/boolean_equal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ bool booleanEqual(
if (!(precision >= 0)) {
throw Exception("precision must be a positive number");
}
var geom = feature1 is Feature ? feature1.geometry : feature1;
var geom2 = feature2 is Feature ? feature2.geometry : feature2;

var type1 = geom!.type;
var type2 = geom2!.type;
if (type1 != type2) return false;

var equality = Equality(
precision: precision,
Expand Down
3 changes: 1 addition & 2 deletions test/booleans/equal_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'package:turf/src/booleans/boolean_equal.dart';

main() {
group(
'boolean_crosses',
'boolean_equal',
() {
var inDir = Directory('./test/examples/booleans/equal/test/true');
for (var file in inDir.listSync(recursive: true)) {
Expand All @@ -23,7 +23,6 @@ main() {
var feature2 = inGeom.features[1];
Map<String, dynamic> json = jsonDecode(inSource);
var options = json['properties'];
print(json['properties']?['direction']);
var result = booleanEqual(feature1, feature2,
precision: options?['precision'] ?? 6,
shiftedPolygon: options?['shiftedPolygon'] ?? false,
Expand Down

0 comments on commit 29ff2b8

Please sign in to comment.