diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4c566dc8..a78adf91 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,6 +20,42 @@ To put it simply, be kind to each other. - Clone the repository: ```git clone git@github.com:dartclub/turf_dart.git``` - Navigate to project's folder in terminal & get its dependencies: ```dart pub get``` - Go through [Implementation Process](#implementation-process) +- Import the library in your code and use it. For example: +```dart +import 'package:turf/helpers.dart'; +import 'package:turf/src/line_segment.dart'; + + Feature poly = Feature( + geometry: Polygon(coordinates: [ + [ + Position(0, 0), + Position(2, 2), + Position(0, 1), + Position(0, 0), + ], + [ + Position(0, 0), + Position(1, 1), + Position(0, 1), + Position(0, 0), + ], + ]), + ); + +var total = segmentReduce(poly, (previousValue, + currentSegment, + initialValue, + featureIndex, + multiFeatureIndex, + geometryIndex, + segmentIndex) { + if (previousValue != null) { + previousValue++; + } + return previousValue; + }, 0, combineNestedGeometries: false); +// total.length == 6 +``` ## Structure of modules ``` @@ -56,4 +92,4 @@ In order to add to this very documentation, please develop CONTRIBUTING.md in [d ## GeoJSON Object Model If you have not read our [README.md](https://github.com/dartclub/turf_dart/blob/main/README.md) this diagram will give you a lot of information. Please consider looking our [notable design decisions](https://github.com/dartclub/turf_dart/blob/main/README.md#notable-design-decisions). -![polymorphism](https://user-images.githubusercontent.com/10634693/159876354-f9da2f37-02b3-4546-b32a-c0f82c372272.png) \ No newline at end of file +![polymorphism](https://user-images.githubusercontent.com/10634693/159876354-f9da2f37-02b3-4546-b32a-c0f82c372272.png) diff --git a/README.md b/README.md index e63bbfeb..bd066e46 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Most of the implementation is a direct translation from [turf.js](https://github - Get the [Dart tools](https://dart.dev/tools) - Install the library with `dart pub add turf` - Import the library in your code and use it. For example: + ```dart import 'package:turf/helpers.dart'; import 'package:turf/src/line_segment.dart'; @@ -36,7 +37,7 @@ Feature poly = Feature( ]), ); -main() { +void main() { var total = segmentReduce( poly, (previousValue, currentSegment, initialValue, featureIndex, @@ -145,7 +146,7 @@ Any new benchmarks must be named `*_benchmark.dart` and reside in the - [ ] kinks - [ ] lineArc - [ ] lineChunk -- [ ] lineIntersect +- [ ] [lineIntersect](https://github.com/dartclub/turf_dart/blob/main/lib/src/line_intersect.dart) - [ ] lineOverlap - [x] [lineSegment](https://github.com/dartclub/turf_dart/blob/main/lib/src/line_segment.dart) - [ ] lineSlice @@ -207,8 +208,6 @@ Any new benchmarks must be named `*_benchmark.dart` and reside in the - [x] [featureReduce](https://github.com/dartclub/turf_dart/blob/main/lib/src/meta/feature.dart) - [x] [flattenEach](https://github.com/dartclub/turf_dart/blob/main/lib/src/meta/flatten.dart) - [x] [flattenReduce](https://github.com/dartclub/turf_dart/blob/main/lib/src/meta/flatten.dart) -- [x] [getCoord](https://github.com/dartclub/turf_dart/blob/main/lib/src/meta/coord.dart) -- [x] [getCoords](https://github.com/dartclub/turf_dart/blob/main/lib/src/meta/coord.dart) - [x] [geomEach](https://github.com/dartclub/turf_dart/blob/main/lib/src/meta/geom.dart) - [x] [geomReduce](https://github.com/dartclub/turf_dart/blob/main/lib/src/meta/geom.dart) - [x] [propEach](https://github.com/dartclub/turf_dart/blob/main/lib/src/meta/prop.dart) @@ -219,19 +218,25 @@ Any new benchmarks must be named `*_benchmark.dart` and reside in the - [x] [clusterEach](https://github.com/dartclub/turf_dart/blob/main/lib/src/meta/cluster.dart) - [x] [clusterReduce](https://github.com/dartclub/turf_dart/blob/main/lib/src/meta/cluster.dart) +### Invariants + +- [x] [getCoord](https://github.com/dartclub/turf_dart/blob/main/lib/src/meta/coord.dart) +- [x] [getCoords](https://github.com/dartclub/turf_dart/blob/main/lib/src/invariant.dart) +- [x] [getGeom](https://github.com/dartclub/turf_dart/blob/main/lib/src/invariant.dart) + ### Booleans -- [ ] booleanClockwise -- [ ] booleanConcave -- [ ] booleanContains -- [ ] booleanCrosses -- [ ] booleanDisjoint -- [ ] booleanEqual -- [ ] booleanIntersects +- [x] [booleanClockwise](https://github.com/dartclub/turf_dart/blob/main/lib/src/booleans/boolean_clockwise.dart) +- [x] [booleanConcave](https://github.com/dartclub/turf_dart/blob/main/lib/src/booleans/boolean_concave.dart) +- [x] [booleanContains](https://github.com/dartclub/turf_dart/blob/main/lib/src/booleans/boolean_contains.dart) +- [x] [booleanCrosses](https://github.com/dartclub/turf_dart/blob/main/lib/src/booleans/boolean_crosses.dart) +- [x] [booleanDisjoint](https://github.com/dartclub/turf_dart/blob/main/lib/src/booleans/boolean_disjoint.dart) +- [x] [booleanEqual](https://github.com/dartclub/turf_dart/blob/main/lib/src/booleans/boolean_equal.dart) +- [x] [booleanIntersects](https://github.com/dartclub/turf_dart/blob/main/lib/src/booleans/boolean_intersect.dart) - [ ] booleanOverlap -- [ ] booleanParallel -- [ ] booleanPointInPolygon -- [ ] booleanPointOnLine +- [x] [booleanParallel](https://github.com/dartclub/turf_dart/blob/main/lib/src/booleans/boolean_parallel.dart) +- [x] [booleanPointInPolygon](https://github.com/dartclub/turf_dart/blob/main/lib/src/booleans/boolean_point_in_polygon.dart) +- [x] [booleanPointOnLine](https://github.com/dartclub/turf_dart/blob/main/lib/src/booleans/boolean_point_on_line.dart) - [ ] booleanWithin ### Unit Conversion diff --git a/analysis_options.yaml b/analysis_options.yaml index 0b4c885d..f6555aff 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -2,4 +2,4 @@ include: package:dartclub_lint/dart.yaml analyzer: errors: - prefer_generic_function_type_aliases: error \ No newline at end of file + prefer_generic_function_type_aliases: error diff --git a/benchmark/area_benchmark.dart b/benchmark/area_benchmark.dart index 60c0fc6c..178624a6 100644 --- a/benchmark/area_benchmark.dart +++ b/benchmark/area_benchmark.dart @@ -16,7 +16,7 @@ Feature poly = Feature( ]), ); -main() { +void main() { group('area', () { benchmark('simple', () { area(poly); diff --git a/benchmark/explode_benchmark.dart b/benchmark/explode_benchmark.dart index 782e0ff6..52f18084 100644 --- a/benchmark/explode_benchmark.dart +++ b/benchmark/explode_benchmark.dart @@ -12,7 +12,7 @@ var poly = Polygon(coordinates: [ ], ]); -main() { +void main() { group('explode', () { benchmark('simple', () { explode(poly); diff --git a/benchmark/polygon_smooth_benchmark.dart b/benchmark/polygon_smooth_benchmark.dart index a3b5dcbb..9e4d5feb 100644 --- a/benchmark/polygon_smooth_benchmark.dart +++ b/benchmark/polygon_smooth_benchmark.dart @@ -5,7 +5,7 @@ import 'package:benchmark/benchmark.dart'; import 'package:turf/polygon_smooth.dart'; import 'package:turf/turf.dart'; -main() { +void main() { group("turf-polygon-smooth", () { var inDir = Directory('./test/examples/polygonSmooth/in'); for (var file in inDir.listSync(recursive: true)) { diff --git a/example/main.dart b/example/main.dart index 498079ef..0ee0b2be 100644 --- a/example/main.dart +++ b/example/main.dart @@ -18,7 +18,7 @@ Feature poly = Feature( ]), ); -main() { +void main() { var total = segmentReduce( poly, (previousValue, currentSegment, initialValue, featureIndex, diff --git a/lib/src/booleans/boolean_clockwise.dart b/lib/src/booleans/boolean_clockwise.dart new file mode 100644 index 00000000..9333c241 --- /dev/null +++ b/lib/src/booleans/boolean_clockwise.dart @@ -0,0 +1,47 @@ +import 'package:turf/src/invariant.dart'; + +import '../../helpers.dart'; + +/// Takes a ring and return [true] or [false] whether or not the ring is clockwise +/// or counter-clockwise. +/// Takes a [Feature] or[LineString] or a [List] to be +/// evaluated. +/// example: +/// ```dart +/// var clockwiseRing = LineString( +/// coordinates: [ +/// Position.of([0, 0]), +/// Position.of([1, 1]), +/// Position.of([1, 0]), +/// Position.of([0, 0]) +/// ], +/// ); +/// var counterClockwiseRing = LineString( +/// coordinates: [ +/// Position.of([0, 0]), +/// Position.of([1, 0]), +/// Position.of([1, 1]), +/// Position.of([0, 0]) +/// ], +/// ); +/// +/// booleanClockwise(clockwiseRing); +/// //=true +/// booleanClockwise(counterClockwiseRing); +/// //=false +/// ``` +bool booleanClockwise(LineString line) { + var ring = getCoords(line) as List; + num sum = 0; + int i = 1; + Position prev; + Position? cur; + + while (i < ring.length) { + prev = cur ?? ring[0]; + cur = ring[i]; + sum += (cur[0]! - prev[0]!) * (cur[1]! + prev[1]!); + i++; + } + return sum > 0; +} diff --git a/lib/src/booleans/boolean_concave.dart b/lib/src/booleans/boolean_concave.dart new file mode 100644 index 00000000..1e13e193 --- /dev/null +++ b/lib/src/booleans/boolean_concave.dart @@ -0,0 +1,42 @@ +import 'package:turf/helpers.dart'; + +/// Takes a [Polygon] and returns [true] or [false] as to whether it is concave +/// or not. +/// example: +/// ```dart +/// var convexPolygon = Polygon(coordinates: [ +/// [ +/// Position.of([0, 0]), +/// Position.of([0, 1]), +/// Position.of([1, 1]), +/// Position.of([1, 0]), +/// Position.of([0, 0]) +/// ] +/// ]); +/// booleanConcave(convexPolygon); +/// //=false +/// ``` +bool booleanConcave(Polygon polygon) { + // Taken from https://stackoverflow.com/a/1881201 & https://stackoverflow.com/a/25304159 + List> coords = polygon.coordinates; + + if (coords[0].length <= 4) { + return false; + } + + var sign = false; + var n = coords[0].length - 1; + for (var i = 0; i < n; i++) { + var dx1 = coords[0][(i + 2) % n][0]! - coords[0][(i + 1) % n][0]!; + var dy1 = coords[0][(i + 2) % n][1]! - coords[0][(i + 1) % n][1]!; + var dx2 = coords[0][i][0]! - coords[0][(i + 1) % n][0]!; + var dy2 = coords[0][i][1]! - coords[0][(i + 1) % n][1]!; + var zcrossproduct = dx1 * dy2 - dy1 * dx2; + if (i == 0) { + sign = zcrossproduct > 0; + } else if (sign != zcrossproduct > 0) { + return true; + } + } + return false; +} diff --git a/lib/src/booleans/boolean_contains.dart b/lib/src/booleans/boolean_contains.dart new file mode 100644 index 00000000..eeeb7260 --- /dev/null +++ b/lib/src/booleans/boolean_contains.dart @@ -0,0 +1,185 @@ +import 'package:turf/src/invariant.dart'; +import 'package:turf/turf.dart'; + +import 'boolean_point_in_polygon.dart'; +import 'boolean_point_on_line.dart'; + +/// [booleanContains] returns [true] if the second geometry is completely contained +/// by the first geometry. +/// The interiors of both geometries must intersect and, the interior and +/// boundary of the secondary must not intersect the exterior of the primary. +/// [booleanContains] returns the exact opposite result of the [booleanWithin]. +/// example: +/// ```dart +/// var line = LineString(coordinates: [ +/// Position.of([1, 1]), +/// Position.of([1, 2]), +/// Position.of([1, 3]), +/// Position.of([1, 4]) +/// ]); +/// var point = Point(coordinates: Position.of([1, 2])); +/// booleanContains(line, point); +/// //=true +/// ``` +bool booleanContains(GeoJSONObject feature1, GeoJSONObject feature2) { + var geom1 = getGeom(feature1); + var geom2 = getGeom(feature2); + + var coords1 = (geom1 as GeometryType).coordinates; + var coords2 = (geom2 as GeometryType).coordinates; + final exception = Exception("{feature2 $geom2 geometry not supported}"); + if (geom1 is Point) { + if (geom2 is Point) { + return coords1 == coords2; + } else { + throw exception; + } + } else if (geom1 is MultiPoint) { + if (geom2 is Point) { + return _isPointInMultiPoint(geom1, geom2); + } else if (geom2 is MultiPoint) { + return _isMultiPointInMultiPoint(geom1, geom2); + } else { + throw exception; + } + } else if (geom1 is LineString) { + if (geom2 is Point) { + return booleanPointOnLine(geom2, geom1, ignoreEndVertices: true); + } else if (geom2 is LineString) { + return _isLineOnLine(geom1, geom2); + } else if (geom2 is MultiPoint) { + return _isMultiPointOnLine(geom1, geom2); + } else { + throw exception; + } + } else if (geom1 is Polygon) { + if (geom2 is Point) { + return booleanPointInPolygon((geom2).coordinates, geom1, + ignoreBoundary: true); + } else if (geom2 is LineString) { + return _isLineInPoly(geom1, geom2); + } else if (geom2 is Polygon) { + return _isPolyInPoly(geom1, geom2); + } else if (geom2 is MultiPoint) { + return _isMultiPointInPoly(geom1, geom2); + } else { + throw exception; + } + } else { + throw exception; + } +} + +bool _isPointInMultiPoint(MultiPoint multiPoint, Point pt) { + for (int i = 0; i < multiPoint.coordinates.length; i++) { + if ((multiPoint.coordinates[i] == pt.coordinates)) { + return true; + } + } + return false; +} + +bool _isMultiPointInMultiPoint(MultiPoint multiPoint1, MultiPoint multiPoint2) { + for (Position coord2 in multiPoint2.coordinates) { + bool match = false; + for (Position coord1 in multiPoint1.coordinates) { + if (coord2 == coord1) { + match = true; + } + } + if (!match) return false; + } + return true; +} + +bool _isMultiPointOnLine(LineString lineString, MultiPoint multiPoint) { + var haveFoundInteriorPoint = false; + for (var coord in multiPoint.coordinates) { + if (booleanPointOnLine(Point(coordinates: coord), lineString, + ignoreEndVertices: true)) { + haveFoundInteriorPoint = true; + } + if (!booleanPointOnLine(Point(coordinates: coord), lineString)) { + return false; + } + } + return haveFoundInteriorPoint; +} + +bool _isMultiPointInPoly(Polygon polygon, MultiPoint multiPoint) { + for (var coord in multiPoint.coordinates) { + if (!booleanPointInPolygon(coord, polygon, ignoreBoundary: true)) { + return false; + } + } + return true; +} + +bool _isLineOnLine(LineString lineString1, LineString lineString2) { + var haveFoundInteriorPoint = false; + for (Position coord in lineString2.coordinates) { + if (booleanPointOnLine( + Point(coordinates: coord), + lineString1, + ignoreEndVertices: true, + )) { + haveFoundInteriorPoint = true; + } + if (!booleanPointOnLine( + Point(coordinates: coord), + lineString1, + ignoreEndVertices: false, + )) { + return false; + } + } + return haveFoundInteriorPoint; +} + +bool _isLineInPoly(Polygon polygon, LineString linestring) { + var polyBbox = bbox(polygon); + var lineBbox = bbox(linestring); + if (!_doBBoxesOverlap(polyBbox, lineBbox)) { + return false; + } + for (var i = 0; i < linestring.coordinates.length - 1; i++) { + var midPoint = + midpointRaw(linestring.coordinates[i], linestring.coordinates[i + 1]); + if (booleanPointInPolygon( + midPoint, + polygon, + ignoreBoundary: true, + )) { + return true; + } + } + return false; +} + +/// Is Polygon2 in Polygon1 +/// Only takes into account outer rings +bool _isPolyInPoly(GeoJSONObject geom1, GeoJSONObject geom2) { + var poly1Bbox = bbox(geom1); + var poly2Bbox = bbox(geom2); + if (!_doBBoxesOverlap(poly1Bbox, poly2Bbox)) { + return false; + } + + for (var ring in (geom2 as GeometryType).coordinates) { + for (var coord in ring) { + if (!booleanPointInPolygon(coord, geom1)) { + return false; + } + } + } + return true; +} + +bool _doBBoxesOverlap(BBox bbox1, BBox bbox2) { + if (bbox1[0]! > bbox2[0]! || + bbox1[2]! < bbox2[2]! || + bbox1[1]! > bbox2[1]! || + bbox1[3]! < bbox2[3]!) return false; + + return true; +} diff --git a/lib/src/booleans/boolean_crosses.dart b/lib/src/booleans/boolean_crosses.dart new file mode 100644 index 00000000..54ccdc54 --- /dev/null +++ b/lib/src/booleans/boolean_crosses.dart @@ -0,0 +1,180 @@ +import 'package:turf/src/invariant.dart'; + +import '../../helpers.dart'; +import '../line_intersect.dart'; +import '../polygon_to_line.dart'; +import 'boolean_point_in_polygon.dart'; + +/// [booleanCrosses] returns [true] if the intersection results in a geometry whose +/// dimension is one less than the maximum dimension of the two source geometries +/// and the intersection set is interior to both source geometries. +/// [booleanCsses] returns [true] for only [MultiPoint]/[Polygon], [MultiPoint]/[LineString], +/// [LineString]/[LineString], [LineString]/[Polygon], and [LineString]/[MultiPolygon] comparisons. +/// Other comparisons are not supported as they are outside the OpenGIS Simple +/// [Feature]s spec and may give unexpected results. +/// example: +/// ```dart +/// var line1 = LineString(coordinates: [ +/// Position.of([-2, 2]), +/// Position.of([4, 2]) +/// ]); +/// var line2 = LineString(coordinates: [ +/// Position.of([1, 1]), +/// Position.of([1, 2]), +/// Position.of([1, 3]), +/// Position.of([1, 4]) +/// ]); +/// var cross = booleanCrosses(line1, line2); +/// //=true +/// ``` +bool booleanCrosses(GeoJSONObject feature1, GeoJSONObject feature2) { + var geom1 = getGeom(feature1); + var geom2 = getGeom(feature2); + + var exception = Exception("$geom2 is not supperted"); + if (geom1 is MultiPoint) { + if (geom2 is LineString) { + return _doMultiPointAndLineStringCross(geom1, geom2); + } else if (geom2 is Polygon) { + return _doesMultiPointCrossPoly(geom1, geom2); + } else { + throw exception; + } + } else if (geom1 is LineString) { + if (geom2 is MultiPoint) { + // An inverse operation + return _doMultiPointAndLineStringCross(geom2, geom1); + } else if (geom2 is LineString) { + return _doLineStringsCross(geom1, geom2); + } else if (geom2 is Polygon) { + return _doLineStringAndPolygonCross(geom1, geom2); + } else { + throw exception; + } + } else if (geom1 is Polygon) { + if (geom2 is MultiPoint) { + // An inverse operation + return _doesMultiPointCrossPoly(geom2, geom1); + } else if (geom2 is LineString) { + // An inverse operation + return _doLineStringAndPolygonCross(geom2, geom1); + } else { + throw exception; + } + } else { + throw exception; + } +} + +bool _doMultiPointAndLineStringCross( + MultiPoint multiPoint, LineString lineString) { + var foundIntPoint = false; + var foundExtPoint = false; + var pointLength = multiPoint.coordinates.length; + var i = 0; + while (i < pointLength && !foundIntPoint && !foundExtPoint) { + for (var i2 = 0; i2 < lineString.coordinates.length - 1; i2++) { + var incEndVertices = true; + if (i2 == 0 || i2 == lineString.coordinates.length - 2) { + incEndVertices = false; + } + if (isPointOnLineSegment( + lineString.coordinates[i2], + lineString.coordinates[i2 + 1], + multiPoint.coordinates[i], + incEndVertices)) { + foundIntPoint = true; + } else { + foundExtPoint = true; + } + } + i++; + } + return foundIntPoint && foundExtPoint; +} + +bool _doLineStringsCross(LineString lineString1, LineString lineString2) { + var doLinesIntersect = lineIntersect(lineString1, lineString2); + if (doLinesIntersect.features.isNotEmpty) { + for (var i = 0; i < lineString1.coordinates.length - 1; i++) { + for (var i2 = 0; i2 < lineString2.coordinates.length - 1; i2++) { + var incEndVertices = true; + if (i2 == 0 || i2 == lineString2.coordinates.length - 2) { + incEndVertices = false; + } + if (isPointOnLineSegment( + lineString1.coordinates[i], + lineString1.coordinates[i + 1], + lineString2.coordinates[i2], + incEndVertices)) { + return true; + } + } + } + } + return false; +} + +bool _doLineStringAndPolygonCross(LineString lineString, Polygon polygon) { + Feature line = polygonToLine(polygon) as Feature; + var doLinesIntersect = lineIntersect(lineString, line); + if (doLinesIntersect.features.isNotEmpty) return true; + + return false; +} + +bool _doesMultiPointCrossPoly(MultiPoint multiPoint, Polygon polygon) { + var foundIntPoint = false; + var foundExtPoint = false; + var pointLength = multiPoint.coordinates.length; + for (var i = 0; i < pointLength && (!foundIntPoint || !foundExtPoint); i++) { + if (booleanPointInPolygon(multiPoint.coordinates[i], polygon)) { + foundIntPoint = true; + } else { + foundExtPoint = true; + } + } + + return foundExtPoint && foundIntPoint; +} + +/// Only takes into account outer rings +/// See http://stackoverflow.com/a/4833823/1979085 +/// lineSegmentStart [Position] of start of line +/// lineSegmentEnd [Position] of end of line +/// pt [Position] of point to check +/// [incEnd] controls whether the [Point] is allowed to fall on the line ends +bool isPointOnLineSegment( + Position lineSegmentStart, + Position lineSegmentEnd, + Position pt, + bool incEnd, +) { + var dxc = pt[0]! - lineSegmentStart[0]!; + var dyc = pt[1]! - lineSegmentStart[1]!; + var dxl = lineSegmentEnd[0]! - lineSegmentStart[0]!; + var dyl = lineSegmentEnd[1]! - lineSegmentStart[1]!; + var cross = dxc * dyl - dyc * dxl; + if (cross != 0) { + return false; + } + if (incEnd) { + if ((dxl).abs() >= (dyl).abs()) { + return dxl > 0 + ? lineSegmentStart[0]! <= pt[0]! && pt[0]! <= lineSegmentEnd[0]! + : lineSegmentEnd[0]! <= pt[0]! && pt[0]! <= lineSegmentStart[0]!; + } + return dyl > 0 + ? lineSegmentStart[1]! <= pt[1]! && pt[1]! <= lineSegmentEnd[1]! + : lineSegmentEnd[1]! <= pt[1]! && pt[1]! <= lineSegmentStart[1]!; + } else { + if ((dxl).abs() >= (dyl).abs()) { + return dxl > 0 + ? lineSegmentStart[0]! < pt[0]! && pt[0]! < lineSegmentEnd[0]! + : lineSegmentEnd[0]! < pt[0]! && pt[0]! < lineSegmentStart[0]!; + } + return dyl > 0 + ? lineSegmentStart[1]! < pt[1]! && pt[1]! < lineSegmentEnd[1]! + : lineSegmentEnd[1]! < pt[1]! && pt[1]! < lineSegmentStart[1]!; + } +} diff --git a/lib/src/booleans/boolean_disjoint.dart b/lib/src/booleans/boolean_disjoint.dart new file mode 100644 index 00000000..ff104ca4 --- /dev/null +++ b/lib/src/booleans/boolean_disjoint.dart @@ -0,0 +1,125 @@ +import 'package:turf/src/booleans/boolean_crosses.dart'; + +import '../../helpers.dart'; +import '../../meta.dart'; +import '../line_intersect.dart'; +import '../polygon_to_line.dart'; +import 'boolean_point_in_polygon.dart'; + +/// Returns [true] if the intersection of the two geometries is an empty set. +/// example: +/// ```dart +/// var point = Point(coordinates: Position.of([2, 2])); +/// var line = LineString( +/// coordinates: [ +/// Position.of([1, 1]), +/// Position.of([1, 2]), +/// Position.of([1, 3]), +/// Position.of([1, 4]) +/// ], +/// ); +/// booleanDisjoint(line, point); +/// //=true +/// ``` +bool booleanDisjoint(GeoJSONObject feature1, GeoJSONObject feature2) { + var bool = true; + flattenEach( + feature1, + (flatten1, featureIndex, multiFeatureIndex) { + flattenEach( + feature2, + (flatten2, featureIndex, multiFeatureIndex) { + if (!bool) { + return bool; + } + bool = _disjoint(flatten1.geometry!, flatten2.geometry!); + }, + ); + }, + ); + return bool; +} + +/// Disjoint operation for simple Geometries ([Point]/[LineString]/[Polygon]) +bool _disjoint(GeometryType geom1, GeometryType geom2) { + if (geom1 is Point) { + if (geom2 is Point) { + return geom1.coordinates != geom2.coordinates; + } else if (geom2 is LineString) { + return !_isPointOnLine(geom2, geom1); + } else if (geom2 is Polygon) { + return !booleanPointInPolygon((geom1).coordinates, geom2); + } + } else if (geom1 is LineString) { + if (geom2 is Point) { + return !_isPointOnLine(geom1, geom2); + } else if (geom2 is LineString) { + return !_isLineOnLine(geom1, geom2); + } else if (geom2 is Polygon) { + return !_isLineInPoly(geom2, geom1); + } + } else if (geom1 is Polygon) { + if (geom2 is Point) { + return !booleanPointInPolygon((geom2).coordinates, geom1); + } else if (geom2 is LineString) { + return !_isLineInPoly(geom1, geom2); + } else if (geom2 is Polygon) { + return !_isPolyInPoly(geom2, geom1); + } + } + return false; +} + +// http://stackoverflow.com/a/11908158/1979085 +bool _isPointOnLine(LineString lineString, Point pt) { + for (var i = 0; i < lineString.coordinates.length - 1; i++) { + if (isPointOnLineSegment(lineString.coordinates[i], + lineString.coordinates[i + 1], pt.coordinates, true)) { + return true; + } + } + return false; +} + +bool _isLineOnLine(LineString lineString1, LineString lineString2) { + var doLinesIntersect = lineIntersect(lineString1, lineString2); + if (doLinesIntersect.features.isNotEmpty) { + return true; + } + return false; +} + +bool _isLineInPoly(Polygon polygon, LineString lineString) { + for (var coord in lineString.coordinates) { + if (booleanPointInPolygon(coord, polygon)) { + return true; + } + } + var doLinesIntersect = lineIntersect(lineString, polygonToLine(polygon)); + if (doLinesIntersect.features.isNotEmpty) { + return true; + } + return false; +} + +/// Is [Polygon] (geom1) in [Polygon] (geom2) +/// Only takes into account outer rings +/// See http://stackoverflow.com/a/4833823/1979085 +bool _isPolyInPoly(Polygon feature1, Polygon feature2) { + for (var coord1 in feature1.coordinates[0]) { + if (booleanPointInPolygon(coord1, feature2)) { + return true; + } + } + for (var coord2 in feature2.coordinates[0]) { + if (booleanPointInPolygon(coord2, feature1)) { + return true; + } + } + var doLinesIntersect = + lineIntersect(polygonToLine(feature1), polygonToLine(feature2)); + if (doLinesIntersect.features.isNotEmpty) { + return true; + } + return false; +} diff --git a/lib/src/booleans/boolean_equal.dart b/lib/src/booleans/boolean_equal.dart new file mode 100644 index 00000000..6fadc741 --- /dev/null +++ b/lib/src/booleans/boolean_equal.dart @@ -0,0 +1,41 @@ +import 'package:turf_equality/turf_equality.dart'; + +import '../../helpers.dart'; +import '../clean_coords.dart'; + +/// Determine whether two geometries of the same type have identical X,Y coordinate values. +/// See http://edndoc.esri.com/arcsde/9.0/general_topics/understand_spatial_relations.htm +/// [precision]=6 sets decimal precision to use when comparing coordinates. +/// With [direction] set to [true], even if the [LineString]s are reverse versions +/// of each other but they have similar [Position]s, they will be considered the +/// same. If [shiftedPolygon] is [true], two [Polygon]s with shifted [Position]s +/// are considered the same. +/// Returns [true] if the objects are equal, [false] otherwise +/// example: +/// ```dart +/// var pt1 = Point(coordinates: Position.of([0, 0])); +/// var pt2 = Point(coordinates: Position.of([0, 0])); +/// var pt3 = Point(coordinates: Position.of([1, 1])); +/// booleanEqual(pt1, pt2); +/// //= true +/// booleanEqual(pt2, pt3); +/// //= false +/// ``` +bool booleanEqual( + GeoJSONObject feature1, + GeoJSONObject feature2, { + int precision = 6, + bool direction = false, + bool shiftedPolygon = false, +}) { + if (precision < 0 || precision > 17) { + throw Exception("precision must be a positive number and smaller than 15"); + } + + var equality = Equality( + precision: precision, + shiftedPolygons: shiftedPolygon, + reversedGeometries: direction, + ); + return equality.compare(cleanCoords(feature1), cleanCoords(feature2)); +} diff --git a/lib/src/booleans/boolean_intersects.dart b/lib/src/booleans/boolean_intersects.dart new file mode 100644 index 00000000..2c978701 --- /dev/null +++ b/lib/src/booleans/boolean_intersects.dart @@ -0,0 +1,32 @@ +import '../../helpers.dart'; +import '../../meta.dart'; +import 'boolean_disjoint.dart'; + +/// Returns [true] when two geometries intersect. +/// Takes [feature1] & [feature2] parameters of type [GeoJSONObject] which can be +/// a [Feature] or [GeometryType]. +/// example +/// ```dart +/// var point = Point(coordinates:Position.of([2, 2])); +/// var line = LineString(coordinates:[Position.of([1, 1]), Position.of([1, 2]), Position.of([1, 3]), Position.of([1, 4]])); +/// booleanIntersects(line, point); +/// //=true +/// ``` +bool booleanIntersects(GeoJSONObject feature1, GeoJSONObject feature2) { + var result = false; + flattenEach( + feature1, + (flatten1, featureIndex, multiFeatureIndex) { + flattenEach( + feature2, + (flatten2, featureIndex, multiFeatureIndex) { + if (result) { + return true; + } + result = !booleanDisjoint(flatten1, flatten2); + }, + ); + }, + ); + return result; +} diff --git a/lib/src/booleans/boolean_parallel.dart b/lib/src/booleans/boolean_parallel.dart new file mode 100644 index 00000000..8f446f57 --- /dev/null +++ b/lib/src/booleans/boolean_parallel.dart @@ -0,0 +1,46 @@ +import 'package:turf/src/rhumb_bearing.dart'; + +import '../../helpers.dart'; +import '../../line_segment.dart'; +import '../clean_coords.dart'; + +/// Returns [true] if each segment of [line1] is parallel to the correspondent +/// segment of [line2] +/// example: +/// ```dart +/// var line1 = LineString( +/// coordinates: [ +/// Position.of([0, 0]), +/// Position.of([0, 1]) +/// ], +/// ); +/// var line2 = LineString( +/// coordinates: [ +/// Position.of([1, 0]), +/// Position.of([1, 1]) +/// ], +/// ); +/// booleanParallel(line1, line2); +/// //=true +/// ``` +bool booleanParallel(LineString line1, LineString line2) { + FeatureCollection segments1 = lineSegment(cleanCoords(line1)); + FeatureCollection segments2 = lineSegment(cleanCoords(line2)); + for (int i = 0; i < segments1.features.length; i++) { + var segment1 = segments1.features[i].geometry!.coordinates; + var seg2i = segments2.features.asMap().containsKey(i); + if (!seg2i) break; + var segment2 = segments2.features[i].geometry!.coordinates; + if (!_isParallel(segment1, segment2)) return false; + } + return true; +} + +/// Compares slopes and returns result +bool _isParallel(List segment1, List segment2) { + var slope1 = bearingToAzimuth(rhumbBearing( + Point(coordinates: segment1[0]), Point(coordinates: segment1[1]))); + var slope2 = bearingToAzimuth(rhumbBearing( + Point(coordinates: segment2[0]), Point(coordinates: segment2[1]))); + return slope1 == slope2; +} diff --git a/lib/src/booleans/boolean_point_in_polygon.dart b/lib/src/booleans/boolean_point_in_polygon.dart new file mode 100644 index 00000000..1f297e06 --- /dev/null +++ b/lib/src/booleans/boolean_point_in_polygon.dart @@ -0,0 +1,69 @@ +// http://en.wikipedia.org/wiki/Even%E2%80%93odd_rule +// modified from: https://github.com/substack/point-in-polygon/blob/master/index.js +// which was modified from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html + +import 'package:turf_pip/turf_pip.dart'; + +import '../../helpers.dart'; +import '../invariant.dart'; + +/// Takes a [Point], and a [Polygon] or [MultiPolygon]and determines if the +/// [Point] resides within the [Polygon]. The [Polygon] can be convex or concave. +/// The function accounts for holes. By taking a [Feature] or a +/// [Feature]<[MultiPolygon]>. [ignoreBoundary=false] should be set to [true] if +/// [Polygon]'s boundary should be ignored when determining if the [Point] is +/// inside the [Polygon], otherwise, false. +/// example: +/// ```dart +/// var pt = Point(coordinates: Position([-77, 44])); +/// var poly = Polygon(coordinates:[[ +/// Position.of([-81, 41]), +/// Position.of([-81, 47]), +/// Position.of([-72, 47]), +/// Position.of([-72, 41]), +/// Position.of([-81, 41]) +/// ]]); +/// turf.booleanPointInPolygon(pt, poly); +/// //= true +/// ``` +bool booleanPointInPolygon( + Position point, + GeoJSONObject polygon, { + bool ignoreBoundary = false, +}) { + List>>? polys; + BBox? bbox = polygon.bbox; + + var theGeom = getGeom(polygon); + if (theGeom is Polygon) { + polys = [theGeom.coordinates]; + } else if (theGeom is MultiPolygon) { + polys = theGeom.coordinates; + } else { + throw Exception('${polygon.type} is not supported'); + } + + // Quick elimination if point is not inside bbox + if (bbox != null && !_inBBox(point, bbox)) { + return false; + } + + for (var i = 0; i < polys.length; ++i) { + var polyResult = pointInPolygon( + Point(coordinates: point), Polygon(coordinates: polys[i])); + if (polyResult == PointInPolygonResult.isOnEdge) { + return ignoreBoundary ? false : true; + } else if (polyResult == PointInPolygonResult.isInside) { + return true; + } + } + + return false; +} + +bool _inBBox(Position pt, BBox bbox) { + return (bbox[0]! <= pt[0]! && + bbox[1]! <= pt[1]! && + bbox[2]! >= pt[0]! && + bbox[3]! >= pt[1]!); +} diff --git a/lib/src/booleans/boolean_point_on_line.dart b/lib/src/booleans/boolean_point_on_line.dart new file mode 100644 index 00000000..ffc0dd5b --- /dev/null +++ b/lib/src/booleans/boolean_point_on_line.dart @@ -0,0 +1,92 @@ +import 'package:turf/helpers.dart'; + +/// Returns [true] if a point is on a line. Accepts an optional parameter to ignore the +/// start and end vertices of the [LineString]. +/// The [ignoreEndVertices=false] controls whether to ignore the start and end vertices. +/// [epsilon] is the Fractional number to compare with the cross product result. +/// It's useful for dealing with floating points in lng/lat +/// example: +/// ```dart +/// var pt = Point(coordinates:Position.of([0, 0])); +/// var line = LineString(coordinates: [ +/// Position.of([-1, -1]), +/// Position.of([1, 1]), +/// Position.of([1.5, 2.2]), +/// ]); +/// var isPointOnLine = booleanPointOnLine(pt, line); +/// //=true +/// ``` +enum BoundaryType { none, start, end, both } + +bool booleanPointOnLine(Point pt, LineString line, + {bool ignoreEndVertices = false, num? epsilon}) { + for (var i = 0; i < line.coordinates.length - 1; i++) { + BoundaryType ignoreBoundary = BoundaryType.none; + if (ignoreEndVertices) { + if (i == 0) { + ignoreBoundary = BoundaryType.start; + } + if (i == line.coordinates.length - 2) { + ignoreBoundary = BoundaryType.end; + } + if (i == 0 && i + 1 == line.coordinates.length - 1) { + ignoreBoundary = BoundaryType.both; + } + } + if (_isPointOnLineSegment(line.coordinates[i], line.coordinates[i + 1], + pt.coordinates, ignoreBoundary, epsilon)) { + return true; + } + } + return false; +} + +// See http://stackoverflow.com/a/4833823/1979085 +// See https://stackoverflow.com/a/328122/1048847 +/// [pt] is the coord pair of the [Point] to check. +/// [excludeBoundary] controls whether the point is allowed to fall on the line ends. +/// [epsilon] is the Fractional number to compare with the cross product result. +/// Useful for dealing with floating points such as lng/lat points. +bool _isPointOnLineSegment(Position lineSegmentStart, Position lineSegmentEnd, + Position pt, BoundaryType excludeBoundary, num? epsilon) { + var x = pt[0]!; + var y = pt[1]!; + var x1 = lineSegmentStart[0]; + var y1 = lineSegmentStart[1]; + var x2 = lineSegmentEnd[0]; + var y2 = lineSegmentEnd[1]; + var dxc = pt[0]! - x1!; + var dyc = pt[1]! - y1!; + var dxl = x2! - x1; + var dyl = y2! - y1; + var cross = dxc * dyl - dyc * dxl; + if (epsilon != null) { + if ((cross).abs() > epsilon) { + return false; + } + } else if (cross != 0) { + return false; + } + if (excludeBoundary == BoundaryType.none) { + if ((dxl).abs() >= (dyl).abs()) { + return dxl > 0 ? x1 <= x && x <= x2 : x2 <= x && x <= x1; + } + return dyl > 0 ? y1 <= y && y <= y2 : y2 <= y && y <= y1; + } else if (excludeBoundary == BoundaryType.start) { + if ((dxl).abs() >= (dyl).abs()) { + return dxl > 0 ? x1 < x && x <= x2 : x2 <= x && x < x1; + } + return dyl > 0 ? y1 < y && y <= y2 : y2 <= y && y < y1; + } else if (excludeBoundary == BoundaryType.end) { + if ((dxl).abs() >= (dyl).abs()) { + return dxl > 0 ? x1 <= x && x < x2 : x2 < x && x <= x1; + } + return dyl > 0 ? y1 <= y && y < y2 : y2 < y && y <= y1; + } else if (excludeBoundary == BoundaryType.both) { + if ((dxl).abs() >= (dyl).abs()) { + return dxl > 0 ? x1 < x && x < x2 : x2 < x && x < x1; + } + return dyl > 0 ? y1 < y && y < y2 : y2 < y && y < y1; + } + return false; +} diff --git a/lib/src/booleans/boolean_touches.dart b/lib/src/booleans/boolean_touches.dart new file mode 100644 index 00000000..79109e90 --- /dev/null +++ b/lib/src/booleans/boolean_touches.dart @@ -0,0 +1,592 @@ +import 'package:turf/src/invariant.dart'; + +import '../../helpers.dart'; +import 'boolean_point_in_polygon.dart'; +import 'boolean_point_on_line.dart'; + +/// Boolean-touches [true] if none of the [Point]s common to both geometries +/// intersect the interiors of both geometries. +/// example +/// ```dart +/// var line = LineString(coordinates;[Positin.of([1, 1]), Positin.of([1, 2]), Positin.of([1, 3]), Positin.of([1, 4])]); +/// var point = Point(coordinates: Positon.of([1, 1])); +/// booleanTouches(point, line); +/// //=true +/// ``` +bool booleanTouches(GeoJSONObject feature1, GeoJSONObject feature2) { + var geom1 = getGeom(feature1); + var geom2 = getGeom(feature2); + + if (geom1 is Point) { + if (geom2 is LineString) { + return isPointOnLineEnd(geom1, geom2); + } else if (geom2 is MultiLineString) { + var foundTouchingPoint = false; + for (var ii = 0; ii < geom2.coordinates.length; ii++) { + if (isPointOnLineEnd( + geom1, + LineString( + coordinates: geom2.coordinates[ii], + ), + )) { + foundTouchingPoint = true; + } + } + return foundTouchingPoint; + } else if (geom2 is Polygon) { + for (var i = 0; i < geom2.coordinates.length; i++) { + if (booleanPointOnLine( + geom1, + LineString( + coordinates: geom2.coordinates[i], + ), + )) { + return true; + } + } + return false; + } else if (geom2 is MultiPolygon) { + for (var i = 0; i < geom2.coordinates.length; i++) { + for (var ii = 0; ii < geom2.coordinates[i].length; ii++) { + if (booleanPointOnLine( + geom1, + LineString( + coordinates: geom2.coordinates[i][ii], + ), + )) { + return true; + } + } + } + return false; + } else { + throw Exception("feature2 $geom2 geometry not supported"); + } + } else if (geom1 is MultiPoint) { + if (geom2 is LineString) { + var foundTouchingPoint = false; + for (var i = 0; i < geom1.coordinates.length; i++) { + if (!foundTouchingPoint) { + if (isPointOnLineEnd( + Point(coordinates: geom1.coordinates[i]), geom2)) { + foundTouchingPoint = true; + } + } + if (booleanPointOnLine(Point(coordinates: geom1.coordinates[i]), geom2, + ignoreEndVertices: true)) return false; + } + return foundTouchingPoint; + } else if (geom2 is MultiLineString) { + var foundTouchingPoint = false; + for (var i = 0; i < geom1.coordinates.length; i++) { + for (var ii = 0; ii < geom2.coordinates.length; ii++) { + if (!foundTouchingPoint) { + if (isPointOnLineEnd(Point(coordinates: geom1.coordinates[i]), + LineString(coordinates: geom2.coordinates[ii]))) { + foundTouchingPoint = true; + } + } + if (booleanPointOnLine(Point(coordinates: geom1.coordinates[i]), + LineString(coordinates: geom2.coordinates[ii]), + ignoreEndVertices: true)) { + return false; + } + } + } + return foundTouchingPoint; + } else if (geom2 is Polygon) { + var foundTouchingPoint = false; + for (var i = 0; i < geom1.coordinates.length; i++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine( + Point(coordinates: geom1.coordinates[i]), + LineString(coordinates: geom2.coordinates[0]), + )) { + foundTouchingPoint = true; + } + } + if (booleanPointInPolygon(geom1.coordinates[i], geom2, + ignoreBoundary: true)) { + return false; + } + } + return foundTouchingPoint; + } else if (geom2 is MultiPolygon) { + var foundTouchingPoint = false; + for (var i = 0; i < geom1.coordinates.length; i++) { + for (var ii = 0; ii < geom2.coordinates.length; ii++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine( + Point(coordinates: geom1.coordinates[i]), + LineString( + coordinates: geom2.coordinates[ii][0], + ), + )) { + foundTouchingPoint = true; + } + } + if (booleanPointInPolygon( + geom1.coordinates[i], Polygon(coordinates: geom2.coordinates[ii]), + ignoreBoundary: true)) { + return false; + } + } + } + return foundTouchingPoint; + } else { + throw Exception("feature2 $geom2 geometry not supported"); + } + } else if (geom1 is LineString) { + if (geom2 is Point) { + return isPointOnLineEnd(geom2, geom1); + } else if (geom2 is MultiPoint) { + var foundTouchingPoint = false; + for (var i = 0; i < geom2.coordinates.length; i++) { + if (!foundTouchingPoint) { + if (isPointOnLineEnd( + Point(coordinates: geom2.coordinates[i]), geom1)) { + foundTouchingPoint = true; + } + } + if (booleanPointOnLine(Point(coordinates: geom2.coordinates[i]), geom1, + ignoreEndVertices: true)) { + return false; + } + } + return foundTouchingPoint; + } else if (geom2 is LineString) { + var endMatch = false; + if (isPointOnLineEnd(Point(coordinates: geom1.coordinates[0]), geom2)) { + endMatch = true; + } + if (isPointOnLineEnd( + Point( + coordinates: geom1.coordinates[geom1.coordinates.length - 1], + ), + geom2)) endMatch = true; + if (endMatch == false) return false; + for (var i = 0; i < geom1.coordinates.length; i++) { + if (booleanPointOnLine(Point(coordinates: geom1.coordinates[i]), geom2, + ignoreEndVertices: true)) { + return false; + } + } + return endMatch; + } else if (geom2 is MultiLineString) { + var endMatch = false; + for (var i = 0; i < geom2.coordinates.length; i++) { + if (isPointOnLineEnd(Point(coordinates: geom1.coordinates[0]), + LineString(coordinates: geom2.coordinates[i]))) { + endMatch = true; + } + if (isPointOnLineEnd( + Point( + coordinates: geom1.coordinates[geom1.coordinates.length - 1], + ), + LineString(coordinates: geom2.coordinates[i]))) { + endMatch = true; + } + for (var ii = 0; ii < geom1.coordinates[i].length; ii++) { + if (booleanPointOnLine(Point(coordinates: geom1.coordinates[ii]), + LineString(coordinates: geom2.coordinates[i]), + ignoreEndVertices: true)) { + return false; + } + } + } + return endMatch; + } else if (geom2 is Polygon) { + var foundTouchingPoint = false; + for (var i = 0; i < geom1.coordinates.length; i++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine(Point(coordinates: geom1.coordinates[i]), + LineString(coordinates: geom2.coordinates[0]))) { + foundTouchingPoint = true; + } + } + if (booleanPointInPolygon(geom1.coordinates[i], geom2, + ignoreBoundary: true)) { + return false; + } + } + return foundTouchingPoint; + } else if (geom2 is MultiPolygon) { + var foundTouchingPoint = false; + for (var i = 0; i < geom1.coordinates.length; i++) { + for (var ii = 0; ii < geom2.coordinates.length; ii++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine( + Point(coordinates: geom1.coordinates[i]), + LineString( + coordinates: geom2.coordinates[ii][0], + ), + )) { + foundTouchingPoint = true; + } + } + } + if (booleanPointInPolygon(geom1.coordinates[i], geom2, + ignoreBoundary: true)) { + return false; + } + } + return foundTouchingPoint; + } else { + throw Exception("feature2 $geom2 geometry not supported"); + } + } else if (geom1 is MultiLineString) { + if (geom2 is Point) { + for (var i = 0; i < geom1.coordinates.length; i++) { + if (isPointOnLineEnd( + geom2, + LineString( + coordinates: geom1.coordinates[i], + ))) { + return true; + } + } + return false; + } else if (geom2 is MultiPoint) { + var foundTouchingPoint = false; + for (var i = 0; i < geom1.coordinates.length; i++) { + for (var ii = 0; ii < geom2.coordinates.length; ii++) { + if (!foundTouchingPoint) { + if (isPointOnLineEnd(Point(coordinates: geom2.coordinates[ii]), + LineString(coordinates: geom1.coordinates[ii]))) { + foundTouchingPoint = true; + } + } + if (booleanPointOnLine(Point(coordinates: geom2.coordinates[ii]), + LineString(coordinates: geom1.coordinates[ii]), + ignoreEndVertices: true)) { + return false; + } + } + } + return foundTouchingPoint; + } else if (geom2 is LineString) { + var endMatch = false; + for (var i = 0; i < geom1.coordinates.length; i++) { + if (isPointOnLineEnd( + Point(coordinates: geom1.coordinates[i][0]), geom2)) { + endMatch = true; + } + if (isPointOnLineEnd( + Point( + coordinates: geom1.coordinates[i] + [geom1.coordinates[i].length - 1], + ), + geom2)) { + endMatch = true; + } + for (var ii = 0; ii < geom2.coordinates.length; ii++) { + if (booleanPointOnLine(Point(coordinates: geom2.coordinates[ii]), + LineString(coordinates: geom1.coordinates[i]), + ignoreEndVertices: true)) { + return false; + } + } + } + return endMatch; + } else if (geom2 is MultiLineString) { + var endMatch = false; + for (var i = 0; i < geom1.coordinates.length; i++) { + for (var ii = 0; ii < geom2.coordinates.length; ii++) { + if (isPointOnLineEnd(Point(coordinates: geom1.coordinates[i][0]), + LineString(coordinates: geom2.coordinates[ii]))) { + endMatch = true; + } + if (isPointOnLineEnd( + Point( + coordinates: geom1.coordinates[i] + [geom1.coordinates[i].length - 1], + ), + LineString(coordinates: geom2.coordinates[ii]))) { + endMatch = true; + } + for (var iii = 0; iii < geom1.coordinates[i].length; iii++) { + if (booleanPointOnLine( + Point(coordinates: geom1.coordinates[i][iii]), + LineString(coordinates: geom2.coordinates[ii]), + ignoreEndVertices: true)) { + return false; + } + } + } + } + return endMatch; + } else if (geom2 is Polygon) { + var foundTouchingPoint = false; + for (var i = 0; i < geom1.coordinates.length; i++) { + for (var ii = 0; ii < geom1.coordinates.length; ii++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine(Point(coordinates: geom1.coordinates[i][ii]), + LineString(coordinates: geom2.coordinates[0]))) { + foundTouchingPoint = true; + } + } + if (booleanPointInPolygon(geom1.coordinates[i][ii], geom2, + ignoreBoundary: true)) { + return false; + } + } + } + return foundTouchingPoint; + } else if (geom2 is MultiPolygon) { + var foundTouchingPoint = false; + for (var i = 0; i < geom2.coordinates[0].length; i++) { + for (var ii = 0; ii < geom1.coordinates.length; ii++) { + for (var iii = 0; iii < geom1.coordinates[ii].length; iii++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine( + Point( + coordinates: geom1.coordinates[ii][iii], + ), + LineString( + coordinates: geom2.coordinates[0][i], + ))) { + foundTouchingPoint = true; + } + } + if (booleanPointInPolygon(geom1.coordinates[ii][iii], + Polygon(coordinates: [geom2.coordinates[0][i]]), + ignoreBoundary: true)) { + return false; + } + } + } + } + return foundTouchingPoint; + } else { + throw Exception("feature2 $geom2 geometry not supported"); + } + } else if (geom1 is Polygon) { + if (geom2 is Point) { + for (var i = 0; i < geom1.coordinates.length; i++) { + if (booleanPointOnLine( + geom2, + LineString( + coordinates: geom1.coordinates[i], + ))) { + return true; + } + } + return false; + } else if (geom2 is MultiPoint) { + var foundTouchingPoint = false; + for (var i = 0; i < geom2.coordinates.length; i++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine(Point(coordinates: geom2.coordinates[i]), + LineString(coordinates: geom1.coordinates[0]))) { + foundTouchingPoint = true; + } + } + if (booleanPointInPolygon(geom2.coordinates[i], geom1, + ignoreBoundary: true)) return false; + } + return foundTouchingPoint; + } else if (geom2 is LineString) { + var foundTouchingPoint = false; + for (var i = 0; i < geom2.coordinates.length; i++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine(Point(coordinates: geom2.coordinates[i]), + LineString(coordinates: geom1.coordinates[0]))) { + foundTouchingPoint = true; + } + } + if (booleanPointInPolygon(geom2.coordinates[i], geom1, + ignoreBoundary: true)) { + return false; + } + } + return foundTouchingPoint; + } else if (geom2 is MultiLineString) { + var foundTouchingPoint = false; + for (var i = 0; i < geom2.coordinates.length; i++) { + for (var ii = 0; ii < geom2.coordinates[i].length; ii++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine(Point(coordinates: geom2.coordinates[i][ii]), + LineString(coordinates: geom1.coordinates[0]))) { + foundTouchingPoint = true; + } + } + if (booleanPointInPolygon(geom2.coordinates[i][ii], geom1, + ignoreBoundary: true)) { + return false; + } + } + } + return foundTouchingPoint; + } else if (geom2 is Polygon) { + var foundTouchingPoint = false; + for (var i = 0; i < geom1.coordinates[0].length; i++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine( + Point(coordinates: geom1.coordinates[0][i]), + LineString(coordinates: geom2.coordinates[0]), + )) { + foundTouchingPoint = true; + } + } + if (booleanPointInPolygon(geom1.coordinates[0][i], geom2, + ignoreBoundary: true)) { + return false; + } + } + return foundTouchingPoint; + } else if (geom2 is MultiPolygon) { + var foundTouchingPoint = false; + for (var i = 0; i < geom2.coordinates[0].length; i++) { + for (var ii = 0; ii < geom1.coordinates[0].length; ii++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine(Point(coordinates: geom1.coordinates[0][ii]), + LineString(coordinates: geom2.coordinates[0][i]))) { + foundTouchingPoint = true; + } + } + if (booleanPointInPolygon(geom1.coordinates[0][ii], + Polygon(coordinates: [geom2.coordinates[0][i]]), + ignoreBoundary: true)) { + return false; + } + } + } + return foundTouchingPoint; + } else { + throw Exception("feature2 $geom2 geometry not supported"); + } + } else if (geom1 is MultiPolygon) { + if (geom2 is Point) { + for (var i = 0; i < geom1.coordinates[0].length; i++) { + if (booleanPointOnLine( + geom2, + LineString( + coordinates: geom1.coordinates[0][i], + ), + )) { + return true; + } + } + return false; + } else if (geom2 is MultiPoint) { + var foundTouchingPoint = false; + for (var i = 0; i < geom1.coordinates[0].length; i++) { + for (var ii = 0; ii < geom2.coordinates.length; ii++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine(Point(coordinates: geom2.coordinates[ii]), + LineString(coordinates: geom1.coordinates[0][i]))) { + foundTouchingPoint = true; + } + } + if (booleanPointInPolygon(geom2.coordinates[ii], + Polygon(coordinates: [geom1.coordinates[0][i]]), + ignoreBoundary: true)) { + return false; + } + } + } + return foundTouchingPoint; + } else if (geom2 is LineString) { + var foundTouchingPoint = false; + for (var i = 0; i < geom1.coordinates[0].length; i++) { + for (var ii = 0; ii < geom2.coordinates.length; ii++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine(Point(coordinates: geom2.coordinates[ii]), + LineString(coordinates: geom1.coordinates[0][i]))) { + foundTouchingPoint = true; + } + } + if (booleanPointInPolygon(geom2.coordinates[ii], + Polygon(coordinates: [geom1.coordinates[0][i]]), + ignoreBoundary: true)) { + return false; + } + } + } + return foundTouchingPoint; + } else if (geom2 is MultiLineString) { + var foundTouchingPoint = false; + for (var i = 0; i < geom1.coordinates.length; i++) { + for (var ii = 0; ii < geom2.coordinates.length; ii++) { + for (var iii = 0; iii < geom2.coordinates[ii].length; iii++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine( + Point( + coordinates: geom2.coordinates[ii][iii], + ), + LineString( + coordinates: geom1.coordinates[i][0], + ), + )) { + foundTouchingPoint = true; + } + } + if (booleanPointInPolygon(geom2.coordinates[ii][iii], + Polygon(coordinates: [geom1.coordinates[i][0]]), + ignoreBoundary: true)) { + return false; + } + } + } + } + + return foundTouchingPoint; + } else if (geom2 is Polygon) { + var foundTouchingPoint = false; + for (var i = 0; i < geom1.coordinates[0].length; i++) { + for (var ii = 0; ii < geom1.coordinates[0][i].length; ii++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine( + Point(coordinates: geom1.coordinates[0][i][ii]), + LineString(coordinates: geom2.coordinates[0]))) { + foundTouchingPoint = true; + } + } + if (booleanPointInPolygon(geom1.coordinates[0][i][ii], geom2, + ignoreBoundary: true)) { + return false; + } + } + } + return foundTouchingPoint; + } else if (geom2 is MultiPolygon) { + var foundTouchingPoint = false; + for (var i = 0; i < geom1.coordinates[0].length; i++) { + for (var ii = 0; ii < geom2.coordinates[0].length; ii++) { + for (var iii = 0; iii < geom1.coordinates[0].length; iii++) { + if (!foundTouchingPoint) { + if (booleanPointOnLine( + Point( + coordinates: geom1.coordinates[0][i][iii], + ), + LineString( + coordinates: geom2.coordinates[0][ii], + ), + )) { + foundTouchingPoint = true; + } + } + if (booleanPointInPolygon(geom1.coordinates[0][i][iii], + Polygon(coordinates: [geom2.coordinates[0][ii]]), + ignoreBoundary: true)) { + return false; + } + } + } + } + return foundTouchingPoint; + } else { + throw Exception("feature2 $geom2 geometry not supported"); + } + } else { + throw Exception("feature1 $geom1 geometry not supported"); + } +} + +bool isPointOnLineEnd(Point point, LineString line) { + if (line.coordinates[0] == point.coordinates) return true; + if (line.coordinates[line.coordinates.length - 1] == point.coordinates) { + return true; + } + return false; +} diff --git a/lib/src/booleans/boolean_valid.dart b/lib/src/booleans/boolean_valid.dart new file mode 100644 index 00000000..5a06e741 --- /dev/null +++ b/lib/src/booleans/boolean_valid.dart @@ -0,0 +1,149 @@ +import 'package:turf/polygon_to_line.dart'; +import 'package:turf/src/booleans/boolean_disjoint.dart'; +import 'package:turf/src/booleans/boolean_point_on_line.dart'; +import 'package:turf/src/invariant.dart'; +import 'package:turf/src/meta/extensions.dart'; + +import '../../helpers.dart'; +import '../line_intersect.dart'; +import 'boolean_crosses.dart'; + +bool _checkRingsClose(List geom) { + return (geom[0].lng == geom[geom.length - 1].lng || + geom[0].lat == geom[geom.length - 1].lat); +} + +bool _checkRingsForSpikesPunctures(List geom) { + for (var i = 0; i < geom.length - 1; i++) { + var point = Point(coordinates: geom[i]); + for (var ii = i + 1; ii < geom.length - 2; ii++) { + var seg = [geom[ii], geom[ii + 1]]; + if (booleanPointOnLine(point, LineString(coordinates: seg))) return true; + } + } + return false; +} + +bool _checkPolygonAgainstOthers(Polygon poly, MultiPolygon geom, int index) { + for (var i = index + 1; i < geom.coordinates.length; i++) { + if (!booleanDisjoint(poly, Polygon(coordinates: geom.coordinates[i]))) { + LineString lineS = LineString(coordinates: geom.coordinates[i][0]); + if (booleanCrosses(poly, lineS)) { + Feature line = polygonToLine(poly) as Feature; + var doLinesIntersect = lineIntersect(lineS, line); + + /// http://portal.opengeospatial.org/files/?artifact_id=829 p.22 - 2 : + /// 1 intersection Point is 'finite', therefore passes the test + if (doLinesIntersect.features.length == 1) return true; + return false; + } + } + } + return true; +} + +/// booleanValid checks if the geometry is a valid according to the OGC Simple +/// Feature Specification. +/// Take a [Feature] or a [GeometryType] +/// example +/// ```dart +/// var line = LineString(coordinates:[Position.of([1, 1]), Position.of([1, 2]), +/// Position.of([1, 3]), Position.of([1, 4])]); +/// booleanValid(line); // => true +/// booleanValid({foo: "bar"}); // => false +/// ``` +bool booleanValid(GeoJSONObject feature) { + // Parse GeoJSON + if (feature is FeatureCollection) { + for (Feature f in feature.features) { + if (!booleanValid(f)) { + return false; + } + } + } else if (feature is GeometryCollection) { + for (GeometryObject g in feature.geometries) { + if (!booleanValid(g)) { + return false; + } + } + } else { + var geom = getGeom(feature); + + if (geom is Point) { + if (!(geom.coordinates.length >= 2 && geom.coordinates.length <= 3)) { + return false; + } + } else if (geom is MultiPoint) { + if (geom.coordinates.length < 2) { + return false; + } + for (Position p in geom.coordinates) { + if (!booleanValid(Point(coordinates: p))) return false; + } + } else if (geom is LineString) { + if (geom.coordinates.length < 2) return false; + for (Position p in geom.coordinates) { + if (!booleanValid(Point(coordinates: p))) return false; + } + } else if (geom is MultiLineString) { + if (geom.coordinates.length < 2) return false; + for (var i = 0; i < geom.coordinates.length; i++) { + if (!booleanValid(LineString(coordinates: geom.coordinates[i]))) { + return false; + } + } + } else if (geom is Polygon) { + var valid = true; + geom.coordEach((Position? cCoord, _, __, ___, ____) { + valid = booleanValid(Point(coordinates: cCoord!)); + }); + if (!valid) return false; + for (var i = 0; i < geom.coordinates.length; i++) { + if (geom.coordinates[i].length < 4) return false; + if (!_checkRingsClose(geom.coordinates[i])) return false; + if (_checkRingsForSpikesPunctures(geom.coordinates[i])) return false; + if (i > 0) { + if (lineIntersect( + Polygon(coordinates: [geom.coordinates[0]]), + Polygon(coordinates: [geom.coordinates[i]]), + ).features.length > + 1) { + return false; + } + } + } + } else if (geom is MultiPolygon) { + for (var i = 0; i < geom.coordinates.length; i++) { + var poly = geom.coordinates[i]; + + for (var ii = 0; ii < poly.length; ii++) { + if (poly[ii].length < 4) { + return false; + } + if (!_checkRingsClose(poly[ii])) { + return false; + } + if (_checkRingsForSpikesPunctures(poly[ii])) { + return false; + } + if (ii == 0) { + if (!_checkPolygonAgainstOthers( + Polygon(coordinates: poly), geom, i)) { + return false; + } + } + if (ii > 0) { + if (lineIntersect(Polygon(coordinates: [poly[0]]), + Polygon(coordinates: [poly[ii]])).features.length > + 1) { + return false; + } + } + } + } + } else { + throw Exception('the type ${geom.type} is not supported'); + } + } + return true; +} diff --git a/lib/src/clean_coords.dart b/lib/src/clean_coords.dart index 5ee1b37e..41989a66 100644 --- a/lib/src/clean_coords.dart +++ b/lib/src/clean_coords.dart @@ -21,8 +21,7 @@ Feature cleanCoords( if (geojson is Feature && geojson.geometry == null) { throw Exception("Geometry of the Feature is null"); } - GeometryObject geom = - geojson is Feature ? geojson.geometry! : geojson as GeometryObject; + GeometryObject geom = getGeom(geojson); geom = mutate ? geom : geom.clone() as GeometryObject; if (geojson is GeometryCollection || geojson is FeatureCollection) { diff --git a/lib/src/geojson.dart b/lib/src/geojson.dart index 75f2e3b6..eacf22d5 100644 --- a/lib/src/geojson.dart +++ b/lib/src/geojson.dart @@ -61,7 +61,7 @@ abstract class GeoJSONObject { } } - toJson(); + Map toJson(); GeoJSONObject clone(); } @@ -182,7 +182,7 @@ abstract class CoordinateType implements Iterable { bool get isSigned; - _untilSigned(val, limit) { + num _untilSigned(num val, limit) { if (val > limit) { return _untilSigned(val - 360, limit); } else { diff --git a/lib/src/invariant.dart b/lib/src/invariant.dart index 3303e25d..89fd3c74 100644 --- a/lib/src/invariant.dart +++ b/lib/src/invariant.dart @@ -27,7 +27,6 @@ Position getCoord(dynamic coord) { } /// Unwraps coordinates from a [Feature], [GeometryObject] or a [List] -/// /// Gets a [List], [GeometryObject] or a [Feature] or a [List] and /// returns [List]. /// For example: @@ -69,10 +68,32 @@ List getCoords(dynamic coords) { "Parameter must be a List, Geometry, Feature. coords Feature, Geometry Object or a List"); } -_getCoordsForGeometry(GeometryObject geom) { +List _getCoordsForGeometry(GeometryObject geom) { if (geom is Point || geom is GeometryCollection) { throw Exception("Type must contain a list of Positions e.g Polygon"); } return (geom as GeometryType).coordinates; } + +/// Get Geometry or Geometries from [Feature] or [GeometryCollection] +/// Returns [List] in case geojson is a [GeometryCollection] and a +/// [GeometryType] if geojson is a simple [GeometryType]. +/// example: +/// ```dart +/// var feature = Feature( +/// geometry: Point( +/// coordinates: Position.of([110, 40]) +/// )); +/// var geom = getGeom(feature) +/// //= Point(coordinates: Position.of([110, 40])) +GeometryObject getGeom(GeoJSONObject geojson) { + if (geojson is Feature) { + return geojson.geometry!; + } else if (geojson is FeatureCollection) { + throw Exception( + 'Cannot retrieve single Geometry from FeatureCollection in getGeom', + ); + } + return geojson as GeometryObject; +} diff --git a/lib/src/line_intersect.dart b/lib/src/line_intersect.dart new file mode 100644 index 00000000..d1be8ec3 --- /dev/null +++ b/lib/src/line_intersect.dart @@ -0,0 +1,69 @@ +import 'package:sweepline_intersections/sweepline_intersections.dart'; + +import '../helpers.dart'; + +/// Takes any [LineString] or [Polygon] and returns the intersecting [Point](s). +/// [removeDuplicates=true] removes duplicate intersections, +/// [ignoreSelfIntersections=false] ignores self-intersections on input features +/// Returns a [FeatureCollection] containing point(s) that intersect both +/// example: +/// ```dart +/// var line1 = LineString(coordinates:[ +/// Position.of([126, -11]), +/// Position.of([129, -21]), +/// ]); +/// var line2 = LineString(coordinates:[ +/// Position.of([123, -18]), +/// Position.of([131, -14]), +/// ]); +/// var intersects = lineIntersect(line1, line2); +/// //addToMap +/// var addToMap = [line1, line2, intersects] +/// ``` +FeatureCollection lineIntersect( + GeoJSONObject line1, + GeoJSONObject line2, { + bool removeDuplicates = true, + bool ignoreSelfIntersections = false, +}) { + var features = []; + if (line1 is FeatureCollection) { + features.addAll(line1.features); + } else if (line1 is Feature) { + features.add(line1); + } else if (line1 is LineString || + line1 is Polygon || + line1 is MultiLineString || + line1 is MultiPolygon) { + features.add(Feature(geometry: line1 as GeometryType)); + } + + if (line2 is FeatureCollection) { + features.addAll(line2.features); + } else if (line2 is Feature) { + features.add(line2); + } else if (line2 is LineString || + line2 is Polygon || + line2 is MultiLineString || + line2 is MultiPolygon) { + features.add(Feature(geometry: line2 as GeometryType)); + } + + var intersections = sweeplineIntersections( + FeatureCollection(features: features), ignoreSelfIntersections); + Set unique = {}; + if (removeDuplicates) { + for (var intersection in intersections) { + unique.add(intersection); + } + } + return FeatureCollection( + features: (removeDuplicates ? unique.toList() : intersections) + .map( + (r) => Feature( + geometry: Point(coordinates: r), + ), + ) + .toList(), + ); +} diff --git a/lib/src/line_segment.dart b/lib/src/line_segment.dart index c8218d6a..ba7dd164 100644 --- a/lib/src/line_segment.dart +++ b/lib/src/line_segment.dart @@ -7,7 +7,6 @@ import 'geojson.dart'; /// [LineString] or [MultiLineString] or [Polygon] and [MultiPolygon] /// Returns [FeatureCollection] 2-vertex line segments /// For example: -/// /// ```dart /// var polygon = Polygon.fromJson({ /// 'coordinates': [ @@ -21,7 +20,6 @@ import 'geojson.dart'; /// var segments = lineSegment(polygon); /// //addToMap /// var addToMap = [polygon, segments] - FeatureCollection lineSegment(GeoJSONObject geoJson, {bool combineGeometries = false}) { List> features = []; @@ -77,11 +75,6 @@ typedef SegmentEachCallback = dynamic Function( /// turf.segmentEach(polygon, function () { /// total++; /// }); -/// -/// -/// -/// - void segmentEach( GeoJSONObject geojson, SegmentEachCallback callback, { @@ -244,7 +237,6 @@ typedef SegmentReduceCallback = T? Function( /// return previousValue; /// }, 0); /// ``` - T? segmentReduce( GeoJSONObject geojson, SegmentReduceCallback callback, diff --git a/lib/src/polygon_smooth.dart b/lib/src/polygon_smooth.dart index d55930f1..cb30c98e 100644 --- a/lib/src/polygon_smooth.dart +++ b/lib/src/polygon_smooth.dart @@ -33,9 +33,9 @@ FeatureCollection polygonSmooth(GeoJSONObject inputPolys, BBox? featureBBox, dynamic featureId, ) { - var outCoords; - var poly; - var tempOutput; + dynamic outCoords; + dynamic poly; + dynamic tempOutput; switch (geom?.type) { case GeoJSONObjectType.polygon: @@ -75,7 +75,7 @@ FeatureCollection polygonSmooth(GeoJSONObject inputPolys, return FeatureCollection(features: outPolys); } -_processPolygon(Polygon poly, List> tempOutput) { +void _processPolygon(Polygon poly, List> tempOutput) { var prevGeomIndex = 0; var subtractCoordIndex = 0; @@ -106,7 +106,7 @@ _processPolygon(Polygon poly, List> tempOutput) { } } -_processMultiPolygon(poly, List>> tempOutput) { +void _processMultiPolygon(poly, List>> tempOutput) { var prevGeomIndex = 0; var subtractCoordIndex = 0; var prevMultiIndex = 0; diff --git a/lib/src/polygon_to_line.dart b/lib/src/polygon_to_line.dart index a1b6d65b..609fe151 100644 --- a/lib/src/polygon_to_line.dart +++ b/lib/src/polygon_to_line.dart @@ -1,3 +1,5 @@ +import 'package:turf/src/invariant.dart'; + import '../helpers.dart'; /// Converts a [Polygon] to [LineString] or [MultiLineString] or a [MultiPolygon] @@ -21,7 +23,7 @@ import '../helpers.dart'; /// ``` GeoJSONObject polygonToLine(GeoJSONObject poly, {Map? properties}) { - var geom = poly is Feature ? poly.geometry : poly; + var geom = getGeom(poly); properties = properties ?? ((poly is Feature) ? poly.properties : {}); diff --git a/pubspec.yaml b/pubspec.yaml index 7fe12315..c1f54c7a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,16 +2,19 @@ name: turf description: A turf.js-like geospatial analysis library working with GeoJSON, written in pure Dart. version: 0.0.7 environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ">=2.12.0 <3.0.0" homepage: https://github.com/dartclub/turf_dart repository: https://github.com/dartclub/turf_dart dependencies: json_annotation: ^4.4.0 - turf_equality: ^0.0.1 + turf_equality: ^0.0.2 + turf_pip: ^0.0.1+1 + rbush: ^1.1.0 + sweepline_intersections: ^0.0.3+1 dev_dependencies: - dartclub_lint: ^0.4.2 + dartclub_lint: ^1.0.0 test: ^1.19.3 json_serializable: ^6.1.1 build_runner: ^2.1.5 diff --git a/test/.DS_Store b/test/.DS_Store new file mode 100644 index 00000000..8dca1b0c Binary files /dev/null and b/test/.DS_Store differ diff --git a/test/booleans/clockwise_test.dart b/test/booleans/clockwise_test.dart new file mode 100644 index 00000000..599ecc4f --- /dev/null +++ b/test/booleans/clockwise_test.dart @@ -0,0 +1,58 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:turf/helpers.dart'; +import 'package:turf/src/booleans/boolean_clockwise.dart'; + +void main() { + group( + 'clockwise', + () { + test( + 'simple LineString', + () { + var list = [ + Position.of([10, 10]), + Position.of([11, 10]), + Position.of([12, 10]), + Position.of([13, 10]), + ]; + expect(booleanClockwise(LineString(coordinates: list)), true); + }, + ); + + var inDir = Directory('./test/examples/booleans/clockwise/true'); + for (var file in inDir.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + test(file.path, () { + // True Fixtures + var inSource = file.readAsStringSync(); + dynamic json = jsonDecode(inSource); + var inGeom = GeoJSONObject.fromJson(json); + var feature0 = (inGeom as FeatureCollection).features[0]; + + expect(booleanClockwise(feature0.geometry as LineString), true); + }); + } + } + + var inDir1 = Directory('./test/examples/booleans/clockwise/false'); + for (var file in inDir1.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + test( + file.path, + () { + // True Fixtures + var inSource = file.readAsStringSync(); + dynamic json = jsonDecode(inSource); + var inGeom = GeoJSONObject.fromJson(json); + var feature0 = (inGeom as FeatureCollection).features[0]; + expect(booleanClockwise(feature0.geometry as LineString), false); + }, + ); + } + } + }, + ); +} diff --git a/test/booleans/concave_test.dart b/test/booleans/concave_test.dart new file mode 100644 index 00000000..33f2df28 --- /dev/null +++ b/test/booleans/concave_test.dart @@ -0,0 +1,48 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:turf/helpers.dart'; +import 'package:turf/src/booleans/boolean_concave.dart'; + +void main() { + group( + 'concave', + () { + var inDir = Directory('./test/examples/booleans/concave/true'); + + for (var file in inDir.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + test( + file.path, + () { + // True Fixtures + var inSource = file.readAsStringSync(); + var json = jsonDecode(inSource); + var inGeom = GeoJSONObject.fromJson(json); + var feature = (inGeom as FeatureCollection).features[0]; + expect(booleanConcave(feature.geometry as Polygon), true); + }, + ); + } + } + + var inDir1 = Directory('./test/examples/booleans/concave/false'); + for (var file in inDir1.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + test( + file.path, + () { + // False Fixtures + var inSource = file.readAsStringSync(); + var json = jsonDecode(inSource); + var inGeom = GeoJSONObject.fromJson(json); + var feature = (inGeom as FeatureCollection).features[0]; + expect(booleanConcave(feature.geometry as Polygon), false); + }, + ); + } + } + }, + ); +} diff --git a/test/booleans/contains_test.dart b/test/booleans/contains_test.dart new file mode 100644 index 00000000..7e89cfce --- /dev/null +++ b/test/booleans/contains_test.dart @@ -0,0 +1,61 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:turf/helpers.dart'; +import 'package:turf/src/booleans/boolean_contains.dart'; + +void main() { + group( + 'contains', + () { + var inDir = Directory('./test/examples/booleans/contains/test/true'); + for (var file in inDir.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + test( + file.path, + () { + // True Fixtures + var inSource = file.readAsStringSync(); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + expect(booleanContains(feature1, feature2), true); + }, + ); + } + } + + var inDir1 = Directory('./test/examples/booleans/contains/test/false'); + for (var file in inDir1.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + test( + file.path, + () { + // False Fixtures + var inSource = file.readAsStringSync(); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + expect(booleanContains(feature1, feature2), false); + }, + ); + + test( + "turf-boolean-contains -- Geometry Objects", + () { + var pt1 = + Feature(geometry: Point(coordinates: Position.of([0, 0]))); + var pt2 = + Feature(geometry: Point(coordinates: Position.of([0, 0]))); + + expect(booleanContains(pt1.geometry!, pt2.geometry!), true); + }, + ); + } + } + }, + ); +} diff --git a/test/booleans/crosses_test.dart b/test/booleans/crosses_test.dart new file mode 100644 index 00000000..f2faaf4d --- /dev/null +++ b/test/booleans/crosses_test.dart @@ -0,0 +1,48 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:turf/helpers.dart'; +import 'package:turf/src/booleans/boolean_crosses.dart'; + +void main() { + group( + 'boolean_crosses', + () { + // True Fixtures + var inDir = Directory('./test/examples/booleans/crosses/true'); + for (var file in inDir.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + test( + file.path, + () { + var inSource = file.readAsStringSync(); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + expect( + booleanCrosses(feature1.geometry!, feature2.geometry!), true); + }, + ); + } + } + // False Fixtures + var inDir1 = Directory('./test/examples/booleans/crosses/false'); + for (var file in inDir1.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + test( + file.path, + () { + var inSource = file.readAsStringSync(); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + expect(booleanCrosses(feature1.geometry!, feature2.geometry!), + isFalse); + }, + ); + } + } + }, + ); +} diff --git a/test/booleans/disjoint_test.dart b/test/booleans/disjoint_test.dart new file mode 100644 index 00000000..6a547138 --- /dev/null +++ b/test/booleans/disjoint_test.dart @@ -0,0 +1,49 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:turf/helpers.dart'; +import 'package:turf/src/booleans/boolean_disjoint.dart'; + +void main() { + group('boolean_disjoint', () { + // True Fixtures + var inDir = Directory('./test/examples/booleans/disjoint/test/true'); + for (var file in inDir.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + test( + file.path, + () { + var inSource = file.readAsStringSync(); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + var result = booleanDisjoint(feature1, feature2); + expect(result, true); + }, + ); + } + } + // False Fixtures + var inDir1 = Directory('./test/examples/booleans/disjoint/test/false'); + for (var file in inDir1.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + test( + file.path, + () { + // True Fixtures + var inSource = file.readAsStringSync(); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + var result = booleanDisjoint(feature1, feature2); + + expect(result, false); + }, + ); + } + } + }); +} diff --git a/test/booleans/equal_test.dart b/test/booleans/equal_test.dart new file mode 100644 index 00000000..0a6479c3 --- /dev/null +++ b/test/booleans/equal_test.dart @@ -0,0 +1,134 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:turf/helpers.dart'; +import 'package:turf/src/booleans/boolean_equal.dart'; + +void main() { + group( + 'boolean_equal', + () { + // True Fixtures + var inDir = Directory('./test/examples/booleans/equal/test/true'); + for (var file in inDir.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + test( + file.path, + () { + var inSource = file.readAsStringSync(); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + Map json = jsonDecode(inSource); + var options = json['properties']; + var result = booleanEqual(feature1, feature2, + precision: options?['precision'] ?? 6, + shiftedPolygon: options?['shiftedPolygon'] ?? false, + direction: options?['direction'] ?? false); + expect(result, true); + }, + ); + } + } + // False Fixtures + var inDir1 = Directory('./test/examples/booleans/equal/test/false'); + for (var file in inDir1.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + test( + file.path, + () { + // True Fixtures + var inSource = file.readAsStringSync(); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + + Map json = jsonDecode(inSource); + var options = json['properties']; + var result = booleanEqual(feature1, feature2, + precision: options?['precision'] ?? 6); + + expect(result, false); + }, + ); + } + } + var pt = Point(coordinates: Position.of([9, 50])); + var line1 = Feature( + geometry: LineString(coordinates: [ + Position.of([7, 50]), + Position.of([8, 50]), + Position.of([9, 50]), + ]), + ); + var line2 = Feature( + geometry: LineString(coordinates: [ + Position.of([7, 50]), + Position.of([8, 50]), + Position.of([9, 50]), + ]), + ); + var poly1 = Feature( + geometry: Polygon(coordinates: [ + [ + Position.of([8.5, 50]), + Position.of([9.5, 50]), + Position.of([9.5, 49]), + Position.of([8.5, 49]), + Position.of([8.5, 50]), + ], + ]), + ); + var poly2 = Feature( + geometry: Polygon(coordinates: [ + [ + Position.of([8.5, 50]), + Position.of([9.5, 50]), + Position.of([9.5, 49]), + Position.of([8.5, 49]), + Position.of([8.5, 50]), + ], + ]), + ); + var poly3 = Feature( + geometry: Polygon(coordinates: [ + [ + Position.of([10, 50]), + Position.of([10.5, 50]), + Position.of([10.5, 49]), + Position.of([10, 49]), + Position.of([10, 50]), + ], + ]), + ); + + test("turf-boolean-equal -- geometries", () { + // "[true] LineString geometry" + expect(booleanEqual(line1.geometry!, line2.geometry!), true); + + // "[true] Polygon geometry" + expect(booleanEqual(poly1.geometry!, poly2.geometry!), true); + + // "[false] Polygon geometry" + expect(booleanEqual(poly1.geometry!, poly3.geometry!), false); + + // "[false] different types" + expect(booleanEqual(pt, line1), false); + }); + + test( + "turf-boolean-equal -- throws", + () { + // "precision must be positive" + expect( + () => + booleanEqual(line1.geometry!, line2.geometry!, precision: -1), + throwsA(isA())); + }, + ); + }, + ); +} diff --git a/test/booleans/intersects_test.dart b/test/booleans/intersects_test.dart new file mode 100644 index 00000000..886cfe07 --- /dev/null +++ b/test/booleans/intersects_test.dart @@ -0,0 +1,129 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:turf/helpers.dart'; +import 'package:turf/src/booleans/boolean_intersects.dart'; + +void main() { + var featureCollection = FeatureCollection(features: [ + Feature( + properties: {"fill": "#ff0000"}, + geometry: MultiPolygon(coordinates: [ + [ + [ + Position.of([122.6953125, -19.186677697957833]), + Position.of([128.759765625, -19.186677697957833]), + Position.of([128.759765625, -15.28418511407642]), + Position.of([122.6953125, -15.28418511407642]), + Position.of([122.6953125, -19.186677697957833]) + ] + ], + [ + [ + Position.of([123.74999999999999, -25.918526162075153]), + Position.of([130.25390625, -25.918526162075153]), + Position.of([130.25390625, -20.715015145512087]), + Position.of([123.74999999999999, -20.715015145512087]), + Position.of([123.74999999999999, -25.918526162075153]), + ] + ] + ])), + Feature( + properties: {"fill": "#0000ff"}, + geometry: Polygon(coordinates: [ + [ + Position.of([119.20166015624999, -22.776181505086495]), + Position.of([125.09033203124999, -22.776181505086495]), + Position.of([125.09033203124999, -18.417078658661257]), + Position.of([119.20166015624999, -18.417078658661257]), + Position.of([119.20166015624999, -22.776181505086495]) + ] + ])) + ]); + + var featureCollection1 = FeatureCollection(features: [ + Feature( + properties: {"fill": "#ff0000"}, + geometry: MultiPolygon(coordinates: [ + [ + [ + Position.of([122.6953125, -19.186677697957833]), + Position.of([128.759765625, -19.186677697957833]), + Position.of([128.759765625, -15.28418511407642]), + Position.of([122.6953125, -15.28418511407642]), + Position.of([122.6953125, -19.186677697957833]) + ] + ], + [ + [ + Position.of([123.74999999999999, -25.918526162075153]), + Position.of([130.25390625, -25.918526162075153]), + Position.of([130.25390625, -20.715015145512087]), + Position.of([123.74999999999999, -20.715015145512087]), + Position.of([123.74999999999999, -25.918526162075153]) + ] + ] + ])), + Feature( + properties: {"fill": "#0000ff"}, + geometry: Polygon(coordinates: [ + [ + Position.of([116.98242187499999, -24.647017162630352]), + Position.of([122.87109375, -24.647017162630352]), + Position.of([122.87109375, -20.34462694382967]), + Position.of([116.98242187499999, -20.34462694382967]), + Position.of([116.98242187499999, -24.647017162630352]) + ] + ])) + ]); + test( + "turf-boolean-intersects", + () { + // True Fixtures + + var feature1 = featureCollection.features[0]; + var feature2 = featureCollection.features[1]; + + expect(booleanIntersects(feature1, feature2), equals(true)); + + // False Fixtures + var feature3 = featureCollection1.features[0]; + var feature4 = featureCollection1.features[1]; + expect(booleanIntersects(feature3, feature4), equals(false)); + }, + ); + test( + "turf-boolean-intersects", + () { + // True Fixtures + var inDir = Directory('./test/examples/booleans/intersects/true'); + for (var file in inDir.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + var inSource = file.readAsStringSync(); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + var result = booleanIntersects(feature1, feature2); + + expect(result, isTrue); + } + } + // False Fixtures + var inDir1 = Directory('./test/examples/booleans/intersects/false'); + for (var file in inDir1.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + var inSource = file.readAsStringSync(); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + var result = booleanIntersects(feature1, feature2); + + expect(result, isFalse); + } + } + }, + ); +} diff --git a/test/booleans/parallel_test.dart b/test/booleans/parallel_test.dart new file mode 100644 index 00000000..02c569c1 --- /dev/null +++ b/test/booleans/parallel_test.dart @@ -0,0 +1,51 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:turf/src/booleans/boolean_parallel.dart'; +import 'package:turf/turf.dart'; + +void main() { + group( + 'boolean-overlap', + () { + test( + "turf-boolean-overlap-trues", + () { + // True Fixtures + Directory dir = Directory('./test/examples/booleans/parallel/true'); + for (var file in dir.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + var inSource = file.readAsStringSync(); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + var result = booleanParallel(feature1.geometry as LineString, + feature2.geometry as LineString); + expect(result, true); + } + } + }, + ); + + test( + "turf-boolean-overlap-falses", + () { + // True Fixtures + Directory dir = Directory('./test/examples/booleans/parallel/false'); + for (var file in dir.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + var inSource = file.readAsStringSync(); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + var result = booleanParallel(feature1.geometry as LineString, + feature2.geometry as LineString); + expect(result, false); + } + } + }, + ); + }, + ); +} diff --git a/test/booleans/point_in_polygon_test.dart b/test/booleans/point_in_polygon_test.dart new file mode 100644 index 00000000..9cc9a12e --- /dev/null +++ b/test/booleans/point_in_polygon_test.dart @@ -0,0 +1,419 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:turf/helpers.dart'; +import 'package:turf/src/booleans/boolean_point_in_polygon.dart'; + +void main() { + group( + 'pip', + () { + test( + "boolean-point-in-polygon -- featureCollection", + () { + // test for a simple polygon + var poly = Polygon(coordinates: [ + [ + Position.of([0, 0]), + Position.of([0, 100]), + Position.of([100, 100]), + Position.of([100, 0]), + Position.of([0, 0]), + ], + ]); + var ptIn = Point(coordinates: (Position.of([50, 50]))); + var ptOut = Point(coordinates: (Position.of([140, 150]))); + // "point inside simple polygon" + expect(booleanPointInPolygon(ptIn.coordinates, poly), true); + // "point outside simple polygon" + expect(booleanPointInPolygon(ptOut.coordinates, poly), false); + + // test for a concave polygon + var concavePoly = Polygon(coordinates: [ + [ + Position.of([0, 0]), + Position.of([50, 50]), + Position.of([0, 100]), + Position.of([100, 100]), + Position.of([100, 0]), + Position.of([0, 0]), + ], + ]); + var ptConcaveIn = Point(coordinates: (Position.of([75, 75]))); + var ptConcaveOut = Point(coordinates: (Position.of([25, 50]))); + + // "point inside concave polygon" + expect(booleanPointInPolygon(ptConcaveIn.coordinates, concavePoly), + true); + // "point outside concave polygon" + expect(booleanPointInPolygon(ptConcaveOut.coordinates, concavePoly), + false); + }, + ); + + test( + "boolean-point-in-polygon -- poly with hole", + () { + var ptInHole = Point( + coordinates: + (Position.of([-86.69208526611328, 36.20373274711739]))); + var ptInPoly = Point( + coordinates: + (Position.of([-86.72229766845702, 36.20258997094334]))); + var ptOutsidePoly = Point( + coordinates: + (Position.of([-86.75079345703125, 36.18527313913089]))); + + var inFile = File( + './test/examples/booleans/point_in_polygon/in/poly-with-hole.geojson'); + + var polyHole = + GeoJSONObject.fromJson(jsonDecode(inFile.readAsStringSync())); + + expect(booleanPointInPolygon(ptInHole.coordinates, polyHole), false); + expect(booleanPointInPolygon(ptInPoly.coordinates, polyHole), true); + expect(booleanPointInPolygon(ptOutsidePoly.coordinates, polyHole), + false); + }, + ); + + test( + "boolean-point-in-polygon -- multipolygon with hole", + () { + var ptInHole = Point( + coordinates: + (Position.of([-86.69208526611328, 36.20373274711739]))); + var ptInPoly = Point( + coordinates: + (Position.of([-86.72229766845702, 36.20258997094334]))); + var ptInPoly2 = Point( + coordinates: + (Position.of([-86.75079345703125, 36.18527313913089]))); + var ptOutsidePoly = Point( + coordinates: + (Position.of([-86.75302505493164, 36.23015046460186]))); + + var inFile = File( + './test/examples/booleans/point_in_polygon/in/multipoly-with-hole.geojson'); + + var multiPolyHole = + GeoJSONObject.fromJson(jsonDecode(inFile.readAsStringSync())); + + expect(booleanPointInPolygon(ptInHole.coordinates, multiPolyHole), + false); + expect( + booleanPointInPolygon(ptInPoly.coordinates, multiPolyHole), true); + expect(booleanPointInPolygon(ptInPoly2.coordinates, multiPolyHole), + true); + expect( + booleanPointInPolygon(ptInPoly.coordinates, multiPolyHole), true); + expect( + booleanPointInPolygon(ptOutsidePoly.coordinates, multiPolyHole), + false); + }, + ); + + test( + 'boolean-point-in-polygon -- Boundary test', + () { + var poly1 = Polygon( + coordinates: [ + [ + Position.of([10, 10]), + Position.of([30, 20]), + Position.of([50, 10]), + Position.of([30, 0]), + Position.of([10, 10]), + ], + ], + ); + var poly2 = Polygon( + coordinates: [ + [ + Position.of([10, 0]), + Position.of([30, 20]), + Position.of([50, 0]), + Position.of([30, 10]), + Position.of([10, 0]), + ], + ], + ); + var poly3 = Polygon( + coordinates: [ + [ + Position.of([10, 0]), + Position.of([30, 20]), + Position.of([50, 0]), + Position.of([30, -20]), + Position.of([10, 0]), + ], + ], + ); + var poly4 = Polygon( + coordinates: [ + [ + Position.of([0, 0]), + Position.of([0, 20]), + Position.of([50, 20]), + Position.of([50, 0]), + Position.of([40, 0]), + Position.of([30, 10]), + Position.of([30, 0]), + Position.of([20, 10]), + Position.of([10, 10]), + Position.of([10, 0]), + Position.of([0, 0]), + ], + ], + ); + var poly5 = Polygon( + coordinates: [ + [ + Position.of([0, 20]), + Position.of([20, 40]), + Position.of([40, 20]), + Position.of([20, 0]), + Position.of([0, 20]), + ], + [ + Position.of([10, 20]), + Position.of([20, 30]), + Position.of([30, 20]), + Position.of([20, 10]), + Position.of([10, 20]), + ], + ], + ); + + void runTest(bool ignoreBoundary) { + var isBoundaryIncluded = ignoreBoundary == false; + var tests = [ + [ + poly1, + Point(coordinates: (Position.of([10, 10]))), + isBoundaryIncluded + ], //0 + [ + poly1, + Point(coordinates: (Position.of([30, 20]))), + isBoundaryIncluded + ], + [ + poly1, + Point(coordinates: (Position.of([50, 10]))), + isBoundaryIncluded + ], + [ + poly1, + Point(coordinates: (Position.of([30, 10]))), + true + ], + [ + poly1, + Point(coordinates: (Position.of([0, 10]))), + false + ], + [ + poly1, + Point(coordinates: (Position.of([60, 10]))), + false + ], + [ + poly1, + Point(coordinates: (Position.of([30, -10]))), + false + ], + [ + poly1, + Point(coordinates: (Position.of([30, 30]))), + false + ], + [ + poly2, + Point(coordinates: (Position.of([30, 0]))), + false + ], + [ + poly2, + Point(coordinates: (Position.of([0, 0]))), + false + ], + [ + poly2, + Point(coordinates: (Position.of([60, 0]))), + false + ], //10 + [ + poly3, + Point(coordinates: (Position.of([30, 0]))), + true + ], + [ + poly3, + Point(coordinates: (Position.of([0, 0]))), + false + ], + [ + poly3, + Point(coordinates: (Position.of([60, 0]))), + false + ], + [ + poly4, + Point(coordinates: (Position.of([0, 20]))), + isBoundaryIncluded + ], + [ + poly4, + Point(coordinates: (Position.of([10, 20]))), + isBoundaryIncluded + ], + [ + poly4, + Point(coordinates: (Position.of([50, 20]))), + isBoundaryIncluded + ], + [ + poly4, + Point(coordinates: (Position.of([0, 10]))), + isBoundaryIncluded + ], + [ + poly4, + Point(coordinates: (Position.of([5, 10]))), + true + ], + [ + poly4, + Point(coordinates: (Position.of([25, 10]))), + true + ], + [ + poly4, + Point(coordinates: (Position.of([35, 10]))), + true + ], //20 + [ + poly4, + Point(coordinates: (Position.of([0, 0]))), + isBoundaryIncluded + ], + [ + poly4, + Point(coordinates: (Position.of([20, 0]))), + false + ], + [ + poly4, + Point(coordinates: (Position.of([35, 0]))), + false + ], + [ + poly4, + Point(coordinates: (Position.of([50, 0]))), + isBoundaryIncluded + ], + [ + poly4, + Point(coordinates: (Position.of([50, 10]))), + isBoundaryIncluded + ], + [ + poly4, + Point(coordinates: (Position.of([5, 0]))), + isBoundaryIncluded + ], + [ + poly4, + Point(coordinates: (Position.of([10, 0]))), + isBoundaryIncluded + ], + [ + poly5, + Point(coordinates: (Position.of([20, 30]))), + isBoundaryIncluded + ], + [ + poly5, + Point(coordinates: (Position.of([25, 25]))), + isBoundaryIncluded + ], + [ + poly5, + Point(coordinates: (Position.of([30, 20]))), + isBoundaryIncluded + ], //30 + [ + poly5, + Point(coordinates: (Position.of([25, 15]))), + isBoundaryIncluded + ], + [ + poly5, + Point(coordinates: (Position.of([20, 10]))), + isBoundaryIncluded + ], + [ + poly5, + Point(coordinates: (Position.of([15, 15]))), + isBoundaryIncluded + ], + [ + poly5, + Point(coordinates: (Position.of([10, 20]))), + isBoundaryIncluded + ], + [ + poly5, + Point(coordinates: (Position.of([15, 25]))), + isBoundaryIncluded + ], + [ + poly5, + Point(coordinates: (Position.of([20, 20]))), + false + ], + ]; + + for (int i = 0; i < tests.length; i++) { + var item = tests[i]; + expect( + booleanPointInPolygon( + (item[1] as Point).coordinates, + item[0] as Polygon, + ignoreBoundary: ignoreBoundary, + ) == + item[2], + isTrue); + } + } + + runTest(false); + runTest(true); + }, + ); + +// https://github.com/Turfjs/turf-inside/issues/15 + test( + "boolean-point-in-polygon -- issue #15", + () { + var pt1 = Point(coordinates: (Position.of([-9.9964077, 53.8040989]))); + var poly = Polygon( + coordinates: [ + [ + Position.of([5.080336744095521, 67.89398938540765]), + Position.of([0.35070899909145403, 69.32470003971179]), + Position.of([-24.453622256504122, 41.146696777884564]), + Position.of([-21.6445524714804, 40.43225902006474]), + Position.of([5.080336744095521, 67.89398938540765]), + ], + ], + ); + + expect(booleanPointInPolygon(pt1.coordinates, poly), true); + }, + ); + }, + ); +} diff --git a/test/booleans/point_on_line_test.dart b/test/booleans/point_on_line_test.dart new file mode 100644 index 00000000..84d0e3bc --- /dev/null +++ b/test/booleans/point_on_line_test.dart @@ -0,0 +1,59 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:turf/helpers.dart'; +import 'package:turf/src/booleans/boolean_point_on_line.dart'; + +void main() { + group( + 'pointOnLine', + () { + var inDir = Directory('./test/examples/booleans/point_on_line/true'); + for (var file in inDir.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + test( + file.path, + () { + // True Fixtures + var inSource = file.readAsStringSync(); + dynamic json = jsonDecode(inSource); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + Map? properties = json['properties']; + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + var result = booleanPointOnLine( + feature1.geometry as Point, feature2.geometry as LineString, + epsilon: properties?['epsilon'], + ignoreEndVertices: properties?['ignoreEndVertices'] ?? false); + expect(result, true); + }, + ); + } + } + // False Fixtures + var inDir1 = Directory('./test/examples/booleans/point_on_line/false'); + for (var file in inDir1.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + test( + file.path, + () { + var inSource = file.readAsStringSync(); + dynamic json = jsonDecode(inSource); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + Map? properties = json['properties']; + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + var result = booleanPointOnLine( + feature1.geometry as Point, feature2.geometry as LineString, + epsilon: properties?['epsilon'], + ignoreEndVertices: properties?['ignoreEndVertices'] ?? false); + + expect(result, false); + }, + ); + } + } + }, + ); +} diff --git a/test/booleans/touches_test.dart b/test/booleans/touches_test.dart new file mode 100644 index 00000000..f3983435 --- /dev/null +++ b/test/booleans/touches_test.dart @@ -0,0 +1,49 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:turf/src/booleans/boolean_touches.dart'; +import 'package:turf/turf.dart'; + +void main() { + group( + 'boolean-overlap', + () { + test( + "turf-boolean-overlap-trues", + () { + // True Fixtures + Directory dir = Directory('./test/examples/booleans/touches/true'); + for (var file in dir.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + var inSource = file.readAsStringSync(); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + var result = booleanTouches(feature1, feature2); + expect(result, true); + } + } + }, + ); + + test( + "turf-boolean-overlap-falses", + () { + // True Fixtures + Directory dir = Directory('./test/examples/booleans/touches/false'); + for (var file in dir.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + var inSource = file.readAsStringSync(); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + var feature1 = (inGeom as FeatureCollection).features[0]; + var feature2 = inGeom.features[1]; + var result = booleanTouches(feature1, feature2); + expect(result, false); + } + } + }, + ); + }, + ); +} diff --git a/test/booleans/valid_test.dart b/test/booleans/valid_test.dart new file mode 100644 index 00000000..6720eafb --- /dev/null +++ b/test/booleans/valid_test.dart @@ -0,0 +1,67 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:turf/src/booleans/boolean_valid.dart'; +import 'package:turf/turf.dart'; + +void main() { + group( + 'boolean-valid', + () { + /// Assertion error is caught in the fromJSON factory contructor of [GeometryType]s + Directory dir = Directory('./test/examples/booleans/valid/assertion'); + for (var file in dir.listSync(recursive: true)) { + test( + file.path, + () { + // Assertion Error Fixtures + if (file is File && file.path.endsWith('.geojson')) { + var inSource = file.readAsStringSync(); + expect( + () => booleanValid( + GeoJSONObject.fromJson( + jsonDecode(inSource), + ), + ), + throwsA(isA()), + ); + } + }, + ); + } + Directory dirFale = Directory('./test/examples/booleans/valid/false'); + for (var file in dirFale.listSync(recursive: true)) { + test( + file.path, + () { + // False Fixtures + if (file is File && file.path.endsWith('.geojson')) { + var inSource = file.readAsStringSync(); + expect( + booleanValid( + GeoJSONObject.fromJson( + jsonDecode(inSource), + ), + ), + isFalse); + } + }, + ); + } + Directory dir1 = Directory('./test/examples/booleans/valid/true'); + for (var file in dir1.listSync(recursive: true)) { + test( + file.path, + () { + if (file is File && file.path.endsWith('.geojson')) { + var inSource = file.readAsStringSync(); + var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); + expect(booleanValid(inGeom), isTrue); + } + }, + ); + } + }, + ); +} diff --git a/test/components/area_test.dart b/test/components/area_test.dart index d15a2932..d6b73c9b 100644 --- a/test/components/area_test.dart +++ b/test/components/area_test.dart @@ -1,7 +1,7 @@ import 'package:test/test.dart'; import 'package:turf/turf.dart'; -main() { +void main() { group('area', () { final position1 = Position(0, 0); final position2 = Position(0, 1); diff --git a/test/components/bbox_polygon_test.dart b/test/components/bbox_polygon_test.dart index 199341d6..d5824750 100644 --- a/test/components/bbox_polygon_test.dart +++ b/test/components/bbox_polygon_test.dart @@ -2,7 +2,7 @@ import 'package:test/test.dart'; import 'package:turf/helpers.dart'; import 'package:turf/src/bbox_polygon.dart'; -main() { +void main() { test( "bbox-polygon", () { diff --git a/test/components/bbox_test.dart b/test/components/bbox_test.dart index 75740b74..e9efefcf 100644 --- a/test/components/bbox_test.dart +++ b/test/components/bbox_test.dart @@ -2,7 +2,7 @@ import 'package:test/test.dart'; import 'package:turf/bbox.dart'; import 'package:turf/helpers.dart'; -main() { +void main() { final pt = Feature( geometry: Point(coordinates: Position.named(lat: 102.0, lng: 0.5))); final line = Feature( diff --git a/test/components/bearing_test.dart b/test/components/bearing_test.dart index 9f2ac72e..42949459 100644 --- a/test/components/bearing_test.dart +++ b/test/components/bearing_test.dart @@ -2,16 +2,19 @@ import 'package:test/test.dart'; import 'package:turf/bearing.dart'; import 'package:turf/helpers.dart'; -main() { - test('bearing', () { - var start = Point(coordinates: Position.of([-75, 45])); - var end = Point(coordinates: Position.of([20, 60])); +void main() { + test( + 'bearing', + () { + var start = Point(coordinates: Position.of([-75, 45])); + var end = Point(coordinates: Position.of([20, 60])); - var initialBearing = bearing(start, end); - expect(initialBearing.toStringAsFixed(2), '37.75'); + var initialBearing = bearing(start, end); + expect(initialBearing.toStringAsFixed(2), '37.75'); - var finalBearing = bearing(start, end, calcFinal: true); - expect(finalBearing.toStringAsFixed(2), '120.01'); - expect(finalBearing, calculateFinalBearing(start, end)); - }); + var finalBearing = bearing(start, end, calcFinal: true); + expect(finalBearing.toStringAsFixed(2), '120.01'); + expect(finalBearing, calculateFinalBearing(start, end)); + }, + ); } diff --git a/test/components/center_test.dart b/test/components/center_test.dart index 2ad5fac5..c642d22e 100644 --- a/test/components/center_test.dart +++ b/test/components/center_test.dart @@ -6,7 +6,7 @@ import 'package:turf/meta.dart'; import 'package:turf/src/bbox_polygon.dart'; import 'package:turf/turf.dart'; -main() { +void main() { group( 'center in == out', () { @@ -58,6 +58,7 @@ main() { ); featureCollection.features.add(extent); + // ignore: prefer_interpolation_to_compose_strings var outPath = './' + file.uri.pathSegments .sublist(0, file.uri.pathSegments.length - 2) diff --git a/test/components/clean_coords_test.dart b/test/components/clean_coords_test.dart index f631059b..4edd3b39 100644 --- a/test/components/clean_coords_test.dart +++ b/test/components/clean_coords_test.dart @@ -6,7 +6,7 @@ import 'package:turf/src/clean_coords.dart'; import 'package:turf/src/truncate.dart'; import 'package:turf_equality/turf_equality.dart'; -main() { +void main() { group( 'cleanCoords', () { @@ -19,6 +19,7 @@ main() { var inSource = file.readAsStringSync(); var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); Feature results = cleanCoords(inGeom); + // ignore: prefer_interpolation_to_compose_strings var outPath = './' + file.uri.pathSegments .sublist(0, file.uri.pathSegments.length - 2) diff --git a/test/components/cluster_test.dart b/test/components/cluster_test.dart index 967e8fd5..8b6d0738 100644 --- a/test/components/cluster_test.dart +++ b/test/components/cluster_test.dart @@ -23,7 +23,7 @@ final geojson = FeatureCollection(features: [ Feature(geometry: Point(coordinates: Position.of([4, 3])), properties: null), ]); -main() { +void main() { test("clusters -- getCluster", () { expect(getCluster(geojson, '0').features.length, 1); expect(() => getCluster(geojson, 1), throwsA(isA())); diff --git a/test/components/destination_test.dart b/test/components/destination_test.dart index 257aef65..341570e2 100644 --- a/test/components/destination_test.dart +++ b/test/components/destination_test.dart @@ -4,7 +4,7 @@ import 'package:turf/destination.dart'; import 'package:turf/distance.dart'; import 'package:turf/helpers.dart'; -main() { +void main() { num defaultBearing = 180; num defaultDistance = 100; diff --git a/test/components/explode_test.dart b/test/components/explode_test.dart index a068ad4b..d5c55984 100644 --- a/test/components/explode_test.dart +++ b/test/components/explode_test.dart @@ -5,7 +5,7 @@ import 'package:test/test.dart'; import 'package:turf/src/explode.dart'; import 'package:turf/turf.dart'; -main() { +void main() { group( 'explode in == out', () { @@ -19,6 +19,7 @@ main() { var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); var inExploded = explode(inGeom); + // ignore: prefer_interpolation_to_compose_strings var outPath = './' + file.uri.pathSegments .sublist(0, file.uri.pathSegments.length - 2) diff --git a/test/components/geojson_test.dart b/test/components/geojson_test.dart index 957c730e..87a29c67 100644 --- a/test/components/geojson_test.dart +++ b/test/components/geojson_test.dart @@ -6,10 +6,10 @@ import 'package:test/test.dart'; import 'package:turf/distance.dart'; import 'package:turf/helpers.dart'; -main() { +void main() { group('Coordinate Types:', () { test('Position', () { - _expectArgs(Position pos) { + void _expectArgs(Position pos) { expect(pos.lng, 1); expect(pos.lat, 2); expect(pos.alt, 3); @@ -55,7 +55,7 @@ main() { }); test('BBox', () { - _expectArgs(BBox bbox) { + void _expectArgs(BBox bbox) { expect(bbox.lng1, 1); expect(bbox.lat1, 2); expect(bbox.alt1, 3); @@ -110,7 +110,7 @@ main() { }); group('Longitude normalization:', () { var rand = Random(); - _rand() => rand.nextDouble() * (360 * 2) - 360; + double _rand() => rand.nextDouble() * (360 * 2) - 360; test('Position.toSigned', () { for (var i = 0; i < 10; i++) { var coord = Position.named(lat: _rand(), lng: _rand(), alt: 0); @@ -396,7 +396,7 @@ main() { expect(geom.bbox, isNotNull); expect(geom.coordinates, isNotEmpty); - _expandRecursively(List inner) { + Iterable _expandRecursively(List inner) { if (inner is List) { return inner; } else { @@ -411,7 +411,6 @@ main() { Position(100, 0), ); } - // TODO refine tests }, ); @@ -463,7 +462,9 @@ main() { group('Example file', () { var dir = Directory('./test/examples'); for (var file in dir.listSync(recursive: true)) { - if (file is File && file.path.endsWith('.geojson')) { + if (file is File && + file.path.endsWith('.geojson') && + !file.path.contains('assertion')) { test(file.path, () { var source = (file).readAsStringSync(); var json = jsonDecode(source); diff --git a/test/components/helpers_test.dart b/test/components/helpers_test.dart index aa76ac32..3ad0cb6d 100644 --- a/test/components/helpers_test.dart +++ b/test/components/helpers_test.dart @@ -2,7 +2,7 @@ import 'dart:math'; import 'package:test/test.dart'; import 'package:turf/helpers.dart'; -main() { +void main() { test('radiansToLength', () { expect(radiansToLength(1, Unit.radians), equals(1)); expect(radiansToLength(1, Unit.kilometers), equals(earthRadius / 1000)); diff --git a/test/components/intersection_test.dart b/test/components/intersection_test.dart index 13bc630f..8ca01927 100644 --- a/test/components/intersection_test.dart +++ b/test/components/intersection_test.dart @@ -22,7 +22,7 @@ final l4 = LineString(coordinates: [ Position(0, 2), ]); -main() { +void main() { test('test intersects()', () { expect(intersects(l1, l2)?.coordinates, Position(1, 1)); expect(intersects(l1, l3)?.coordinates, Position(2, 2)); diff --git a/test/components/invariant_test.dart b/test/components/invariant_test.dart index 3e19cc6c..3fd3539e 100644 --- a/test/components/invariant_test.dart +++ b/test/components/invariant_test.dart @@ -2,7 +2,7 @@ import 'package:test/test.dart'; import 'package:turf/helpers.dart'; import 'package:turf/src/invariant.dart'; -main() { +void main() { LineString line1 = LineString(coordinates: [Position(1, 2), Position(3, 4)]); var feature1 = Feature(geometry: Point(coordinates: Position(1, 2, 3))); diff --git a/test/components/line_intersect_test.dart b/test/components/line_intersect_test.dart new file mode 100644 index 00000000..cfa50260 --- /dev/null +++ b/test/components/line_intersect_test.dart @@ -0,0 +1,165 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:turf/helpers.dart'; +import 'package:turf/src/line_intersect.dart'; +import 'package:turf/src/truncate.dart'; +import 'package:turf_equality/turf_equality.dart'; + +void main() { + group( + 'line_intersect', + () { + Directory dir = Directory('./test/examples/line_intersect/in'); + for (var file in dir.listSync(recursive: true)) { + if (file is File && file.path.endsWith('.geojson')) { + var inSource = file.readAsStringSync(); + var inGeom = + GeoJSONObject.fromJson(jsonDecode(inSource)) as FeatureCollection; + + // ignore: prefer_interpolation_to_compose_strings + var outPath = './' + + file.uri.pathSegments + .sublist(0, file.uri.pathSegments.length - 2) + .join('/') + + '/out/${file.uri.pathSegments.last}'; + + var outSource = File(outPath).readAsStringSync(); + var outGeom = GeoJSONObject.fromJson(jsonDecode(outSource)) + as FeatureCollection; + + test( + "turf-line-intersect", + () { + var results = truncate( + lineIntersect(inGeom.features.first, inGeom.features.last)); + var coll = FeatureCollection() + ..features = [...(results as FeatureCollection).features]; + + coll.features.add(inGeom.features.first); + coll.features.add(inGeom.features.last); + + Equality eq = Equality(); + expect(eq.compare(outGeom, coll), isTrue); + }, + ); + } + } + + test( + "turf-line-intersect - prevent input mutation", + () { + var line1 = LineString(coordinates: [ + Position.of([7, 50]), + Position.of([8, 50]), + Position.of([9, 50]), + ]); + var line2 = LineString(coordinates: [ + Position.of([8, 49]), + Position.of([8, 50]), + Position.of([8, 51]), + ]); + var before1 = line1.toJson(); + var before2 = line2.toJson(); + + lineIntersect(line1, line2); + Equality eq = Equality(); + expect(eq.compare(line1, LineString.fromJson(before1)), true); + expect(eq.compare(line2, LineString.fromJson(before2)), isTrue); + }, + ); + + test( + "turf-line-intersect - Geometry Objects", + () { + var line1 = LineString( + coordinates: [ + Position.of([7, 50]), + Position.of([9, 50]), + ], + ); + var line2 = LineString( + coordinates: [ + Position.of([8, 49]), + Position.of([8, 51]), + ], + ); + // "support Geometry Objects" + expect(lineIntersect(line1, line2).features, isNotEmpty); + // "support Feature Collection" + expect( + lineIntersect( + FeatureCollection( + features: [Feature(geometry: line1)]), + FeatureCollection( + features: [Feature(geometry: line2)])).features, + isNotEmpty); + // expect( + // lineIntersect(GeometryCollection(geometries: [line1]), + // GeometryCollection(geometries: [line2])).features, + // isNotEmpty); + }, + ); + + test( + "turf-line-intersect - same point #688", + () { + var line1 = LineString( + coordinates: [ + Position.of([7, 50]), + Position.of([8, 50]), + Position.of([9, 50]), + ], + ); + var line2 = LineString( + coordinates: [ + Position.of([8, 49]), + Position.of([8, 50]), + Position.of([8, 51]), + ], + ); + + var results = lineIntersect(line1, line2); + expect(results.features.length == 1, true); + + var results2 = lineIntersect( + line1, + line2, + removeDuplicates: false, + ); + expect(results2.features.length == 3, true); + }, + ); + + test( + "turf-line-intersect - polygon support #586", + () { + var poly1 = Polygon( + coordinates: [ + [ + Position.of([7, 50]), + Position.of([8, 50]), + Position.of([9, 50]), + Position.of([7, 50]), + ], + ], + ); + var poly2 = Polygon( + coordinates: [ + [ + Position.of([8, 49]), + Position.of([8, 50]), + Position.of([8, 51]), + Position.of([8, 49]), + ], + ], + ); + + var results = lineIntersect(poly1, poly2); + expect(results.features.length == 1, true); + }, + ); + }, + ); +} diff --git a/test/components/line_segment_test.dart b/test/components/line_segment_test.dart index 3de552e3..8f88c90d 100644 --- a/test/components/line_segment_test.dart +++ b/test/components/line_segment_test.dart @@ -2,7 +2,7 @@ import 'package:turf/src/line_segment.dart'; import 'package:test/test.dart'; import 'package:turf/helpers.dart'; -main() { +void main() { Feature multiLine = Feature( geometry: MultiLineString( coordinates: [ diff --git a/test/components/line_to_polygon_test.dart b/test/components/line_to_polygon_test.dart index 05ee4378..75591f3f 100644 --- a/test/components/line_to_polygon_test.dart +++ b/test/components/line_to_polygon_test.dart @@ -25,6 +25,7 @@ void main() { properties: properties, ); + // ignore: prefer_interpolation_to_compose_strings var outPath = './' + file.uri.pathSegments .sublist(0, file.uri.pathSegments.length - 2) diff --git a/test/components/meta_test.dart b/test/components/meta_test.dart index 102bdbab..b178cb18 100644 --- a/test/components/meta_test.dart +++ b/test/components/meta_test.dart @@ -193,7 +193,7 @@ FeatureCollection getAsMixedFeatCollection( ); } -main() { +void main() { test('coordEach -- Point', () { featureAndCollection(pt.geometry!).forEach((input) { coordEach(input, (currentCoord, coordIndex, featureIndex, diff --git a/test/components/midpoint_test.dart b/test/components/midpoint_test.dart index 6f512498..118403d1 100644 --- a/test/components/midpoint_test.dart +++ b/test/components/midpoint_test.dart @@ -4,8 +4,8 @@ import 'package:turf/helpers.dart'; import 'package:turf/midpoint.dart'; void checkLatLngInRange(Point result) { - _lngRange(num lng) => lng >= -180 && lng <= 180; - _latRange(num lat) => lat >= -90 && lat <= 90; + bool _lngRange(num lng) => lng >= -180 && lng <= 180; + bool _latRange(num lat) => lat >= -90 && lat <= 90; expect(_lngRange(result.coordinates.lng), true, reason: 'Longitude of ${result.coordinates.lng} out of range'); @@ -13,7 +13,7 @@ void checkLatLngInRange(Point result) { reason: 'Latitude of ${result.coordinates.lat} out of range'); } -main() { +void main() { test('simple midpoint', () { Position result = midpointRaw( Position.named( diff --git a/test/components/nearest_point_on_line_test.dart b/test/components/nearest_point_on_line_test.dart index 84079e2f..059c688b 100644 --- a/test/components/nearest_point_on_line_test.dart +++ b/test/components/nearest_point_on_line_test.dart @@ -3,7 +3,7 @@ import 'package:turf/distance.dart'; import 'package:turf/helpers.dart'; import 'package:turf/nearest_point_on_line.dart'; -main() { +void main() { test('nearest_point_on_line -- start point', () { final start = Point(coordinates: Position.of([-122.457175, 37.720033])); final end = Point(coordinates: Position.of([-122.457175, 37.718242])); diff --git a/test/components/polygon_smooth_test.dart b/test/components/polygon_smooth_test.dart index 73379b9e..2b92dab5 100644 --- a/test/components/polygon_smooth_test.dart +++ b/test/components/polygon_smooth_test.dart @@ -6,7 +6,7 @@ import 'package:turf/polygon_smooth.dart'; import 'package:turf/turf.dart'; import 'package:turf_equality/turf_equality.dart'; -main() { +void main() { group("turf-polygon-smooth", () { var inDir = Directory('./test/examples/polygonSmooth/in'); for (var file in inDir.listSync(recursive: true)) { @@ -15,6 +15,7 @@ main() { var inSource = file.readAsStringSync(); var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); var results = polygonSmooth(inGeom, iterations: 3); + // ignore: prefer_interpolation_to_compose_strings var outPath = './' + file.uri.pathSegments .sublist(0, file.uri.pathSegments.length - 2) diff --git a/test/components/polygon_to_line_test.dart b/test/components/polygon_to_line_test.dart index 80846538..a4b761f1 100644 --- a/test/components/polygon_to_line_test.dart +++ b/test/components/polygon_to_line_test.dart @@ -6,7 +6,7 @@ import 'package:test/scaffolding.dart'; import 'package:turf/polygon_to_line.dart'; import 'package:turf/turf.dart'; -main() { +void main() { group( 'polygonToLine', () { @@ -20,6 +20,7 @@ main() { var inGeom = GeoJSONObject.fromJson(jsonDecode(inSource)); var results = polygonToLine(inGeom); + // ignore: prefer_interpolation_to_compose_strings var outPath = './' + file.uri.pathSegments .sublist(0, file.uri.pathSegments.length - 2) diff --git a/test/components/polyline.dart b/test/components/polyline.dart index 6f9b030e..1083e688 100644 --- a/test/components/polyline.dart +++ b/test/components/polyline.dart @@ -2,7 +2,7 @@ import 'package:test/test.dart'; import 'package:turf/helpers.dart'; import 'package:turf/polyline.dart'; -main() { +void main() { group('Polyline:', () { var example = [ Position.named(lat: 38.5, lng: -120.2), diff --git a/test/components/rhumb_bearing_test.dart b/test/components/rhumb_bearing_test.dart index 61893e10..2dd01b17 100644 --- a/test/components/rhumb_bearing_test.dart +++ b/test/components/rhumb_bearing_test.dart @@ -5,9 +5,9 @@ import 'package:test/test.dart'; import 'package:turf/helpers.dart'; import 'package:turf/src/rhumb_bearing.dart'; -main() { +void main() { group( - '', + 'Rhumb Bearing test', () { Directory inDir = Directory('./test/examples/rhumb_bearing/in'); for (var file in inDir.listSync(recursive: true)) { diff --git a/test/components/truncate_test.dart b/test/components/truncate_test.dart index 10d2958d..aff618d0 100644 --- a/test/components/truncate_test.dart +++ b/test/components/truncate_test.dart @@ -6,7 +6,7 @@ import 'package:turf/helpers.dart'; import 'package:turf/truncate.dart'; import 'package:turf_equality/turf_equality.dart'; -main() { +void main() { group( 'truncate', () { diff --git a/test/examples/.DS_Store b/test/examples/booleans/.DS_Store similarity index 56% rename from test/examples/.DS_Store rename to test/examples/booleans/.DS_Store index 0c63b13f..f22ab784 100644 Binary files a/test/examples/.DS_Store and b/test/examples/booleans/.DS_Store differ diff --git a/test/examples/booleans/clockwise/false/counter-clockwise-line.geojson b/test/examples/booleans/clockwise/false/counter-clockwise-line.geojson new file mode 100644 index 00000000..26fbd835 --- /dev/null +++ b/test/examples/booleans/clockwise/false/counter-clockwise-line.geojson @@ -0,0 +1,18 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [1, 0], + [1, 1], + [0, 0] + ] + } + } + ] +} diff --git a/test/examples/booleans/clockwise/true/clockwise-line.geojson b/test/examples/booleans/clockwise/true/clockwise-line.geojson new file mode 100644 index 00000000..6853e58a --- /dev/null +++ b/test/examples/booleans/clockwise/true/clockwise-line.geojson @@ -0,0 +1,18 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [1, 1], + [1, 0], + [0, 0] + ] + } + } + ] +} diff --git a/test/examples/booleans/concave/false/3vertices.geojson b/test/examples/booleans/concave/false/3vertices.geojson new file mode 100644 index 00000000..3537ffdb --- /dev/null +++ b/test/examples/booleans/concave/false/3vertices.geojson @@ -0,0 +1,20 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [0, 0], + [1, 1], + [1, 0], + [0, 0] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/concave/false/diamond.geojson b/test/examples/booleans/concave/false/diamond.geojson new file mode 100644 index 00000000..6cc66192 --- /dev/null +++ b/test/examples/booleans/concave/false/diamond.geojson @@ -0,0 +1,22 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [0.69488525390625, 1.1754546449158993], + [0.263671875, 0.9118267425981088], + [0.56854248046875, 0.4312093081601601], + [0.96954345703125, 0.771766211876697], + [0.83221435546875, 1.016182073033441], + [0.69488525390625, 1.1754546449158993] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/concave/false/square.geojson b/test/examples/booleans/concave/false/square.geojson new file mode 100644 index 00000000..e86e427c --- /dev/null +++ b/test/examples/booleans/concave/false/square.geojson @@ -0,0 +1,21 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [0, 0], + [0, 1], + [1, 1], + [1, 0], + [0, 0] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/concave/true/polygon.geojson b/test/examples/booleans/concave/true/polygon.geojson new file mode 100644 index 00000000..588bb794 --- /dev/null +++ b/test/examples/booleans/concave/true/polygon.geojson @@ -0,0 +1,22 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [0, 0], + [1, 0], + [1, 1], + [0.5, 0.5], + [0, 1], + [0, 0] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/concave/true/polygon2.geojson b/test/examples/booleans/concave/true/polygon2.geojson new file mode 100644 index 00000000..fb6e79b5 --- /dev/null +++ b/test/examples/booleans/concave/true/polygon2.geojson @@ -0,0 +1,28 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [0.85418701171875, 1.06286628163273], + [0.46966552734375, 0.7909904981540058], + [0.6619262695312499, 0.5712795966325395], + [0.77178955078125, 0.856901647439813], + [0.736083984375, 0.8514090937773031], + [0.6591796875, 0.8129610018708315], + [0.6921386718749999, 0.884364296613886], + [0.9173583984375001, 0.8898568022677679], + [1.07391357421875, 0.8129610018708315], + [1.0876464843749998, 0.9392889790847924], + [1.0052490234375, 1.0271666545523288], + [0.85418701171875, 1.06286628163273] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/diagrams/esri-contains.gif b/test/examples/booleans/contains/diagrams/esri-contains.gif new file mode 100644 index 00000000..6b219104 Binary files /dev/null and b/test/examples/booleans/contains/diagrams/esri-contains.gif differ diff --git a/test/examples/booleans/contains/test/false/LineString/LineString/LineIsNotContainedByLine.geojson b/test/examples/booleans/contains/test/false/LineString/LineString/LineIsNotContainedByLine.geojson new file mode 100644 index 00000000..9ad941da --- /dev/null +++ b/test/examples/booleans/contains/test/false/LineString/LineString/LineIsNotContainedByLine.geojson @@ -0,0 +1,30 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 2], + [1, 3], + [1, 15.5] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/LineString/Polygon/LineIsNotContainedByPolygon.geojson b/test/examples/booleans/contains/test/false/LineString/Polygon/LineIsNotContainedByPolygon.geojson new file mode 100644 index 00000000..8e2caf0e --- /dev/null +++ b/test/examples/booleans/contains/test/false/LineString/Polygon/LineIsNotContainedByPolygon.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 2], + [1, 3], + [1, 15.5] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/LineString/Polygon/LineIsNotContainedByPolygonBoundary.geojson b/test/examples/booleans/contains/test/false/LineString/Polygon/LineIsNotContainedByPolygonBoundary.geojson new file mode 100644 index 00000000..b5a0114a --- /dev/null +++ b/test/examples/booleans/contains/test/false/LineString/Polygon/LineIsNotContainedByPolygonBoundary.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 2], + [1, 3], + [1, 3.5] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/MultiPoint/LineString/MultiPointsIsNotContainedByLine.geojson b/test/examples/booleans/contains/test/false/MultiPoint/LineString/MultiPointsIsNotContainedByLine.geojson new file mode 100644 index 00000000..496c3bf6 --- /dev/null +++ b/test/examples/booleans/contains/test/false/MultiPoint/LineString/MultiPointsIsNotContainedByLine.geojson @@ -0,0 +1,30 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12], + [15, 15] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/MultiPoint/LineString/MultiPointsOnLineEndsIsNotContainedByLine.geojson b/test/examples/booleans/contains/test/false/MultiPoint/LineString/MultiPointsOnLineEndsIsNotContainedByLine.geojson new file mode 100644 index 00000000..88a1d75e --- /dev/null +++ b/test/examples/booleans/contains/test/false/MultiPoint/LineString/MultiPointsOnLineEndsIsNotContainedByLine.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/MultiPoint/MultiPoint/MultiPointIsNotContainedByMultiPoint.geojson b/test/examples/booleans/contains/test/false/MultiPoint/MultiPoint/MultiPointIsNotContainedByMultiPoint.geojson new file mode 100644 index 00000000..abe3550d --- /dev/null +++ b/test/examples/booleans/contains/test/false/MultiPoint/MultiPoint/MultiPointIsNotContainedByMultiPoint.geojson @@ -0,0 +1,28 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12], + [15, 15] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [1, 1.5] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/MultiPoint/Polygon/MultiPointAllOnBoundaryIsNotContainedByPolygon.geojson b/test/examples/booleans/contains/test/false/MultiPoint/Polygon/MultiPointAllOnBoundaryIsNotContainedByPolygon.geojson new file mode 100644 index 00000000..f9f55a6b --- /dev/null +++ b/test/examples/booleans/contains/test/false/MultiPoint/Polygon/MultiPointAllOnBoundaryIsNotContainedByPolygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [1, 10] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/MultiPoint/Polygon/MultiPointIsNotContainedByPolygon.geojson b/test/examples/booleans/contains/test/false/MultiPoint/Polygon/MultiPointIsNotContainedByPolygon.geojson new file mode 100644 index 00000000..b6cbb2b0 --- /dev/null +++ b/test/examples/booleans/contains/test/false/MultiPoint/Polygon/MultiPointIsNotContainedByPolygon.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12], + [15, 15] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/Point/LineString/PointIsNotContainedByLine.geojson b/test/examples/booleans/contains/test/false/Point/LineString/PointIsNotContainedByLine.geojson new file mode 100644 index 00000000..9342e2ee --- /dev/null +++ b/test/examples/booleans/contains/test/false/Point/LineString/PointIsNotContainedByLine.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2, 2] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/Point/LineString/PointIsNotContainedByLineBecauseOnEnd.geojson b/test/examples/booleans/contains/test/false/Point/LineString/PointIsNotContainedByLineBecauseOnEnd.geojson new file mode 100644 index 00000000..ae3cd8ad --- /dev/null +++ b/test/examples/booleans/contains/test/false/Point/LineString/PointIsNotContainedByLineBecauseOnEnd.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 4] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/Point/LineString/PointOnEndIsContainedByLinestring.geojson b/test/examples/booleans/contains/test/false/Point/LineString/PointOnEndIsContainedByLinestring.geojson new file mode 100644 index 00000000..39e7953d --- /dev/null +++ b/test/examples/booleans/contains/test/false/Point/LineString/PointOnEndIsContainedByLinestring.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/Point/MultiPoint/PointIsNotContainedBYMultiPoint.geojson b/test/examples/booleans/contains/test/false/Point/MultiPoint/PointIsNotContainedBYMultiPoint.geojson new file mode 100644 index 00000000..e67d5e0a --- /dev/null +++ b/test/examples/booleans/contains/test/false/Point/MultiPoint/PointIsNotContainedBYMultiPoint.geojson @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 4] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/Point/Polygon/PointIsNotContainedByPolygon.geojson b/test/examples/booleans/contains/test/false/Point/Polygon/PointIsNotContainedByPolygon.geojson new file mode 100644 index 00000000..09bb41c7 --- /dev/null +++ b/test/examples/booleans/contains/test/false/Point/Polygon/PointIsNotContainedByPolygon.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [14, 14] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/Point/Polygon/PointOnPolygonBoundary.geojson b/test/examples/booleans/contains/test/false/Point/Polygon/PointOnPolygonBoundary.geojson new file mode 100644 index 00000000..685a46d3 --- /dev/null +++ b/test/examples/booleans/contains/test/false/Point/Polygon/PointOnPolygonBoundary.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/Polygon/LineString/issue-#1201-false.geojson b/test/examples/booleans/contains/test/false/Polygon/LineString/issue-#1201-false.geojson new file mode 100644 index 00000000..d0b6f5fc --- /dev/null +++ b/test/examples/booleans/contains/test/false/Polygon/LineString/issue-#1201-false.geojson @@ -0,0 +1,40 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#0000ff", + "stroke-width": 6, + "stroke-opacity": 1, + "fill": "#0000ff", + "fill-opacity": 0.3 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [98.8769531, 35.3173663], + [83.144531, 14.349547], + [111.621093, 14.8598504], + [98.8769531, 35.3173663] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [111.621093, 14.8598504], + [98.8769531, 35.3173663] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/Polygon/Polygon/Polygon-Polygon.geojson b/test/examples/booleans/contains/test/false/Polygon/Polygon/Polygon-Polygon.geojson new file mode 100644 index 00000000..505f22ed --- /dev/null +++ b/test/examples/booleans/contains/test/false/Polygon/Polygon/Polygon-Polygon.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 20], + [1, 3], + [1, 4], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/false/Polygon/Polygon/Polygon-Polygon2.geojson b/test/examples/booleans/contains/test/false/Polygon/Polygon/Polygon-Polygon2.geojson new file mode 100644 index 00000000..88fbf6d5 --- /dev/null +++ b/test/examples/booleans/contains/test/false/Polygon/Polygon/Polygon-Polygon2.geojson @@ -0,0 +1,47 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#ffa200", + "stroke-width": 2, + "stroke-opacity": 1, + "fill": "#d4c63b", + "fill-opacity": 0.5, + "description": "shape which was intersected with a longer pipe to produce the pipe shown" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [3.1249679625034332, 50.90354450528237], + [3.1252093613147736, 50.90354957970863], + [3.1252361834049225, 50.90334491073787], + [3.125006854534149, 50.903344064996546], + [3.1248298287391663, 50.90339988389688], + [3.1249679625034332, 50.90354450528237] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "description": "output of an intersect call with a longer pipe and the other feature in this file" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [3.124910769300162, 50.90341155120744], + [3.12484701356319, 50.90343165437331], + [3.124918293470778, 50.903431917293965], + [3.124982049176972, 50.90341181412811], + [3.124910769300162, 50.90341155120744] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/true/LineString/LineString/LineIsContainedByLine.geojson b/test/examples/booleans/contains/test/true/LineString/LineString/LineIsContainedByLine.geojson new file mode 100644 index 00000000..0e96a0fe --- /dev/null +++ b/test/examples/booleans/contains/test/true/LineString/LineString/LineIsContainedByLine.geojson @@ -0,0 +1,30 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 2], + [1, 3], + [1, 3.5] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/true/LineString/LineString/LinesExactlySame.geojson b/test/examples/booleans/contains/test/true/LineString/LineString/LinesExactlySame.geojson new file mode 100644 index 00000000..034737ba --- /dev/null +++ b/test/examples/booleans/contains/test/true/LineString/LineString/LinesExactlySame.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/true/LineString/Polygon/LineIsContainedByPolygon.geojson b/test/examples/booleans/contains/test/true/LineString/Polygon/LineIsContainedByPolygon.geojson new file mode 100644 index 00000000..fdbf01a4 --- /dev/null +++ b/test/examples/booleans/contains/test/true/LineString/Polygon/LineIsContainedByPolygon.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [2, 3], + [2, 3.5] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/true/LineString/Polygon/LineIsContainedByPolygonWithNoInternalVertices.geojson b/test/examples/booleans/contains/test/true/LineString/Polygon/LineIsContainedByPolygonWithNoInternalVertices.geojson new file mode 100644 index 00000000..458c29ba --- /dev/null +++ b/test/examples/booleans/contains/test/true/LineString/Polygon/LineIsContainedByPolygonWithNoInternalVertices.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [10, 10] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/true/MultiPoint/LineString/MultipointsIsContainedByLine.geojson b/test/examples/booleans/contains/test/true/MultiPoint/LineString/MultipointsIsContainedByLine.geojson new file mode 100644 index 00000000..867d63a7 --- /dev/null +++ b/test/examples/booleans/contains/test/true/MultiPoint/LineString/MultipointsIsContainedByLine.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [1, 1.5] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/true/MultiPoint/MultiPoint/MultiPointsContainedByMultiPoints.geojson b/test/examples/booleans/contains/test/true/MultiPoint/MultiPoint/MultiPointsContainedByMultiPoints.geojson new file mode 100644 index 00000000..007ec9df --- /dev/null +++ b/test/examples/booleans/contains/test/true/MultiPoint/MultiPoint/MultiPointsContainedByMultiPoints.geojson @@ -0,0 +1,28 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12], + [15, 15] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [15, 15] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/true/MultiPoint/MultiPoint/MultiPointsEqual.geojson b/test/examples/booleans/contains/test/true/MultiPoint/MultiPoint/MultiPointsEqual.geojson new file mode 100644 index 00000000..8a0585fe --- /dev/null +++ b/test/examples/booleans/contains/test/true/MultiPoint/MultiPoint/MultiPointsEqual.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12], + [15, 15] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12], + [15, 15] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/true/MultiPoint/Polygon/MultiPointIsContainedByPolygonBoundary.geojson b/test/examples/booleans/contains/test/true/MultiPoint/Polygon/MultiPointIsContainedByPolygonBoundary.geojson new file mode 100644 index 00000000..321c7587 --- /dev/null +++ b/test/examples/booleans/contains/test/true/MultiPoint/Polygon/MultiPointIsContainedByPolygonBoundary.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [2, 2], + [4, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/true/Point/LineString/PointIsContainedByLine.geojson b/test/examples/booleans/contains/test/true/Point/LineString/PointIsContainedByLine.geojson new file mode 100644 index 00000000..cd6c19d0 --- /dev/null +++ b/test/examples/booleans/contains/test/true/Point/LineString/PointIsContainedByLine.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 2] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/true/Point/MultiPoint/PointIsContainedByMultiPoint.geojson b/test/examples/booleans/contains/test/true/Point/MultiPoint/PointIsContainedByMultiPoint.geojson new file mode 100644 index 00000000..ad874c8a --- /dev/null +++ b/test/examples/booleans/contains/test/true/Point/MultiPoint/PointIsContainedByMultiPoint.geojson @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/true/Point/Polygon/PointInsidePolygonBoundary.geojson b/test/examples/booleans/contains/test/true/Point/Polygon/PointInsidePolygonBoundary.geojson new file mode 100644 index 00000000..7914f4a2 --- /dev/null +++ b/test/examples/booleans/contains/test/true/Point/Polygon/PointInsidePolygonBoundary.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [4, 4] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/true/Polygon/LineString/issue-#1201-true.geojson b/test/examples/booleans/contains/test/true/Polygon/LineString/issue-#1201-true.geojson new file mode 100644 index 00000000..6c5dad23 --- /dev/null +++ b/test/examples/booleans/contains/test/true/Polygon/LineString/issue-#1201-true.geojson @@ -0,0 +1,40 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#0000ff", + "stroke-width": 6, + "stroke-opacity": 1, + "fill": "#0000ff", + "fill-opacity": 0.3 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [98.8769531, 35.3173663], + [83.144531, 14.349547], + [111.621093, 14.8598504], + [98.8769531, 35.3173663] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [111.621093, 14.8598504], + [98.8769531, 30.3173663] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/true/Polygon/Polygon/PolygonExactSameShape.geojson b/test/examples/booleans/contains/test/true/Polygon/Polygon/PolygonExactSameShape.geojson new file mode 100644 index 00000000..8bfd83da --- /dev/null +++ b/test/examples/booleans/contains/test/true/Polygon/Polygon/PolygonExactSameShape.geojson @@ -0,0 +1,41 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "fill": "#F00" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-12.65625, 36.87962060502676], + [35.419921875, 36.38591277287651], + [37.79296875, 56.897003921272606], + [-12.12890625, 57.040729838360875], + [-12.65625, 36.87962060502676] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "fill": "#F00" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-12.65625, 36.87962060502676], + [35.419921875, 36.38591277287651], + [37.79296875, 56.897003921272606], + [-12.12890625, 57.040729838360875], + [-12.65625, 36.87962060502676] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/contains/test/true/Polygon/Polygon/PolygonIsContainedByPolygon.geojson b/test/examples/booleans/contains/test/true/Polygon/Polygon/PolygonIsContainedByPolygon.geojson new file mode 100644 index 00000000..afc9190b --- /dev/null +++ b/test/examples/booleans/contains/test/true/Polygon/Polygon/PolygonIsContainedByPolygon.geojson @@ -0,0 +1,36 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [2, 2], + [3, 2], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/crosses/false/LineString/LineString/LineDoesNotCrossButTouches.geojson b/test/examples/booleans/crosses/false/LineString/LineString/LineDoesNotCrossButTouches.geojson new file mode 100644 index 00000000..71399ad5 --- /dev/null +++ b/test/examples/booleans/crosses/false/LineString/LineString/LineDoesNotCrossButTouches.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-2, 2], + [1, 1] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/crosses/false/LineString/LineString/LineDoesNotCrossLine.geojson b/test/examples/booleans/crosses/false/LineString/LineString/LineDoesNotCrossLine.geojson new file mode 100644 index 00000000..9b16e576 --- /dev/null +++ b/test/examples/booleans/crosses/false/LineString/LineString/LineDoesNotCrossLine.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-2, 2], + [-4, 2] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/crosses/false/LineString/Polygon/LineDoesNotCrossPolygon.geojson b/test/examples/booleans/crosses/false/LineString/Polygon/LineDoesNotCrossPolygon.geojson new file mode 100644 index 00000000..66682b0d --- /dev/null +++ b/test/examples/booleans/crosses/false/LineString/Polygon/LineDoesNotCrossPolygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-2, 2], + [-4, 2] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/crosses/false/MultiPoint/LineString/MultiPointNotCrossLine.geojson b/test/examples/booleans/crosses/false/MultiPoint/LineString/MultiPointNotCrossLine.geojson new file mode 100644 index 00000000..63d1b79d --- /dev/null +++ b/test/examples/booleans/crosses/false/MultiPoint/LineString/MultiPointNotCrossLine.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [2, 2], + [1, -1.5] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/crosses/false/MultiPoint/LineString/MultiPointNotCrossLineEnd.geojson b/test/examples/booleans/crosses/false/MultiPoint/LineString/MultiPointNotCrossLineEnd.geojson new file mode 100644 index 00000000..2ba9a67d --- /dev/null +++ b/test/examples/booleans/crosses/false/MultiPoint/LineString/MultiPointNotCrossLineEnd.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/crosses/false/MultiPoint/Polygon/MultiPointNotCrossPolygon.geojson b/test/examples/booleans/crosses/false/MultiPoint/Polygon/MultiPointNotCrossPolygon.geojson new file mode 100644 index 00000000..8a5f8ad9 --- /dev/null +++ b/test/examples/booleans/crosses/false/MultiPoint/Polygon/MultiPointNotCrossPolygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [3, 3], + [4, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [0, 2], + [2, 2], + [2, 0], + [0, 0], + [0, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/crosses/true/LineString/LineString/LineCrossesLine.geojson b/test/examples/booleans/crosses/true/LineString/LineString/LineCrossesLine.geojson new file mode 100644 index 00000000..f6b91e23 --- /dev/null +++ b/test/examples/booleans/crosses/true/LineString/LineString/LineCrossesLine.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-2, 2], + [4, 2] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/crosses/true/LineString/Polygon/LineCrossesPolygon.geojson b/test/examples/booleans/crosses/true/LineString/Polygon/LineCrossesPolygon.geojson new file mode 100644 index 00000000..356e33cc --- /dev/null +++ b/test/examples/booleans/crosses/true/LineString/Polygon/LineCrossesPolygon.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/crosses/true/LineString/Polygon/LineCrossesPolygonPartial.geojson b/test/examples/booleans/crosses/true/LineString/Polygon/LineCrossesPolygonPartial.geojson new file mode 100644 index 00000000..fcb8e161 --- /dev/null +++ b/test/examples/booleans/crosses/true/LineString/Polygon/LineCrossesPolygonPartial.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0.5, 2.5], + [1, 1] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/crosses/true/MultiPoint/LineString/MultiPointsCrossLine.geojson b/test/examples/booleans/crosses/true/MultiPoint/LineString/MultiPointsCrossLine.geojson new file mode 100644 index 00000000..c5819920 --- /dev/null +++ b/test/examples/booleans/crosses/true/MultiPoint/LineString/MultiPointsCrossLine.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 2], + [12, 12] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/crosses/true/MultiPoint/Polygon/MultiPointsCrossPolygon.geojson b/test/examples/booleans/crosses/true/MultiPoint/Polygon/MultiPointsCrossPolygon.geojson new file mode 100644 index 00000000..8f13864e --- /dev/null +++ b/test/examples/booleans/crosses/true/MultiPoint/Polygon/MultiPointsCrossPolygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [3, 3], + [1, 1] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [0, 2], + [2, 2], + [2, 0], + [0, 0], + [0, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/.DS_Store b/test/examples/booleans/disjoint/.DS_Store new file mode 100644 index 00000000..78e31eef Binary files /dev/null and b/test/examples/booleans/disjoint/.DS_Store differ diff --git a/test/examples/booleans/disjoint/diagrams/esri-disjoint.gif b/test/examples/booleans/disjoint/diagrams/esri-disjoint.gif new file mode 100644 index 00000000..fef0a5f7 Binary files /dev/null and b/test/examples/booleans/disjoint/diagrams/esri-disjoint.gif differ diff --git a/test/examples/booleans/disjoint/test/false/LineString/LineString/LineString-LineString.geojson b/test/examples/booleans/disjoint/test/false/LineString/LineString/LineString-LineString.geojson new file mode 100644 index 00000000..5ad6f986 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/LineString/LineString/LineString-LineString.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 2], + [12, 2], + [12, 3], + [12, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/LineString/Point/LineString-Point-1.geojson b/test/examples/booleans/disjoint/test/false/LineString/Point/LineString-Point-1.geojson new file mode 100644 index 00000000..39e7953d --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/LineString/Point/LineString-Point-1.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/LineString/Point/LineString-Point-2.geojson b/test/examples/booleans/disjoint/test/false/LineString/Point/LineString-Point-2.geojson new file mode 100644 index 00000000..323ca4e1 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/LineString/Point/LineString-Point-2.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1.5] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/LineString/Polygon/LineString-In-Polygon.geojson b/test/examples/booleans/disjoint/test/false/LineString/Polygon/LineString-In-Polygon.geojson new file mode 100644 index 00000000..62d55b65 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/LineString/Polygon/LineString-In-Polygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 2.5], + [2, 2.5] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/LineString/Polygon/LineString-Polygon.geojson b/test/examples/booleans/disjoint/test/false/LineString/Polygon/LineString-Polygon.geojson new file mode 100644 index 00000000..be2b9688 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/LineString/Polygon/LineString-Polygon.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 2], + [12, 2], + [12, 3], + [12, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/MultiPoint/LineString/MultiPoint-LineString.geojson b/test/examples/booleans/disjoint/test/false/MultiPoint/LineString/MultiPoint-LineString.geojson new file mode 100644 index 00000000..f7bc3dd8 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/MultiPoint/LineString/MultiPoint-LineString.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [0, 0] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/MultiPoint/MultiPoint/MultiPoint-MultiPoint.geojson b/test/examples/booleans/disjoint/test/false/MultiPoint/MultiPoint/MultiPoint-MultiPoint.geojson new file mode 100644 index 00000000..85a8e2cd --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/MultiPoint/MultiPoint/MultiPoint-MultiPoint.geojson @@ -0,0 +1,27 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [0, 0], + [12, 12] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/MultiPoint/Polygon/MultiPoint-Polygon.geojson b/test/examples/booleans/disjoint/test/false/MultiPoint/Polygon/MultiPoint-Polygon.geojson new file mode 100644 index 00000000..da402f37 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/MultiPoint/Polygon/MultiPoint-Polygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-1, 2], + [-2, -2] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/MultiPolygon/Polygon/MultiPolygon-Polygon.geojson b/test/examples/booleans/disjoint/test/false/MultiPolygon/Polygon/MultiPolygon-Polygon.geojson new file mode 100644 index 00000000..706074d3 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/MultiPolygon/Polygon/MultiPolygon-Polygon.geojson @@ -0,0 +1,52 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "fill": "#ff0000" + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [122.6953125, -19.186677697957833], + [128.759765625, -19.186677697957833], + [128.759765625, -15.28418511407642], + [122.6953125, -15.28418511407642], + [122.6953125, -19.186677697957833] + ] + ], + [ + [ + [123.74999999999999, -25.918526162075153], + [130.25390625, -25.918526162075153], + [130.25390625, -20.715015145512087], + [123.74999999999999, -20.715015145512087], + [123.74999999999999, -25.918526162075153] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "fill": "#0000ff" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [119.20166015624999, -22.776181505086495], + [125.09033203124999, -22.776181505086495], + [125.09033203124999, -18.417078658661257], + [119.20166015624999, -18.417078658661257], + [119.20166015624999, -22.776181505086495] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Point/LineString/Point-LineString-1.geojson b/test/examples/booleans/disjoint/test/false/Point/LineString/Point-LineString-1.geojson new file mode 100644 index 00000000..b84728a8 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Point/LineString/Point-LineString-1.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Point/LineString/Point-LineString-2.geojson b/test/examples/booleans/disjoint/test/false/Point/LineString/Point-LineString-2.geojson new file mode 100644 index 00000000..a937db0c --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Point/LineString/Point-LineString-2.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1.5] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Point/LineString/Point-LineString-3.geojson b/test/examples/booleans/disjoint/test/false/Point/LineString/Point-LineString-3.geojson new file mode 100644 index 00000000..46d35691 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Point/LineString/Point-LineString-3.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2.5, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [2, 1], + [3, 1], + [4, 1] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Point/LineString/Point-LineString-4.geojson b/test/examples/booleans/disjoint/test/false/Point/LineString/Point-LineString-4.geojson new file mode 100644 index 00000000..cf348f68 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Point/LineString/Point-LineString-4.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2.5, 2.5] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [2, 2], + [3, 3], + [4, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Point/MultiPoint/Point-MultiPoint.geojson b/test/examples/booleans/disjoint/test/false/Point/MultiPoint/Point-MultiPoint.geojson new file mode 100644 index 00000000..f958a470 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Point/MultiPoint/Point-MultiPoint.geojson @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Point/Point/Point-Point.geojson b/test/examples/booleans/disjoint/test/false/Point/Point/Point-Point.geojson new file mode 100644 index 00000000..15b60d6f --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Point/Point/Point-Point.geojson @@ -0,0 +1,21 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Point/Polygon/Point-Polygon-1.geojson b/test/examples/booleans/disjoint/test/false/Point/Polygon/Point-Polygon-1.geojson new file mode 100644 index 00000000..5ef704e8 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Point/Polygon/Point-Polygon-1.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 2.5] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Point/Polygon/Point-Polygon-2.geojson b/test/examples/booleans/disjoint/test/false/Point/Polygon/Point-Polygon-2.geojson new file mode 100644 index 00000000..b3a139a5 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Point/Polygon/Point-Polygon-2.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-1, 2] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Polygon/LineString/Polygon-Containing-Linestring.geojson b/test/examples/booleans/disjoint/test/false/Polygon/LineString/Polygon-Containing-Linestring.geojson new file mode 100644 index 00000000..a840dc09 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Polygon/LineString/Polygon-Containing-Linestring.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 2.5], + [2, 2.5] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Polygon/LineString/Polygon-LineString.geojson b/test/examples/booleans/disjoint/test/false/Polygon/LineString/Polygon-LineString.geojson new file mode 100644 index 00000000..83323524 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Polygon/LineString/Polygon-LineString.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 2], + [12, 2], + [12, 3], + [12, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Polygon/MultiPolygon/Polygon-MultiPolygon.geojson b/test/examples/booleans/disjoint/test/false/Polygon/MultiPolygon/Polygon-MultiPolygon.geojson new file mode 100644 index 00000000..59b2a579 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Polygon/MultiPolygon/Polygon-MultiPolygon.geojson @@ -0,0 +1,52 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "fill": "#0000ff" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [119.20166015624999, -22.776181505086495], + [125.09033203124999, -22.776181505086495], + [125.09033203124999, -18.417078658661257], + [119.20166015624999, -18.417078658661257], + [119.20166015624999, -22.776181505086495] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "fill": "#ff0000" + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [122.6953125, -19.186677697957833], + [128.759765625, -19.186677697957833], + [128.759765625, -15.28418511407642], + [122.6953125, -15.28418511407642], + [122.6953125, -19.186677697957833] + ] + ], + [ + [ + [123.74999999999999, -25.918526162075153], + [130.25390625, -25.918526162075153], + [130.25390625, -20.715015145512087], + [123.74999999999999, -20.715015145512087], + [123.74999999999999, -25.918526162075153] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Polygon/Point/Polygon-Point.geojson b/test/examples/booleans/disjoint/test/false/Polygon/Point/Polygon-Point.geojson new file mode 100644 index 00000000..c2131b4a --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Polygon/Point/Polygon-Point.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 2.5] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Polygon/Polygon/Large-Inside-Small.geojson b/test/examples/booleans/disjoint/test/false/Polygon/Polygon/Large-Inside-Small.geojson new file mode 100644 index 00000000..9a52b0dd --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Polygon/Polygon/Large-Inside-Small.geojson @@ -0,0 +1,39 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [19.6875, 34.016241889667015], + [14.765625, 26.745610382199022], + [19.6875, 23.563987128451217], + [23.203125, 26.43122806450644], + [22.148437499999996, 30.44867367928756], + [19.6875, 34.016241889667015] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [18.984375, 40.44694705960048], + [7.03125, 25.48295117535531], + [19.335937499999996, 18.979025953255267], + [31.640625, 24.206889622398023], + [24.960937499999996, 34.88593094075317], + [18.984375, 40.44694705960048] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Polygon/Polygon/Polygon-Polygon.geojson b/test/examples/booleans/disjoint/test/false/Polygon/Polygon/Polygon-Polygon.geojson new file mode 100644 index 00000000..70b69b88 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Polygon/Polygon/Polygon-Polygon.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [-13, -12], + [-13, -13], + [-11, -13], + [-1, 2] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Polygon/Polygon/Small-Inside-Large.geojson b/test/examples/booleans/disjoint/test/false/Polygon/Polygon/Small-Inside-Large.geojson new file mode 100644 index 00000000..15e635f5 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Polygon/Polygon/Small-Inside-Large.geojson @@ -0,0 +1,39 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [18.984375, 40.44694705960048], + [7.03125, 25.48295117535531], + [19.335937499999996, 18.979025953255267], + [31.640625, 24.206889622398023], + [24.960937499999996, 34.88593094075317], + [18.984375, 40.44694705960048] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [19.6875, 34.016241889667015], + [14.765625, 26.745610382199022], + [19.6875, 23.563987128451217], + [23.203125, 26.43122806450644], + [22.148437499999996, 30.44867367928756], + [19.6875, 34.016241889667015] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/false/Polygon/Polygon/issue-1216.geojson b/test/examples/booleans/disjoint/test/false/Polygon/Polygon/issue-1216.geojson new file mode 100644 index 00000000..41157c99 --- /dev/null +++ b/test/examples/booleans/disjoint/test/false/Polygon/Polygon/issue-1216.geojson @@ -0,0 +1,49 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [6.638240782825051, 46.513552354874435], + [6.638240782825051, 46.52452567471025], + [6.632039186485088, 46.52452567471025], + [6.632039186485088, 46.513552354874435], + [6.638240782825051, 46.513552354874435] + ] + ] + }, + "bbox": [ + 6.632039186485088, + 46.513552354874435, + 6.638240782825051, + 46.52452567471025 + ] + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [6.645459572232596, 46.51709747623775], + [6.645459572232596, 46.52102619404951], + [6.626132904233913, 46.52102619404951], + [6.626132904233913, 46.51709747623775], + [6.645459572232596, 46.51709747623775] + ] + ] + }, + "bbox": [ + 6.626132904233913, + 46.51709747623775, + 6.645459572232596, + 46.52102619404951 + ] + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/LineString/LineString/LineString-LineString.geojson b/test/examples/booleans/disjoint/test/true/LineString/LineString/LineString-LineString.geojson new file mode 100644 index 00000000..6c774ab5 --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/LineString/LineString/LineString-LineString.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [12, 2], + [12, 3], + [12, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/LineString/Point/LineString-Point.geojson b/test/examples/booleans/disjoint/test/true/LineString/Point/LineString-Point.geojson new file mode 100644 index 00000000..e327ba98 --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/LineString/Point/LineString-Point.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/LineString/Polygon/LineString-Polygon.geojson b/test/examples/booleans/disjoint/test/true/LineString/Polygon/LineString-Polygon.geojson new file mode 100644 index 00000000..d34e7dce --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/LineString/Polygon/LineString-Polygon.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [12, 2], + [12, 3], + [12, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/MultiPoint/LineString/MultiPoint-LineString.geojson b/test/examples/booleans/disjoint/test/true/MultiPoint/LineString/MultiPoint-LineString.geojson new file mode 100644 index 00000000..77b1b718 --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/MultiPoint/LineString/MultiPoint-LineString.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [2, 2], + [0, 0] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/MultiPoint/MultiPoint/MultiPoint-MultiPoint.geojson b/test/examples/booleans/disjoint/test/true/MultiPoint/MultiPoint/MultiPoint-MultiPoint.geojson new file mode 100644 index 00000000..7e3143af --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/MultiPoint/MultiPoint/MultiPoint-MultiPoint.geojson @@ -0,0 +1,27 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [0, 0], + [13, 13] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/MultiPoint/Point/MultiPoint-Point.geojson b/test/examples/booleans/disjoint/test/true/MultiPoint/Point/MultiPoint-Point.geojson new file mode 100644 index 00000000..eb6182a3 --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/MultiPoint/Point/MultiPoint-Point.geojson @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/MultiPoint/Polygon/MultiPoint-Polygon.geojson b/test/examples/booleans/disjoint/test/true/MultiPoint/Polygon/MultiPoint-Polygon.geojson new file mode 100644 index 00000000..469de623 --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/MultiPoint/Polygon/MultiPoint-Polygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-3, -3], + [-2, -2] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/MultiPolygon/Polygon/MultiPolygon-Polygon.geojson b/test/examples/booleans/disjoint/test/true/MultiPolygon/Polygon/MultiPolygon-Polygon.geojson new file mode 100644 index 00000000..3b2ea41f --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/MultiPolygon/Polygon/MultiPolygon-Polygon.geojson @@ -0,0 +1,52 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "fill": "#ff0000" + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [122.6953125, -19.186677697957833], + [128.759765625, -19.186677697957833], + [128.759765625, -15.28418511407642], + [122.6953125, -15.28418511407642], + [122.6953125, -19.186677697957833] + ] + ], + [ + [ + [123.74999999999999, -25.918526162075153], + [130.25390625, -25.918526162075153], + [130.25390625, -20.715015145512087], + [123.74999999999999, -20.715015145512087], + [123.74999999999999, -25.918526162075153] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "fill": "#0000ff" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [116.98242187499999, -24.647017162630352], + [122.87109375, -24.647017162630352], + [122.87109375, -20.34462694382967], + [116.98242187499999, -20.34462694382967], + [116.98242187499999, -24.647017162630352] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/Point/LineString/Point-LineString.geojson b/test/examples/booleans/disjoint/test/true/Point/LineString/Point-LineString.geojson new file mode 100644 index 00000000..be635169 --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/Point/LineString/Point-LineString.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/Point/MultiPoint/Point-Multipoint.geojson b/test/examples/booleans/disjoint/test/true/Point/MultiPoint/Point-Multipoint.geojson new file mode 100644 index 00000000..542362e8 --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/Point/MultiPoint/Point-Multipoint.geojson @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/Point/Point/Point-Point.geojson b/test/examples/booleans/disjoint/test/true/Point/Point/Point-Point.geojson new file mode 100644 index 00000000..6d022c5e --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/Point/Point/Point-Point.geojson @@ -0,0 +1,21 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 1] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/Point/Polygon/Point-Polygon.geojson b/test/examples/booleans/disjoint/test/true/Point/Polygon/Point-Polygon.geojson new file mode 100644 index 00000000..c3d4c6de --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/Point/Polygon/Point-Polygon.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/Polygon/LineString/Polygon-LineString.geojson b/test/examples/booleans/disjoint/test/true/Polygon/LineString/Polygon-LineString.geojson new file mode 100644 index 00000000..52b4a494 --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/Polygon/LineString/Polygon-LineString.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [12, 2], + [12, 3], + [12, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/Polygon/MultiPolygon/Polygon-MultiPolygon.geojson b/test/examples/booleans/disjoint/test/true/Polygon/MultiPolygon/Polygon-MultiPolygon.geojson new file mode 100644 index 00000000..d165d17b --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/Polygon/MultiPolygon/Polygon-MultiPolygon.geojson @@ -0,0 +1,52 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "fill": "#0000ff" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [116.98242187499999, -24.647017162630352], + [122.87109375, -24.647017162630352], + [122.87109375, -20.34462694382967], + [116.98242187499999, -20.34462694382967], + [116.98242187499999, -24.647017162630352] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "fill": "#ff0000" + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [122.6953125, -19.186677697957833], + [128.759765625, -19.186677697957833], + [128.759765625, -15.28418511407642], + [122.6953125, -15.28418511407642], + [122.6953125, -19.186677697957833] + ] + ], + [ + [ + [123.74999999999999, -25.918526162075153], + [130.25390625, -25.918526162075153], + [130.25390625, -20.715015145512087], + [123.74999999999999, -20.715015145512087], + [123.74999999999999, -25.918526162075153] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/Polygon/Point/Polygon-Point.geojson b/test/examples/booleans/disjoint/test/true/Polygon/Point/Polygon-Point.geojson new file mode 100644 index 00000000..557d45be --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/Polygon/Point/Polygon-Point.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + } + ] +} diff --git a/test/examples/booleans/disjoint/test/true/Polygon/Polygon/Polygon-Polygon.geojson b/test/examples/booleans/disjoint/test/true/Polygon/Polygon/Polygon-Polygon.geojson new file mode 100644 index 00000000..66d7ab57 --- /dev/null +++ b/test/examples/booleans/disjoint/test/true/Polygon/Polygon/Polygon-Polygon.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-11, -12], + [-13, -12], + [-13, -13], + [-11, -13], + [-11, -12] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/equal/diagrams/esri-equals.gif b/test/examples/booleans/equal/diagrams/esri-equals.gif new file mode 100644 index 00000000..79fa2f81 Binary files /dev/null and b/test/examples/booleans/equal/diagrams/esri-equals.gif differ diff --git a/test/examples/booleans/equal/test/false/linear-rings.geojson b/test/examples/booleans/equal/test/false/linear-rings.geojson new file mode 100644 index 00000000..a0809033 --- /dev/null +++ b/test/examples/booleans/equal/test/false/linear-rings.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-53.674866943359375, 28.30135788537988], + [-53.337249755859375, 28.47412369059679], + [-53.524017333984375, 28.17492820114568], + [-53.674866943359375, 28.30135788537988] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-55.674866943359375, 28.30135788537988], + [-55.337249755859375, 28.47412369059679], + [-55.524017333984375, 28.17492820114568], + [-55.674866943359375, 28.30135788537988] + ] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/false/lines.geojson b/test/examples/booleans/equal/test/false/lines.geojson new file mode 100644 index 00000000..1ba5e7fb --- /dev/null +++ b/test/examples/booleans/equal/test/false/lines.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [0, 5], + [5, 5], + [5, 0] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 0], + [1, 5], + [6, 5], + [6, 0] + ] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/false/multipoints.geojson b/test/examples/booleans/equal/test/false/multipoints.geojson new file mode 100644 index 00000000..a3a50a8f --- /dev/null +++ b/test/examples/booleans/equal/test/false/multipoints.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-35.5638671875, 27.254629577800063], + [-35.6462646484375, 26.86328062676624], + [-35, 26], + [-35.1001953125, 26.12091815959972], + [-34.8969482421875, 26.455820238459893] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-35.5638671875, 27.254629577800063], + [-35.6462646484375, 26.86328062676624], + [-35.4924560546875, 26.504988828743404], + [-35.1001953125, 26.12091815959972], + [-34.8969482421875, 26.455820238459893] + ] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/false/points.geojson b/test/examples/booleans/equal/test/false/points.geojson new file mode 100644 index 00000000..9bb831e0 --- /dev/null +++ b/test/examples/booleans/equal/test/false/points.geojson @@ -0,0 +1,21 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 0] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/false/polygons.geojson b/test/examples/booleans/equal/test/false/polygons.geojson new file mode 100644 index 00000000..55e49e19 --- /dev/null +++ b/test/examples/booleans/equal/test/false/polygons.geojson @@ -0,0 +1,35 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-53, 28.287451910503744], + [-53.33038330078125, 28.29228897739706], + [-53.34136962890625, 28.430052892335723], + [-53, 28.287451910503744] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-53.57208251953125, 28.287451910503744], + [-53.33038330078125, 28.29228897739706], + [-53.34136962890625, 28.430052892335723], + [-53.57208251953125, 28.287451910503744] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/false/precision-default.geojson b/test/examples/booleans/equal/test/false/precision-default.geojson new file mode 100644 index 00000000..7f793b80 --- /dev/null +++ b/test/examples/booleans/equal/test/false/precision-default.geojson @@ -0,0 +1,21 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0.123456, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0.123451, 0] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/false/precision-options.geojson b/test/examples/booleans/equal/test/false/precision-options.geojson new file mode 100644 index 00000000..fcb8ee25 --- /dev/null +++ b/test/examples/booleans/equal/test/false/precision-options.geojson @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "properties": { + "precision": 17 + }, + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0.12345678901234561, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0.12345678901234564, 0] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/true/different-initials-poly.geojson b/test/examples/booleans/equal/test/true/different-initials-poly.geojson new file mode 100644 index 00000000..929e7f6b --- /dev/null +++ b/test/examples/booleans/equal/test/true/different-initials-poly.geojson @@ -0,0 +1,63 @@ +{ + "type": "FeatureCollection", + "properties": { + "precision": 6, + "shiftedPolygon": true, + "direction": false + }, + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 1, + 1 + ], + [ + 1, + 0 + ], + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 0, + 0 + ], + [ + 1, + 1 + ], + [ + 1, + 0 + ], + [ + 0, + 0 + ] + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/test/examples/booleans/equal/test/true/linear-rings.geojson b/test/examples/booleans/equal/test/true/linear-rings.geojson new file mode 100644 index 00000000..67dfae71 --- /dev/null +++ b/test/examples/booleans/equal/test/true/linear-rings.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-53.674866943359375, 28.30135788537988], + [-53.337249755859375, 28.47412369059679], + [-53.524017333984375, 28.17492820114568], + [-53.674866943359375, 28.30135788537988] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-53.674866943359375, 28.30135788537988], + [-53.337249755859375, 28.47412369059679], + [-53.524017333984375, 28.17492820114568], + [-53.674866943359375, 28.30135788537988] + ] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/true/lines-extra-vertices.geojson b/test/examples/booleans/equal/test/true/lines-extra-vertices.geojson new file mode 100644 index 00000000..51a06197 --- /dev/null +++ b/test/examples/booleans/equal/test/true/lines-extra-vertices.geojson @@ -0,0 +1,28 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [2, 2] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [1, 1], + [2, 2] + ] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/true/lines-reverse.geojson b/test/examples/booleans/equal/test/true/lines-reverse.geojson new file mode 100644 index 00000000..9aa67775 --- /dev/null +++ b/test/examples/booleans/equal/test/true/lines-reverse.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [2, 2], + [1, 1], + [0, 0] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [1, 1], + [2, 2] + ] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/true/lines.geojson b/test/examples/booleans/equal/test/true/lines.geojson new file mode 100644 index 00000000..8bd4188d --- /dev/null +++ b/test/examples/booleans/equal/test/true/lines.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [0, 5], + [5, 5], + [5, 0] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [0, 5], + [5, 5], + [5, 0] + ] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/true/multipoints.geojson b/test/examples/booleans/equal/test/true/multipoints.geojson new file mode 100644 index 00000000..22aa40ad --- /dev/null +++ b/test/examples/booleans/equal/test/true/multipoints.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-35.5638671875, 27.254629577800063], + [-35.6462646484375, 26.86328062676624], + [-35.4924560546875, 26.504988828743404], + [-35.1001953125, 26.12091815959972], + [-34.8969482421875, 26.455820238459893] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-35.5638671875, 27.254629577800063], + [-35.6462646484375, 26.86328062676624], + [-35.4924560546875, 26.504988828743404], + [-35.1001953125, 26.12091815959972], + [-34.8969482421875, 26.455820238459893] + ] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/true/points.geojson b/test/examples/booleans/equal/test/true/points.geojson new file mode 100644 index 00000000..15b60d6f --- /dev/null +++ b/test/examples/booleans/equal/test/true/points.geojson @@ -0,0 +1,21 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/true/polygons.geojson b/test/examples/booleans/equal/test/true/polygons.geojson new file mode 100644 index 00000000..b6077107 --- /dev/null +++ b/test/examples/booleans/equal/test/true/polygons.geojson @@ -0,0 +1,35 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-53.57208251953125, 28.287451910503744], + [-53.33038330078125, 28.29228897739706], + [-53.34136962890625, 28.430052892335723], + [-53.57208251953125, 28.287451910503744] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-53.57208251953125, 28.287451910503744], + [-53.33038330078125, 28.29228897739706], + [-53.34136962890625, 28.430052892335723], + [-53.57208251953125, 28.287451910503744] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/true/precision-default.geojson b/test/examples/booleans/equal/test/true/precision-default.geojson new file mode 100644 index 00000000..cca64ff4 --- /dev/null +++ b/test/examples/booleans/equal/test/true/precision-default.geojson @@ -0,0 +1,21 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0.1234567, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0.1234569, 0] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/true/precision-options.geojson b/test/examples/booleans/equal/test/true/precision-options.geojson new file mode 100644 index 00000000..5e5ab8dd --- /dev/null +++ b/test/examples/booleans/equal/test/true/precision-options.geojson @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "properties": { + "precision": 16 + }, + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0.12345678901234567, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0.12345678901234569, 0] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/true/reverse-lines.geojson b/test/examples/booleans/equal/test/true/reverse-lines.geojson new file mode 100644 index 00000000..4c6e1810 --- /dev/null +++ b/test/examples/booleans/equal/test/true/reverse-lines.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [0, 5], + [5, 5], + [5, 0] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [5, 0], + [5, 5], + [0, 5], + [0, 0] + ] + } + } + ] +} diff --git a/test/examples/booleans/equal/test/true/reverse-polygons.geojson b/test/examples/booleans/equal/test/true/reverse-polygons.geojson new file mode 100644 index 00000000..8c7530df --- /dev/null +++ b/test/examples/booleans/equal/test/true/reverse-polygons.geojson @@ -0,0 +1,64 @@ +{ + "type": "FeatureCollection", + "properties": { + "precision": 6, + "shiftedPolygon": true, + "direction": true + }, + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -53.57, + 28.28 + ], + [ + -53.33, + 28.29 + ], + [ + -53.34, + 28.43 + ], + [ + -53.57, + 28.28 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -53.57, + 28.28 + ], + [ + -53.34, + 28.43 + ], + [ + -53.33, + 28.29 + ], + [ + -53.57, + 28.28 + ] + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/test/examples/booleans/intersects/false/LineString/LineString/LineString-LineString.geojson b/test/examples/booleans/intersects/false/LineString/LineString/LineString-LineString.geojson new file mode 100644 index 00000000..6c774ab5 --- /dev/null +++ b/test/examples/booleans/intersects/false/LineString/LineString/LineString-LineString.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [12, 2], + [12, 3], + [12, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/false/LineString/Point/LineString-Point.geojson b/test/examples/booleans/intersects/false/LineString/Point/LineString-Point.geojson new file mode 100644 index 00000000..e327ba98 --- /dev/null +++ b/test/examples/booleans/intersects/false/LineString/Point/LineString-Point.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + } + ] +} diff --git a/test/examples/booleans/intersects/false/LineString/Polygon/LineString-Polygon.geojson b/test/examples/booleans/intersects/false/LineString/Polygon/LineString-Polygon.geojson new file mode 100644 index 00000000..d34e7dce --- /dev/null +++ b/test/examples/booleans/intersects/false/LineString/Polygon/LineString-Polygon.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [12, 2], + [12, 3], + [12, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/false/MultiPoint/LineString/MultiPoint-LineString.geojson b/test/examples/booleans/intersects/false/MultiPoint/LineString/MultiPoint-LineString.geojson new file mode 100644 index 00000000..77b1b718 --- /dev/null +++ b/test/examples/booleans/intersects/false/MultiPoint/LineString/MultiPoint-LineString.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [2, 2], + [0, 0] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/false/MultiPoint/MultiPoint/MultiPoint-MultiPoint.geojson b/test/examples/booleans/intersects/false/MultiPoint/MultiPoint/MultiPoint-MultiPoint.geojson new file mode 100644 index 00000000..7e3143af --- /dev/null +++ b/test/examples/booleans/intersects/false/MultiPoint/MultiPoint/MultiPoint-MultiPoint.geojson @@ -0,0 +1,27 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [0, 0], + [13, 13] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/false/MultiPoint/Point/MultiPoint-Point.geojson b/test/examples/booleans/intersects/false/MultiPoint/Point/MultiPoint-Point.geojson new file mode 100644 index 00000000..eb6182a3 --- /dev/null +++ b/test/examples/booleans/intersects/false/MultiPoint/Point/MultiPoint-Point.geojson @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + } + ] +} diff --git a/test/examples/booleans/intersects/false/MultiPoint/Polygon/MultiPoint-Polygon.geojson b/test/examples/booleans/intersects/false/MultiPoint/Polygon/MultiPoint-Polygon.geojson new file mode 100644 index 00000000..469de623 --- /dev/null +++ b/test/examples/booleans/intersects/false/MultiPoint/Polygon/MultiPoint-Polygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-3, -3], + [-2, -2] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/false/MultiPolygon/Polygon/MultiPolygon-Polygon.geojson b/test/examples/booleans/intersects/false/MultiPolygon/Polygon/MultiPolygon-Polygon.geojson new file mode 100644 index 00000000..3b2ea41f --- /dev/null +++ b/test/examples/booleans/intersects/false/MultiPolygon/Polygon/MultiPolygon-Polygon.geojson @@ -0,0 +1,52 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "fill": "#ff0000" + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [122.6953125, -19.186677697957833], + [128.759765625, -19.186677697957833], + [128.759765625, -15.28418511407642], + [122.6953125, -15.28418511407642], + [122.6953125, -19.186677697957833] + ] + ], + [ + [ + [123.74999999999999, -25.918526162075153], + [130.25390625, -25.918526162075153], + [130.25390625, -20.715015145512087], + [123.74999999999999, -20.715015145512087], + [123.74999999999999, -25.918526162075153] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "fill": "#0000ff" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [116.98242187499999, -24.647017162630352], + [122.87109375, -24.647017162630352], + [122.87109375, -20.34462694382967], + [116.98242187499999, -20.34462694382967], + [116.98242187499999, -24.647017162630352] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/false/Point/LineString/Point-LineString.geojson b/test/examples/booleans/intersects/false/Point/LineString/Point-LineString.geojson new file mode 100644 index 00000000..be635169 --- /dev/null +++ b/test/examples/booleans/intersects/false/Point/LineString/Point-LineString.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/false/Point/MultiPoint/Point-Multipoint.geojson b/test/examples/booleans/intersects/false/Point/MultiPoint/Point-Multipoint.geojson new file mode 100644 index 00000000..542362e8 --- /dev/null +++ b/test/examples/booleans/intersects/false/Point/MultiPoint/Point-Multipoint.geojson @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/false/Point/Point/Point-Point.geojson b/test/examples/booleans/intersects/false/Point/Point/Point-Point.geojson new file mode 100644 index 00000000..6d022c5e --- /dev/null +++ b/test/examples/booleans/intersects/false/Point/Point/Point-Point.geojson @@ -0,0 +1,21 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 1] + } + } + ] +} diff --git a/test/examples/booleans/intersects/false/Point/Polygon/Point-Polygon.geojson b/test/examples/booleans/intersects/false/Point/Polygon/Point-Polygon.geojson new file mode 100644 index 00000000..c3d4c6de --- /dev/null +++ b/test/examples/booleans/intersects/false/Point/Polygon/Point-Polygon.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/false/Polygon/LineString/Polygon-LineString.geojson b/test/examples/booleans/intersects/false/Polygon/LineString/Polygon-LineString.geojson new file mode 100644 index 00000000..52b4a494 --- /dev/null +++ b/test/examples/booleans/intersects/false/Polygon/LineString/Polygon-LineString.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [12, 2], + [12, 3], + [12, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/false/Polygon/MultiPolygon/Polygon-MultiPolygon.geojson b/test/examples/booleans/intersects/false/Polygon/MultiPolygon/Polygon-MultiPolygon.geojson new file mode 100644 index 00000000..d165d17b --- /dev/null +++ b/test/examples/booleans/intersects/false/Polygon/MultiPolygon/Polygon-MultiPolygon.geojson @@ -0,0 +1,52 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "fill": "#0000ff" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [116.98242187499999, -24.647017162630352], + [122.87109375, -24.647017162630352], + [122.87109375, -20.34462694382967], + [116.98242187499999, -20.34462694382967], + [116.98242187499999, -24.647017162630352] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "fill": "#ff0000" + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [122.6953125, -19.186677697957833], + [128.759765625, -19.186677697957833], + [128.759765625, -15.28418511407642], + [122.6953125, -15.28418511407642], + [122.6953125, -19.186677697957833] + ] + ], + [ + [ + [123.74999999999999, -25.918526162075153], + [130.25390625, -25.918526162075153], + [130.25390625, -20.715015145512087], + [123.74999999999999, -20.715015145512087], + [123.74999999999999, -25.918526162075153] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/false/Polygon/Point/Polygon-Point.geojson b/test/examples/booleans/intersects/false/Polygon/Point/Polygon-Point.geojson new file mode 100644 index 00000000..557d45be --- /dev/null +++ b/test/examples/booleans/intersects/false/Polygon/Point/Polygon-Point.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + } + ] +} diff --git a/test/examples/booleans/intersects/false/Polygon/Polygon/Polygon-Polygon.geojson b/test/examples/booleans/intersects/false/Polygon/Polygon/Polygon-Polygon.geojson new file mode 100644 index 00000000..66d7ab57 --- /dev/null +++ b/test/examples/booleans/intersects/false/Polygon/Polygon/Polygon-Polygon.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-11, -12], + [-13, -12], + [-13, -13], + [-11, -13], + [-11, -12] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/LineString/LineString/LineString-LineString.geojson b/test/examples/booleans/intersects/true/LineString/LineString/LineString-LineString.geojson new file mode 100644 index 00000000..5ad6f986 --- /dev/null +++ b/test/examples/booleans/intersects/true/LineString/LineString/LineString-LineString.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 2], + [12, 2], + [12, 3], + [12, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/LineString/Point/LineString-Point-1.geojson b/test/examples/booleans/intersects/true/LineString/Point/LineString-Point-1.geojson new file mode 100644 index 00000000..39e7953d --- /dev/null +++ b/test/examples/booleans/intersects/true/LineString/Point/LineString-Point-1.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/LineString/Point/LineString-Point-2.geojson b/test/examples/booleans/intersects/true/LineString/Point/LineString-Point-2.geojson new file mode 100644 index 00000000..323ca4e1 --- /dev/null +++ b/test/examples/booleans/intersects/true/LineString/Point/LineString-Point-2.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1.5] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/LineString/Polygon/LineString-In-Polygon.geojson b/test/examples/booleans/intersects/true/LineString/Polygon/LineString-In-Polygon.geojson new file mode 100644 index 00000000..62d55b65 --- /dev/null +++ b/test/examples/booleans/intersects/true/LineString/Polygon/LineString-In-Polygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 2.5], + [2, 2.5] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/LineString/Polygon/LineString-Polygon.geojson b/test/examples/booleans/intersects/true/LineString/Polygon/LineString-Polygon.geojson new file mode 100644 index 00000000..be2b9688 --- /dev/null +++ b/test/examples/booleans/intersects/true/LineString/Polygon/LineString-Polygon.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 2], + [12, 2], + [12, 3], + [12, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/MultiPoint/LineString/MultiPoint-LineString.geojson b/test/examples/booleans/intersects/true/MultiPoint/LineString/MultiPoint-LineString.geojson new file mode 100644 index 00000000..f7bc3dd8 --- /dev/null +++ b/test/examples/booleans/intersects/true/MultiPoint/LineString/MultiPoint-LineString.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [0, 0] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/MultiPoint/MultiPoint/MultiPoint-MultiPoint.geojson b/test/examples/booleans/intersects/true/MultiPoint/MultiPoint/MultiPoint-MultiPoint.geojson new file mode 100644 index 00000000..85a8e2cd --- /dev/null +++ b/test/examples/booleans/intersects/true/MultiPoint/MultiPoint/MultiPoint-MultiPoint.geojson @@ -0,0 +1,27 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [0, 0], + [12, 12] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/MultiPoint/Polygon/MultiPoint-Polygon.geojson b/test/examples/booleans/intersects/true/MultiPoint/Polygon/MultiPoint-Polygon.geojson new file mode 100644 index 00000000..da402f37 --- /dev/null +++ b/test/examples/booleans/intersects/true/MultiPoint/Polygon/MultiPoint-Polygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-1, 2], + [-2, -2] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/MultiPolygon/Polygon/MultiPolygon-Polygon.geojson b/test/examples/booleans/intersects/true/MultiPolygon/Polygon/MultiPolygon-Polygon.geojson new file mode 100644 index 00000000..706074d3 --- /dev/null +++ b/test/examples/booleans/intersects/true/MultiPolygon/Polygon/MultiPolygon-Polygon.geojson @@ -0,0 +1,52 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "fill": "#ff0000" + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [122.6953125, -19.186677697957833], + [128.759765625, -19.186677697957833], + [128.759765625, -15.28418511407642], + [122.6953125, -15.28418511407642], + [122.6953125, -19.186677697957833] + ] + ], + [ + [ + [123.74999999999999, -25.918526162075153], + [130.25390625, -25.918526162075153], + [130.25390625, -20.715015145512087], + [123.74999999999999, -20.715015145512087], + [123.74999999999999, -25.918526162075153] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "fill": "#0000ff" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [119.20166015624999, -22.776181505086495], + [125.09033203124999, -22.776181505086495], + [125.09033203124999, -18.417078658661257], + [119.20166015624999, -18.417078658661257], + [119.20166015624999, -22.776181505086495] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Point/LineString/Point-LineString-1.geojson b/test/examples/booleans/intersects/true/Point/LineString/Point-LineString-1.geojson new file mode 100644 index 00000000..b84728a8 --- /dev/null +++ b/test/examples/booleans/intersects/true/Point/LineString/Point-LineString-1.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Point/LineString/Point-LineString-2.geojson b/test/examples/booleans/intersects/true/Point/LineString/Point-LineString-2.geojson new file mode 100644 index 00000000..a937db0c --- /dev/null +++ b/test/examples/booleans/intersects/true/Point/LineString/Point-LineString-2.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1.5] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Point/LineString/Point-LineString-3.geojson b/test/examples/booleans/intersects/true/Point/LineString/Point-LineString-3.geojson new file mode 100644 index 00000000..46d35691 --- /dev/null +++ b/test/examples/booleans/intersects/true/Point/LineString/Point-LineString-3.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2.5, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [2, 1], + [3, 1], + [4, 1] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Point/LineString/Point-LineString-4.geojson b/test/examples/booleans/intersects/true/Point/LineString/Point-LineString-4.geojson new file mode 100644 index 00000000..cf348f68 --- /dev/null +++ b/test/examples/booleans/intersects/true/Point/LineString/Point-LineString-4.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2.5, 2.5] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [2, 2], + [3, 3], + [4, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Point/MultiPoint/Point-MultiPoint.geojson b/test/examples/booleans/intersects/true/Point/MultiPoint/Point-MultiPoint.geojson new file mode 100644 index 00000000..f958a470 --- /dev/null +++ b/test/examples/booleans/intersects/true/Point/MultiPoint/Point-MultiPoint.geojson @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Point/Point/Point-Point.geojson b/test/examples/booleans/intersects/true/Point/Point/Point-Point.geojson new file mode 100644 index 00000000..15b60d6f --- /dev/null +++ b/test/examples/booleans/intersects/true/Point/Point/Point-Point.geojson @@ -0,0 +1,21 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Point/Polygon/Point-Polygon-1.geojson b/test/examples/booleans/intersects/true/Point/Polygon/Point-Polygon-1.geojson new file mode 100644 index 00000000..5ef704e8 --- /dev/null +++ b/test/examples/booleans/intersects/true/Point/Polygon/Point-Polygon-1.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 2.5] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Point/Polygon/Point-Polygon-2.geojson b/test/examples/booleans/intersects/true/Point/Polygon/Point-Polygon-2.geojson new file mode 100644 index 00000000..b3a139a5 --- /dev/null +++ b/test/examples/booleans/intersects/true/Point/Polygon/Point-Polygon-2.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-1, 2] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Polygon/LineString/Polygon-Containing-Linestring.geojson b/test/examples/booleans/intersects/true/Polygon/LineString/Polygon-Containing-Linestring.geojson new file mode 100644 index 00000000..a840dc09 --- /dev/null +++ b/test/examples/booleans/intersects/true/Polygon/LineString/Polygon-Containing-Linestring.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 2.5], + [2, 2.5] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Polygon/LineString/Polygon-LineString.geojson b/test/examples/booleans/intersects/true/Polygon/LineString/Polygon-LineString.geojson new file mode 100644 index 00000000..83323524 --- /dev/null +++ b/test/examples/booleans/intersects/true/Polygon/LineString/Polygon-LineString.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 2], + [12, 2], + [12, 3], + [12, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Polygon/MultiPolygon/Polygon-MultiPolygon.geojson b/test/examples/booleans/intersects/true/Polygon/MultiPolygon/Polygon-MultiPolygon.geojson new file mode 100644 index 00000000..59b2a579 --- /dev/null +++ b/test/examples/booleans/intersects/true/Polygon/MultiPolygon/Polygon-MultiPolygon.geojson @@ -0,0 +1,52 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "fill": "#0000ff" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [119.20166015624999, -22.776181505086495], + [125.09033203124999, -22.776181505086495], + [125.09033203124999, -18.417078658661257], + [119.20166015624999, -18.417078658661257], + [119.20166015624999, -22.776181505086495] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "fill": "#ff0000" + }, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [122.6953125, -19.186677697957833], + [128.759765625, -19.186677697957833], + [128.759765625, -15.28418511407642], + [122.6953125, -15.28418511407642], + [122.6953125, -19.186677697957833] + ] + ], + [ + [ + [123.74999999999999, -25.918526162075153], + [130.25390625, -25.918526162075153], + [130.25390625, -20.715015145512087], + [123.74999999999999, -20.715015145512087], + [123.74999999999999, -25.918526162075153] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Polygon/Point/Polygon-Point.geojson b/test/examples/booleans/intersects/true/Polygon/Point/Polygon-Point.geojson new file mode 100644 index 00000000..c2131b4a --- /dev/null +++ b/test/examples/booleans/intersects/true/Polygon/Point/Polygon-Point.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 2.5] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Polygon/Polygon/Large-Inside-Small.geojson b/test/examples/booleans/intersects/true/Polygon/Polygon/Large-Inside-Small.geojson new file mode 100644 index 00000000..9a52b0dd --- /dev/null +++ b/test/examples/booleans/intersects/true/Polygon/Polygon/Large-Inside-Small.geojson @@ -0,0 +1,39 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [19.6875, 34.016241889667015], + [14.765625, 26.745610382199022], + [19.6875, 23.563987128451217], + [23.203125, 26.43122806450644], + [22.148437499999996, 30.44867367928756], + [19.6875, 34.016241889667015] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [18.984375, 40.44694705960048], + [7.03125, 25.48295117535531], + [19.335937499999996, 18.979025953255267], + [31.640625, 24.206889622398023], + [24.960937499999996, 34.88593094075317], + [18.984375, 40.44694705960048] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Polygon/Polygon/Polygon-Polygon.geojson b/test/examples/booleans/intersects/true/Polygon/Polygon/Polygon-Polygon.geojson new file mode 100644 index 00000000..70b69b88 --- /dev/null +++ b/test/examples/booleans/intersects/true/Polygon/Polygon/Polygon-Polygon.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [-13, -12], + [-13, -13], + [-11, -13], + [-1, 2] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-1, 2], + [3, 2], + [3, 3], + [-1, 3], + [-1, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Polygon/Polygon/Small-Inside-Large.geojson b/test/examples/booleans/intersects/true/Polygon/Polygon/Small-Inside-Large.geojson new file mode 100644 index 00000000..15e635f5 --- /dev/null +++ b/test/examples/booleans/intersects/true/Polygon/Polygon/Small-Inside-Large.geojson @@ -0,0 +1,39 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [18.984375, 40.44694705960048], + [7.03125, 25.48295117535531], + [19.335937499999996, 18.979025953255267], + [31.640625, 24.206889622398023], + [24.960937499999996, 34.88593094075317], + [18.984375, 40.44694705960048] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [19.6875, 34.016241889667015], + [14.765625, 26.745610382199022], + [19.6875, 23.563987128451217], + [23.203125, 26.43122806450644], + [22.148437499999996, 30.44867367928756], + [19.6875, 34.016241889667015] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/intersects/true/Polygon/Polygon/issue-1216.geojson b/test/examples/booleans/intersects/true/Polygon/Polygon/issue-1216.geojson new file mode 100644 index 00000000..41157c99 --- /dev/null +++ b/test/examples/booleans/intersects/true/Polygon/Polygon/issue-1216.geojson @@ -0,0 +1,49 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [6.638240782825051, 46.513552354874435], + [6.638240782825051, 46.52452567471025], + [6.632039186485088, 46.52452567471025], + [6.632039186485088, 46.513552354874435], + [6.638240782825051, 46.513552354874435] + ] + ] + }, + "bbox": [ + 6.632039186485088, + 46.513552354874435, + 6.638240782825051, + 46.52452567471025 + ] + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [6.645459572232596, 46.51709747623775], + [6.645459572232596, 46.52102619404951], + [6.626132904233913, 46.52102619404951], + [6.626132904233913, 46.51709747623775], + [6.645459572232596, 46.51709747623775] + ] + ] + }, + "bbox": [ + 6.626132904233913, + 46.51709747623775, + 6.645459572232596, + 46.52102619404951 + ] + } + ] +} diff --git a/test/examples/booleans/overlap/false/equal-linear-rings.geojson b/test/examples/booleans/overlap/false/equal-linear-rings.geojson new file mode 100644 index 00000000..67dfae71 --- /dev/null +++ b/test/examples/booleans/overlap/false/equal-linear-rings.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-53.674866943359375, 28.30135788537988], + [-53.337249755859375, 28.47412369059679], + [-53.524017333984375, 28.17492820114568], + [-53.674866943359375, 28.30135788537988] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-53.674866943359375, 28.30135788537988], + [-53.337249755859375, 28.47412369059679], + [-53.524017333984375, 28.17492820114568], + [-53.674866943359375, 28.30135788537988] + ] + } + } + ] +} diff --git a/test/examples/booleans/overlap/false/equal-lines.geojson b/test/examples/booleans/overlap/false/equal-lines.geojson new file mode 100644 index 00000000..4c6e1810 --- /dev/null +++ b/test/examples/booleans/overlap/false/equal-lines.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [0, 5], + [5, 5], + [5, 0] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [5, 0], + [5, 5], + [0, 5], + [0, 0] + ] + } + } + ] +} diff --git a/test/examples/booleans/overlap/false/equal-multipoints.geojson b/test/examples/booleans/overlap/false/equal-multipoints.geojson new file mode 100644 index 00000000..22aa40ad --- /dev/null +++ b/test/examples/booleans/overlap/false/equal-multipoints.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-35.5638671875, 27.254629577800063], + [-35.6462646484375, 26.86328062676624], + [-35.4924560546875, 26.504988828743404], + [-35.1001953125, 26.12091815959972], + [-34.8969482421875, 26.455820238459893] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-35.5638671875, 27.254629577800063], + [-35.6462646484375, 26.86328062676624], + [-35.4924560546875, 26.504988828743404], + [-35.1001953125, 26.12091815959972], + [-34.8969482421875, 26.455820238459893] + ] + } + } + ] +} diff --git a/test/examples/booleans/overlap/false/equal-polygons.geojson b/test/examples/booleans/overlap/false/equal-polygons.geojson new file mode 100644 index 00000000..9c89e6c9 --- /dev/null +++ b/test/examples/booleans/overlap/false/equal-polygons.geojson @@ -0,0 +1,35 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-53.57208251953125, 28.287451910503744], + [-53.33038330078125, 28.29228897739706], + [-53.34136962890625, 28.430052892335723], + [-53.57208251953125, 28.287451910503744] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-53.57208251953125, 28.287451910503744], + [-53.34136962890625, 28.430052892335723], + [-53.33038330078125, 28.29228897739706], + [-53.57208251953125, 28.287451910503744] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/overlap/false/linear-rings.geojson b/test/examples/booleans/overlap/false/linear-rings.geojson new file mode 100644 index 00000000..edbb4bb9 --- /dev/null +++ b/test/examples/booleans/overlap/false/linear-rings.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-53.317337036132805, 28.445147699510212], + [-53.61053466796875, 28.263868062633772], + [-53.3770751953125, 28.214869548073377], + [-53.38531494140625, 28.272939391283685], + [-53.22052001953125, 28.272939391283685], + [-53.317337036132805, 28.445147699510212] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-53.674866943359375, 28.30135788537988], + [-53.337249755859375, 28.47412369059679], + [-53.524017333984375, 28.17492820114568], + [-53.674866943359375, 28.30135788537988] + ] + } + } + ] +} diff --git a/test/examples/booleans/overlap/false/lines.geojson b/test/examples/booleans/overlap/false/lines.geojson new file mode 100644 index 00000000..c3414c3c --- /dev/null +++ b/test/examples/booleans/overlap/false/lines.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-22.564544677734375, 46.25917013377904], + [-22.559051513671875, 46.32369743336783], + [-22.446441650390625, 46.352141192009334], + [-22.361297607421875, 46.32891323009468], + [-22.361297607421875, 46.30472670751783] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-22.570724487304688, 46.36398839132818], + [-22.444381713867188, 46.357354276167015], + [-22.391510009765625, 46.3291502999477], + [-22.29263305664062, 46.382464893261165] + ] + } + } + ] +} diff --git a/test/examples/booleans/overlap/false/multipoints.geojson b/test/examples/booleans/overlap/false/multipoints.geojson new file mode 100644 index 00000000..c9c919be --- /dev/null +++ b/test/examples/booleans/overlap/false/multipoints.geojson @@ -0,0 +1,36 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-36.05712890625, 26.480407161007275], + [-35.7220458984375, 27.137368359795584], + [-35.13427734375, 26.83387451505858], + [-35.4638671875, 27.254629577800063], + [-35.5462646484375, 26.86328062676624], + [-35.3924560546875, 26.504988828743404] + ] + } + }, + { + "type": "Feature", + "properties": { + "marker-color": "#000" + }, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-35.5638671875, 27.254629577800063], + [-35.6462646484375, 26.86328062676624], + [-35.4924560546875, 26.504988828743404], + [-35.1001953125, 26.12091815959972], + [-34.8969482421875, 26.455820238459893] + ] + } + } + ] +} diff --git a/test/examples/booleans/overlap/false/polygon-with-hole-polygon.geojson b/test/examples/booleans/overlap/false/polygon-with-hole-polygon.geojson new file mode 100644 index 00000000..81e21b7f --- /dev/null +++ b/test/examples/booleans/overlap/false/polygon-with-hole-polygon.geojson @@ -0,0 +1,45 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-37.81494140625, 30.050076521698735], + [-36.573486328125, 28.159189634046708], + [-34.20043945312499, 29.23847708592805], + [-34.44213867187499, 31.090574094954192], + [-36.507568359375, 32.045332838858506], + [-37.81494140625, 30.050076521698735] + ], + [ + [-36.661376953125, 29.516110386062277], + [-36.661376953125, 30.685163937659564], + [-35.233154296875, 30.685163937659564], + [-35.233154296875, 29.516110386062277], + [-36.661376953125, 29.516110386062277] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-34.903564453125, 31.99875937194732], + [-33.387451171875, 31.700129553985924], + [-33.310546875, 33.165145408240285], + [-35.39794921875, 32.89803818160521], + [-34.903564453125, 31.99875937194732] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/overlap/false/polygons.geojson b/test/examples/booleans/overlap/false/polygons.geojson new file mode 100644 index 00000000..15dda991 --- /dev/null +++ b/test/examples/booleans/overlap/false/polygons.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-53.51715087890625, 28.488005204159457], + [-53.47148895263672, 28.366933295392897], + [-53.3770751953125, 28.490419194161678], + [-53.24798583984375, 28.43246820620096], + [-53.33038330078125, 28.560400880492832], + [-53.51715087890625, 28.488005204159457] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-53.57208251953125, 28.287451910503744], + [-53.33038330078125, 28.29228897739706], + [-53.34136962890625, 28.430052892335723], + [-53.57208251953125, 28.287451910503744] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/overlap/true/linear-rings.geojson b/test/examples/booleans/overlap/true/linear-rings.geojson new file mode 100644 index 00000000..41593df0 --- /dev/null +++ b/test/examples/booleans/overlap/true/linear-rings.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-53.317337036132805, 28.445147699510212], + [-53.61053466796875, 28.263868062633772], + [-53.3770751953125, 28.214869548073377], + [-53.38531494140625, 28.272939391283685], + [-53.22052001953125, 28.272939391283685], + [-53.317337036132805, 28.445147699510212] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-53.61053466796875, 28.263868062633772], + [-53.317337036132805, 28.445147699510212], + [-53.524017333984375, 28.17492820114568], + [-53.61053466796875, 28.263868062633772] + ] + } + } + ] +} diff --git a/test/examples/booleans/overlap/true/lines.geojson b/test/examples/booleans/overlap/true/lines.geojson new file mode 100644 index 00000000..30df9540 --- /dev/null +++ b/test/examples/booleans/overlap/true/lines.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-22.564544677734375, 46.25917013377904], + [-22.559051513671875, 46.32369743336783], + [-22.446441650390625, 46.352141192009334], + [-22.361297607421875, 46.32891323009468], + [-22.361297607421875, 46.30472670751783] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-22.570724487304688, 46.36398839132818], + [-22.446441650390625, 46.352141192009334], + [-22.361297607421875, 46.32891323009468], + [-22.29263305664062, 46.382464893261165] + ] + } + } + ] +} diff --git a/test/examples/booleans/overlap/true/multipoints.geojson b/test/examples/booleans/overlap/true/multipoints.geojson new file mode 100644 index 00000000..0155fa84 --- /dev/null +++ b/test/examples/booleans/overlap/true/multipoints.geojson @@ -0,0 +1,36 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-36.05712890625, 26.480407161007275], + [-35.7220458984375, 27.137368359795584], + [-35.13427734375, 26.83387451505858], + [-35.4638671875, 27.254629577800063], + [-35.5462646484375, 26.86328062676624], + [-35.3924560546875, 26.504988828743404] + ] + } + }, + { + "type": "Feature", + "properties": { + "marker-color": "#000" + }, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-35.4638671875, 27.254629577800063], + [-35.5462646484375, 26.86328062676624], + [-35.3924560546875, 26.504988828743404], + [-35.2001953125, 26.12091815959972], + [-34.9969482421875, 26.455820238459893] + ] + } + } + ] +} diff --git a/test/examples/booleans/overlap/true/polygon-with-hole-polygon.geojson b/test/examples/booleans/overlap/true/polygon-with-hole-polygon.geojson new file mode 100644 index 00000000..557f7310 --- /dev/null +++ b/test/examples/booleans/overlap/true/polygon-with-hole-polygon.geojson @@ -0,0 +1,44 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-37.81494140625, 30.050076521698735], + [-36.573486328125, 28.159189634046708], + [-34.20043945312499, 29.23847708592805], + [-34.44213867187499, 31.090574094954192], + [-36.507568359375, 32.045332838858506], + [-37.81494140625, 30.050076521698735] + ], + [ + [-36.661376953125, 29.516110386062277], + [-36.661376953125, 30.685163937659564], + [-35.233154296875, 30.685163937659564], + [-35.233154296875, 29.516110386062277], + [-36.661376953125, 29.516110386062277] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-35.980224609375, 30.315987718557867], + [-34.8486328125, 30.694611546632277], + [-35.782470703125, 31.16580958786196], + [-35.980224609375, 30.315987718557867] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/overlap/true/polygons.geojson b/test/examples/booleans/overlap/true/polygons.geojson new file mode 100644 index 00000000..e28e427b --- /dev/null +++ b/test/examples/booleans/overlap/true/polygons.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-53.51715087890625, 28.488005204159457], + [-53.33038330078125, 28.560400880492832], + [-53.24798583984375, 28.43246820620096], + [-53.3770751953125, 28.490419194161678], + [-53.4100341796875, 28.34789944257093], + [-53.51715087890625, 28.488005204159457] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-53.57208251953125, 28.287451910503744], + [-53.34136962890625, 28.430052892335723], + [-53.33038330078125, 28.29228897739706], + [-53.57208251953125, 28.287451910503744] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/overlap/true/simple-lines.geojson b/test/examples/booleans/overlap/true/simple-lines.geojson new file mode 100644 index 00000000..591d9494 --- /dev/null +++ b/test/examples/booleans/overlap/true/simple-lines.geojson @@ -0,0 +1,30 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [0, 5], + [5, 5], + [5, 0] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 5], + [5, 5], + [5, 10] + ] + } + } + ] +} diff --git a/test/examples/booleans/overlap/true/single-multipoints.geojson b/test/examples/booleans/overlap/true/single-multipoints.geojson new file mode 100644 index 00000000..c187d80f --- /dev/null +++ b/test/examples/booleans/overlap/true/single-multipoints.geojson @@ -0,0 +1,36 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-36.05712890625, 26.480407161007275], + [-35.7220458984375, 27.137368359795584], + [-35.13427734375, 26.83387451505858], + [-35.4638671875, 27.254629577800063], + [-35.5462646484375, 26.86328062676624], + [-35.3924560546875, 26.504988828743404] + ] + } + }, + { + "type": "Feature", + "properties": { + "marker-color": "#000" + }, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [-35.4638671875, 27.254629577800063], + [-35.6462646484375, 26.86328062676624], + [-35.4924560546875, 26.504988828743404], + [-35.1001953125, 26.12091815959972], + [-34.8969482421875, 26.455820238459893] + ] + } + } + ] +} diff --git a/test/examples/booleans/parallel/false/line1.geojson b/test/examples/booleans/parallel/false/line1.geojson new file mode 100644 index 00000000..c1ba4219 --- /dev/null +++ b/test/examples/booleans/parallel/false/line1.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-111.544189453125, 24.186847428521244], + [-110.687255859375, 24.966140159912975], + [-110.4510498046875, 24.467150664739002], + [-109.9951171875, 25.180087808990645] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-111.4617919921875, 24.05148034322011], + [-110.8795166015625, 24.681961205014595], + [-110.841064453125, 24.14174098050432], + [-109.97863769531249, 24.617057340809524] + ] + } + } + ] +} diff --git a/test/examples/booleans/parallel/false/line2.geojson b/test/examples/booleans/parallel/false/line2.geojson new file mode 100644 index 00000000..29de05c1 --- /dev/null +++ b/test/examples/booleans/parallel/false/line2.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-34.98046875, 29.38217507514529], + [30.937499999999996, 59.085738569819505], + [-10.01953125, 60.84491057364912], + [25.6640625, 67.60922060496382], + [-4.5703125, 34.59704151614417] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-27.24609375, 51.508742458803326], + [24.43359375, 48.22467264956519], + [49.92187499999999, 65.2198939361321] + ] + } + } + ] +} diff --git a/test/examples/booleans/parallel/true/city-line.geojson b/test/examples/booleans/parallel/true/city-line.geojson new file mode 100644 index 00000000..92c2b642 --- /dev/null +++ b/test/examples/booleans/parallel/true/city-line.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [9.170356, 45.477985], + [9.164434, 45.482551], + [9.166644, 45.484003] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [9.169356, 45.477985], + [9.163434, 45.482551], + [9.165644, 45.484003] + ] + } + } + ] +} diff --git a/test/examples/booleans/parallel/true/fiji.geojson b/test/examples/booleans/parallel/true/fiji.geojson new file mode 100644 index 00000000..0ac4ed6b --- /dev/null +++ b/test/examples/booleans/parallel/true/fiji.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-180.2911376953125, -17.07253857905758], + [-179.73358154296875, -17.203769821917533], + [-179.55780029296872, -17.463332719132794], + [-179.296875, -17.460712710429785] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-180.7911376953125, -17.07253857905758], + [-180.23358154296875, -17.203769821917533], + [-180.05780029296872, -17.463332719132794], + [-179.796875, -17.460712710429785] + ] + } + } + ] +} diff --git a/test/examples/booleans/parallel/true/line1.geojson b/test/examples/booleans/parallel/true/line1.geojson new file mode 100644 index 00000000..66795584 --- /dev/null +++ b/test/examples/booleans/parallel/true/line1.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-68.3349609375, 18.203262019544418], + [-67.7142333984375, 18.94266018631978], + [-66.412353515625, 18.588982352118453], + [-66.181640625, 19.19186565046399] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-68.8349609375, 18.203262019544418], + [-68.2142333984375, 18.94266018631978], + [-66.912353515625, 18.588982352118453], + [-66.681640625, 19.19186565046399] + ] + } + } + ] +} diff --git a/test/examples/booleans/parallel/true/line3-reverse.geojson b/test/examples/booleans/parallel/true/line3-reverse.geojson new file mode 100644 index 00000000..aad47272 --- /dev/null +++ b/test/examples/booleans/parallel/true/line3-reverse.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-74.4798388671875, 15.235164824060707], + [-74.01978637695312, 15.566159129772904], + [-73.95798828125, 15.425881893976563] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-74.4598388671875, 15.235164824060707], + [-73.99978637695312, 15.566159129772904], + [-73.93798828125, 15.425881893976563], + [-73.795166015625, 15.681220930466825], + [-73.71002197265624, 15.551606490799015] + ] + } + } + ] +} diff --git a/test/examples/booleans/parallel/true/line3.geojson b/test/examples/booleans/parallel/true/line3.geojson new file mode 100644 index 00000000..5f85af9c --- /dev/null +++ b/test/examples/booleans/parallel/true/line3.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-74.4598388671875, 15.235164824060707], + [-73.99978637695312, 15.566159129772904], + [-73.93798828125, 15.425881893976563], + [-73.795166015625, 15.681220930466825], + [-73.71002197265624, 15.551606490799015] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-74.4798388671875, 15.235164824060707], + [-74.01978637695312, 15.566159129772904], + [-73.95798828125, 15.425881893976563] + ] + } + } + ] +} diff --git a/test/examples/booleans/parallel/true/resolute.geojson b/test/examples/booleans/parallel/true/resolute.geojson new file mode 100644 index 00000000..6b271052 --- /dev/null +++ b/test/examples/booleans/parallel/true/resolute.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-89.82421875, 70.22974449563027], + [-83.056640625, 75.75894014501688], + [-64.3359375, 72.36910450725075] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-88.52421875, 70.22974449563027], + [-81.756640625, 75.75894014501688], + [-63.0359375, 72.36910450725075] + ] + } + } + ] +} diff --git a/test/examples/booleans/parallel/true/segment1.geojson b/test/examples/booleans/parallel/true/segment1.geojson new file mode 100644 index 00000000..332d9b70 --- /dev/null +++ b/test/examples/booleans/parallel/true/segment1.geojson @@ -0,0 +1,27 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-2, -5], + [-2, 2] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, -4.5], + [-0, 1] + ] + } + } + ] +} diff --git a/test/examples/booleans/parallel/true/segment2.geojson b/test/examples/booleans/parallel/true/segment2.geojson new file mode 100644 index 00000000..4450db2d --- /dev/null +++ b/test/examples/booleans/parallel/true/segment2.geojson @@ -0,0 +1,27 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-96.591796875, 34.161818161230386], + [-94.4384765625, 35.496456056584165] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-94.591796875, 34.161818161230386], + [-92.4384765625, 35.496456056584165] + ] + } + } + ] +} diff --git a/test/examples/booleans/parallel/true/segment3.geojson b/test/examples/booleans/parallel/true/segment3.geojson new file mode 100644 index 00000000..cef1bdcc --- /dev/null +++ b/test/examples/booleans/parallel/true/segment3.geojson @@ -0,0 +1,27 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-86, 11.4], + [-80, 11.4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-88, 11], + [-81, 11] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_in_polygon/in/multipoly-with-hole.geojson b/test/examples/booleans/point_in_polygon/in/multipoly-with-hole.geojson new file mode 100644 index 00000000..e1119a52 --- /dev/null +++ b/test/examples/booleans/point_in_polygon/in/multipoly-with-hole.geojson @@ -0,0 +1,43 @@ +{ + "type": "Feature", + "properties": {}, + "bbox": [ + -86.77362442016602, + 36.170862616662134, + -86.67303085327148, + 36.23084281427824 + ], + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [-86.76624298095703, 36.171278341935434], + [-86.77362442016602, 36.2014818084173], + [-86.74100875854492, 36.19607929145354], + [-86.74238204956055, 36.170862616662134], + [-86.76624298095703, 36.171278341935434] + ] + ], + [ + [ + [-86.70478820800781, 36.23084281427824], + [-86.73980712890625, 36.21062368007896], + [-86.71371459960938, 36.173495506147], + [-86.67526245117186, 36.17709826419592], + [-86.67303085327148, 36.20910010895552], + [-86.68041229248047, 36.230427405208005], + [-86.70478820800781, 36.23084281427824] + ], + [ + [-86.6934585571289, 36.217271643303604], + [-86.71268463134766, 36.20771501855801], + [-86.70238494873047, 36.19067640168397], + [-86.68487548828125, 36.19691047217554], + [-86.68264389038086, 36.20993115142727], + [-86.6934585571289, 36.217271643303604] + ] + ] + ] + } +} diff --git a/test/examples/booleans/point_in_polygon/in/poly-with-hole.geojson b/test/examples/booleans/point_in_polygon/in/poly-with-hole.geojson new file mode 100644 index 00000000..1f730433 --- /dev/null +++ b/test/examples/booleans/point_in_polygon/in/poly-with-hole.geojson @@ -0,0 +1,32 @@ +{ + "type": "Feature", + "properties": {}, + "bbox": [ + -86.73980712890625, + 36.173495506147, + -86.67303085327148, + 36.23084281427824 + ], + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-86.70478820800781, 36.23084281427824], + [-86.73980712890625, 36.21062368007896], + [-86.71371459960938, 36.173495506147], + [-86.67526245117186, 36.17709826419592], + [-86.67303085327148, 36.20910010895552], + [-86.68041229248047, 36.230427405208005], + [-86.70478820800781, 36.23084281427824] + ], + [ + [-86.6934585571289, 36.217271643303604], + [-86.71268463134766, 36.20771501855801], + [-86.70238494873047, 36.19067640168397], + [-86.68487548828125, 36.19691047217554], + [-86.68264389038086, 36.20993115142727], + [-86.6934585571289, 36.217271643303604] + ] + ] + } +} diff --git a/test/examples/booleans/point_on_line/false/LineWithOnly1SegmentIgnoreBoundary.geojson b/test/examples/booleans/point_on_line/false/LineWithOnly1SegmentIgnoreBoundary.geojson new file mode 100644 index 00000000..a251cc5c --- /dev/null +++ b/test/examples/booleans/point_on_line/false/LineWithOnly1SegmentIgnoreBoundary.geojson @@ -0,0 +1,27 @@ +{ + "type": "FeatureCollection", + "properties": { + "ignoreEndVertices": true + }, + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [3, 3] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_on_line/false/LineWithOnly1SegmentIgnoreBoundaryEnd.geojson b/test/examples/booleans/point_on_line/false/LineWithOnly1SegmentIgnoreBoundaryEnd.geojson new file mode 100644 index 00000000..2965824b --- /dev/null +++ b/test/examples/booleans/point_on_line/false/LineWithOnly1SegmentIgnoreBoundaryEnd.geojson @@ -0,0 +1,27 @@ +{ + "type": "FeatureCollection", + "properties": { + "ignoreEndVertices": true + }, + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [3, 3] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [3, 3] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_on_line/false/PointIsOnLineButFailsWithSmallEpsilonValue.geojson b/test/examples/booleans/point_on_line/false/PointIsOnLineButFailsWithSmallEpsilonValue.geojson new file mode 100644 index 00000000..1fe3749b --- /dev/null +++ b/test/examples/booleans/point_on_line/false/PointIsOnLineButFailsWithSmallEpsilonValue.geojson @@ -0,0 +1,27 @@ +{ + "type": "FeatureCollection", + "properties": { + "epsilon": 10e-18 + }, + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-75.25737143565107, 39.99673377198139] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-75.2580499870244, 40.00180204907801], + [-75.25676601413157, 39.992211720827044] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_on_line/false/PointIsOnLineButFailsWithoutEpsilonForBackwardsCompatibility.geojson b/test/examples/booleans/point_on_line/false/PointIsOnLineButFailsWithoutEpsilonForBackwardsCompatibility.geojson new file mode 100644 index 00000000..5ce33ec9 --- /dev/null +++ b/test/examples/booleans/point_on_line/false/PointIsOnLineButFailsWithoutEpsilonForBackwardsCompatibility.geojson @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-75.25737143565107, 39.99673377198139] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-75.2580499870244, 40.00180204907801], + [-75.25676601413157, 39.992211720827044] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_on_line/false/PointOnEndFailsWhenIgnoreEndpoints.geojson b/test/examples/booleans/point_on_line/false/PointOnEndFailsWhenIgnoreEndpoints.geojson new file mode 100644 index 00000000..6b996e24 --- /dev/null +++ b/test/examples/booleans/point_on_line/false/PointOnEndFailsWhenIgnoreEndpoints.geojson @@ -0,0 +1,28 @@ +{ + "type": "FeatureCollection", + "properties": { + "ignoreEndVertices": true + }, + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [38.3203125, 5.965753671065536] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [3, 3], + [38.3203125, 5.965753671065536] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_on_line/false/PointOnStartFailsWhenIgnoreEndpoints.geojson b/test/examples/booleans/point_on_line/false/PointOnStartFailsWhenIgnoreEndpoints.geojson new file mode 100644 index 00000000..740ac876 --- /dev/null +++ b/test/examples/booleans/point_on_line/false/PointOnStartFailsWhenIgnoreEndpoints.geojson @@ -0,0 +1,28 @@ +{ + "type": "FeatureCollection", + "properties": { + "ignoreEndVertices": true + }, + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [3, 3], + [38.3203125, 5.965753671065536] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_on_line/false/notOnLine.geojson b/test/examples/booleans/point_on_line/false/notOnLine.geojson new file mode 100644 index 00000000..e2a8d61d --- /dev/null +++ b/test/examples/booleans/point_on_line/false/notOnLine.geojson @@ -0,0 +1,28 @@ +{ + "type": "FeatureCollection", + "properties": { + "ignoreEndVertices": true + }, + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [20, 20] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [3, 3], + [38.3203125, 5.965753671065536] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_on_line/true/LineWithOnly1Segment.geojson b/test/examples/booleans/point_on_line/true/LineWithOnly1Segment.geojson new file mode 100644 index 00000000..770d4223 --- /dev/null +++ b/test/examples/booleans/point_on_line/true/LineWithOnly1Segment.geojson @@ -0,0 +1,27 @@ +{ + "type": "FeatureCollection", + "properties": { + "ignoreEndVertices": true + }, + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [3, 3] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_on_line/true/LineWithOnly1SegmentOnStart.geojson b/test/examples/booleans/point_on_line/true/LineWithOnly1SegmentOnStart.geojson new file mode 100644 index 00000000..71722f50 --- /dev/null +++ b/test/examples/booleans/point_on_line/true/LineWithOnly1SegmentOnStart.geojson @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [3, 3] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_on_line/true/PointOnFirstSegment.geojson b/test/examples/booleans/point_on_line/true/PointOnFirstSegment.geojson new file mode 100644 index 00000000..2a5e2ab5 --- /dev/null +++ b/test/examples/booleans/point_on_line/true/PointOnFirstSegment.geojson @@ -0,0 +1,28 @@ +{ + "type": "FeatureCollection", + "properties": { + "ignoreEndVertices": true + }, + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [3, 3], + [4, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_on_line/true/PointOnLastSegment.geojson b/test/examples/booleans/point_on_line/true/PointOnLastSegment.geojson new file mode 100644 index 00000000..813768e5 --- /dev/null +++ b/test/examples/booleans/point_on_line/true/PointOnLastSegment.geojson @@ -0,0 +1,28 @@ +{ + "type": "FeatureCollection", + "properties": { + "ignoreEndVertices": true + }, + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [3.5, 3.5] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [3, 3], + [4, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_on_line/true/PointOnLineEnd.geojson b/test/examples/booleans/point_on_line/true/PointOnLineEnd.geojson new file mode 100644 index 00000000..b7641931 --- /dev/null +++ b/test/examples/booleans/point_on_line/true/PointOnLineEnd.geojson @@ -0,0 +1,25 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [38.3203125, 5.965753671065536] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [3, 3], + [38.3203125, 5.965753671065536] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_on_line/true/PointOnLineMidVertice.geojson b/test/examples/booleans/point_on_line/true/PointOnLineMidVertice.geojson new file mode 100644 index 00000000..742ef612 --- /dev/null +++ b/test/examples/booleans/point_on_line/true/PointOnLineMidVertice.geojson @@ -0,0 +1,28 @@ +{ + "type": "FeatureCollection", + "properties": { + "ignoreEndVertices": true + }, + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [3, 3] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [3, 3], + [38.3203125, 5.965753671065536] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_on_line/true/PointOnLineMidpoint.geojson b/test/examples/booleans/point_on_line/true/PointOnLineMidpoint.geojson new file mode 100644 index 00000000..7ff17253 --- /dev/null +++ b/test/examples/booleans/point_on_line/true/PointOnLineMidpoint.geojson @@ -0,0 +1,25 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2, 2] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [3, 3], + [38.3203125, 5.965753671065536] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_on_line/true/PointOnLineStart.geojson b/test/examples/booleans/point_on_line/true/PointOnLineStart.geojson new file mode 100644 index 00000000..23c60455 --- /dev/null +++ b/test/examples/booleans/point_on_line/true/PointOnLineStart.geojson @@ -0,0 +1,25 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [0, 0] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [3, 3], + [38.3203125, 5.965753671065536] + ] + } + } + ] +} diff --git a/test/examples/booleans/point_on_line/true/PointOnLineWithEpsilon.geojson b/test/examples/booleans/point_on_line/true/PointOnLineWithEpsilon.geojson new file mode 100644 index 00000000..0a32c869 --- /dev/null +++ b/test/examples/booleans/point_on_line/true/PointOnLineWithEpsilon.geojson @@ -0,0 +1,27 @@ +{ + "type": "FeatureCollection", + "properties": { + "epsilon": 10e-17 + }, + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-75.25737143565107, 39.99673377198139] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-75.2580499870244, 40.00180204907801], + [-75.25676601413157, 39.992211720827044] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/LineString/LineString/LinesExactSame.geojson b/test/examples/booleans/touches/false/LineString/LineString/LinesExactSame.geojson new file mode 100644 index 00000000..034737ba --- /dev/null +++ b/test/examples/booleans/touches/false/LineString/LineString/LinesExactSame.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/LineString/LineString/LivesOverlap.geojson b/test/examples/booleans/touches/false/LineString/LineString/LivesOverlap.geojson new file mode 100644 index 00000000..28c41a8c --- /dev/null +++ b/test/examples/booleans/touches/false/LineString/LineString/LivesOverlap.geojson @@ -0,0 +1,30 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 2], + [1, 3], + [1, 15.5] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/LineString/MultiLineString/LineStringOverlapsMultiLinestring.geojson b/test/examples/booleans/touches/false/LineString/MultiLineString/LineStringOverlapsMultiLinestring.geojson new file mode 100644 index 00000000..84ce32e2 --- /dev/null +++ b/test/examples/booleans/touches/false/LineString/MultiLineString/LineStringOverlapsMultiLinestring.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [2, 2], + [2, 3] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/LineString/MultiLineString/LineStringSameAsMultiLinestring.geojson b/test/examples/booleans/touches/false/LineString/MultiLineString/LineStringSameAsMultiLinestring.geojson new file mode 100644 index 00000000..ff778d80 --- /dev/null +++ b/test/examples/booleans/touches/false/LineString/MultiLineString/LineStringSameAsMultiLinestring.geojson @@ -0,0 +1,39 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/LineString/MultiPoint/LineStringDoesNotTouchMP.geojson b/test/examples/booleans/touches/false/LineString/MultiPoint/LineStringDoesNotTouchMP.geojson new file mode 100644 index 00000000..37944a21 --- /dev/null +++ b/test/examples/booleans/touches/false/LineString/MultiPoint/LineStringDoesNotTouchMP.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [3, 1], + [3, 3] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/LineString/MultiPoint/LineStringTouchesMultiPointButInternal.geojson b/test/examples/booleans/touches/false/LineString/MultiPoint/LineStringTouchesMultiPointButInternal.geojson new file mode 100644 index 00000000..40b6b18e --- /dev/null +++ b/test/examples/booleans/touches/false/LineString/MultiPoint/LineStringTouchesMultiPointButInternal.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [1, 3] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/LineString/MultiPolygon/LineDoesNotTouchMultiPoly.geojson b/test/examples/booleans/touches/false/LineString/MultiPolygon/LineDoesNotTouchMultiPoly.geojson new file mode 100644 index 00000000..da9b4343 --- /dev/null +++ b/test/examples/booleans/touches/false/LineString/MultiPolygon/LineDoesNotTouchMultiPoly.geojson @@ -0,0 +1,43 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-1, 1], + [-1, 0.5] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/LineString/Polygon/LineCrossesPolygon.geojson b/test/examples/booleans/touches/false/LineString/Polygon/LineCrossesPolygon.geojson new file mode 100644 index 00000000..309de922 --- /dev/null +++ b/test/examples/booleans/touches/false/LineString/Polygon/LineCrossesPolygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [2, 0], + [11, 11] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/LineString/Polygon/LineDoesNotTouch.geojson b/test/examples/booleans/touches/false/LineString/Polygon/LineDoesNotTouch.geojson new file mode 100644 index 00000000..61f427a4 --- /dev/null +++ b/test/examples/booleans/touches/false/LineString/Polygon/LineDoesNotTouch.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-1, -2], + [-1, -3] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/LineString/Polygon/LineWIthinPolygon.geojson b/test/examples/booleans/touches/false/LineString/Polygon/LineWIthinPolygon.geojson new file mode 100644 index 00000000..a3016cea --- /dev/null +++ b/test/examples/booleans/touches/false/LineString/Polygon/LineWIthinPolygon.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 2], + [1, 3], + [3, 3] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiLineString/LineString/MultiLineStringOverlapsLine.geojson b/test/examples/booleans/touches/false/MultiLineString/LineString/MultiLineStringOverlapsLine.geojson new file mode 100644 index 00000000..4762791f --- /dev/null +++ b/test/examples/booleans/touches/false/MultiLineString/LineString/MultiLineStringOverlapsLine.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [2, 2], + [2, 3] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiLineString/LineString/MultiLineStringSameAsLine.geojson b/test/examples/booleans/touches/false/MultiLineString/LineString/MultiLineStringSameAsLine.geojson new file mode 100644 index 00000000..33a233eb --- /dev/null +++ b/test/examples/booleans/touches/false/MultiLineString/LineString/MultiLineStringSameAsLine.geojson @@ -0,0 +1,39 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiLineString/MultiLineString/MultiLineStringsOverlap.geojson b/test/examples/booleans/touches/false/MultiLineString/MultiLineString/MultiLineStringsOverlap.geojson new file mode 100644 index 00000000..467852d0 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiLineString/MultiLineString/MultiLineStringsOverlap.geojson @@ -0,0 +1,39 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [2, 2], + [2, 3] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiLineString/MultiLineString/MultiLineStringsSame.geojson b/test/examples/booleans/touches/false/MultiLineString/MultiLineString/MultiLineStringsSame.geojson new file mode 100644 index 00000000..eafdeba7 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiLineString/MultiLineString/MultiLineStringsSame.geojson @@ -0,0 +1,41 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiLineString/MultiPoint/MpTouchesInternalMultiline.geojson b/test/examples/booleans/touches/false/MultiLineString/MultiPoint/MpTouchesInternalMultiline.geojson new file mode 100644 index 00000000..ee8fd090 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiLineString/MultiPoint/MpTouchesInternalMultiline.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 2], + [10, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiLineString/MultiPoint/MultiPointNotTouchMultiline.geojson b/test/examples/booleans/touches/false/MultiLineString/MultiPoint/MultiPointNotTouchMultiline.geojson new file mode 100644 index 00000000..d87e3d98 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiLineString/MultiPoint/MultiPointNotTouchMultiline.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [12, 4], + [10, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiLineString/MultiPolygon/MultiLineInsideMultipoly.geojson b/test/examples/booleans/touches/false/MultiLineString/MultiPolygon/MultiLineInsideMultipoly.geojson new file mode 100644 index 00000000..4055d523 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiLineString/MultiPolygon/MultiLineInsideMultipoly.geojson @@ -0,0 +1,53 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiLineString/Point/PointNotTouchMultiLinestring.geojson b/test/examples/booleans/touches/false/MultiLineString/Point/PointNotTouchMultiLinestring.geojson new file mode 100644 index 00000000..04206d7d --- /dev/null +++ b/test/examples/booleans/touches/false/MultiLineString/Point/PointNotTouchMultiLinestring.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 3] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiLineString/Point/PointTouchesMidLineString.geojson b/test/examples/booleans/touches/false/MultiLineString/Point/PointTouchesMidLineString.geojson new file mode 100644 index 00000000..66298cf0 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiLineString/Point/PointTouchesMidLineString.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [10, 4] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiLineString/Polygon/MultiLineInsidePoly.geojson b/test/examples/booleans/touches/false/MultiLineString/Polygon/MultiLineInsidePoly.geojson new file mode 100644 index 00000000..a1ccee6d --- /dev/null +++ b/test/examples/booleans/touches/false/MultiLineString/Polygon/MultiLineInsidePoly.geojson @@ -0,0 +1,42 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiLineString/Polygon/MultiLineNotTouchPoly.geojson b/test/examples/booleans/touches/false/MultiLineString/Polygon/MultiLineNotTouchPoly.geojson new file mode 100644 index 00000000..a9cefb6a --- /dev/null +++ b/test/examples/booleans/touches/false/MultiLineString/Polygon/MultiLineNotTouchPoly.geojson @@ -0,0 +1,42 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [10, 10], + [10, 100], + [100, 100], + [100, 10], + [10, 10] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiPoint/LineString/MultiPointTouchesInsideLine.geojson b/test/examples/booleans/touches/false/MultiPoint/LineString/MultiPointTouchesInsideLine.geojson new file mode 100644 index 00000000..d9d3b811 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiPoint/LineString/MultiPointTouchesInsideLine.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [1, 3] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiPoint/LineString/MultipointDoesNotTouchLine.geojson b/test/examples/booleans/touches/false/MultiPoint/LineString/MultipointDoesNotTouchLine.geojson new file mode 100644 index 00000000..18791af1 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiPoint/LineString/MultipointDoesNotTouchLine.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [3, 1], + [3, 3] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiPoint/MultiLineString/MpDoesNotTouchMultiLine.geojson b/test/examples/booleans/touches/false/MultiPoint/MultiLineString/MpDoesNotTouchMultiLine.geojson new file mode 100644 index 00000000..fdd34da3 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiPoint/MultiLineString/MpDoesNotTouchMultiLine.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [12, 4], + [10, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiPoint/MultiLineString/MpTouchesInternalMultiLine.geojson b/test/examples/booleans/touches/false/MultiPoint/MultiLineString/MpTouchesInternalMultiLine.geojson new file mode 100644 index 00000000..0fc73013 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiPoint/MultiLineString/MpTouchesInternalMultiLine.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 2], + [10, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiPoint/MultiPolygon/MultiPointDoesNotTouchMultipolygon b/test/examples/booleans/touches/false/MultiPoint/MultiPolygon/MultiPointDoesNotTouchMultipolygon new file mode 100644 index 00000000..5b136d62 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiPoint/MultiPolygon/MultiPointDoesNotTouchMultipolygon @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [[10, 14], [-14, -14]] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [[[1, 1], [1, 10], [10, 10], [10, 1], [1, 1]]], + [[[-1, -1], [-1, -10], [-10, -10], [-10, -1], [-1, -1]]] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiPoint/MultiPolygon/multipoint-inside-multipolygon.geojson b/test/examples/booleans/touches/false/MultiPoint/MultiPolygon/multipoint-inside-multipolygon.geojson new file mode 100644 index 00000000..7cd0e752 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiPoint/MultiPolygon/multipoint-inside-multipolygon.geojson @@ -0,0 +1,43 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [4, 4], + [-14, -14] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiPoint/Polygon/MultiPointInsidePolygon.geojson b/test/examples/booleans/touches/false/MultiPoint/Polygon/MultiPointInsidePolygon.geojson new file mode 100644 index 00000000..372d60e6 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiPoint/Polygon/MultiPointInsidePolygon.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [2, 2], + [12, 12], + [15, 15] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiPoint/Polygon/MultiPointNoTouchPolygon.geojson b/test/examples/booleans/touches/false/MultiPoint/Polygon/MultiPointNoTouchPolygon.geojson new file mode 100644 index 00000000..f4f285fe --- /dev/null +++ b/test/examples/booleans/touches/false/MultiPoint/Polygon/MultiPointNoTouchPolygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [0, 0], + [0, 10] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiPolygon/LineString/MultiPolyNotTouchLineString.geojson b/test/examples/booleans/touches/false/MultiPolygon/LineString/MultiPolyNotTouchLineString.geojson new file mode 100644 index 00000000..e1f631c7 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiPolygon/LineString/MultiPolyNotTouchLineString.geojson @@ -0,0 +1,43 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-1, 1], + [-1, 0.5] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiPolygon/MultiLineString/MultiPolyOverlapsMultiLine.geojson b/test/examples/booleans/touches/false/MultiPolygon/MultiLineString/MultiPolyOverlapsMultiLine.geojson new file mode 100644 index 00000000..9ff6575e --- /dev/null +++ b/test/examples/booleans/touches/false/MultiPolygon/MultiLineString/MultiPolyOverlapsMultiLine.geojson @@ -0,0 +1,53 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiPolygon/MultiPoint/MultiPolyNotTouchMultiPoint.geojson b/test/examples/booleans/touches/false/MultiPolygon/MultiPoint/MultiPolyNotTouchMultiPoint.geojson new file mode 100644 index 00000000..98da507a --- /dev/null +++ b/test/examples/booleans/touches/false/MultiPolygon/MultiPoint/MultiPolyNotTouchMultiPoint.geojson @@ -0,0 +1,43 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [10, 14], + [-14, -14] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiPolygon/MultiPolygon/MultiPolysDoNotTouch.geojson b/test/examples/booleans/touches/false/MultiPolygon/MultiPolygon/MultiPolysDoNotTouch.geojson new file mode 100644 index 00000000..e5beeadc --- /dev/null +++ b/test/examples/booleans/touches/false/MultiPolygon/MultiPolygon/MultiPolysDoNotTouch.geojson @@ -0,0 +1,50 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [10, 10], + [10, 11], + [11, 11], + [11, 10], + [10, 10] + ] + ], + [ + [ + [30, 30], + [30, 40], + [40, 40], + [40, 30], + [30, 30] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [9, 9], + [10, 1], + [1, 1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiPolygon/MultiPolygon/MultiPolysOverlap.geojson b/test/examples/booleans/touches/false/MultiPolygon/MultiPolygon/MultiPolysOverlap.geojson new file mode 100644 index 00000000..6356e151 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiPolygon/MultiPolygon/MultiPolysOverlap.geojson @@ -0,0 +1,50 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [10, 10], + [10, 11], + [11, 11], + [11, 10], + [10, 10] + ] + ], + [ + [ + [30, 30], + [30, 40], + [40, 40], + [40, 30], + [30, 30] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10.5, 10.5], + [10, 1], + [1, 1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/MultiPolygon/Point/MultiPolyNotTouchPoint.geojson b/test/examples/booleans/touches/false/MultiPolygon/Point/MultiPolyNotTouchPoint.geojson new file mode 100644 index 00000000..c75f0b05 --- /dev/null +++ b/test/examples/booleans/touches/false/MultiPolygon/Point/MultiPolyNotTouchPoint.geojson @@ -0,0 +1,40 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [14, 14] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Point/LineString/PointIsNotTouchLine.geojson b/test/examples/booleans/touches/false/Point/LineString/PointIsNotTouchLine.geojson new file mode 100644 index 00000000..e7595525 --- /dev/null +++ b/test/examples/booleans/touches/false/Point/LineString/PointIsNotTouchLine.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2, 2] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Point/LineString/PointOnMidLinestring.geojson b/test/examples/booleans/touches/false/Point/LineString/PointOnMidLinestring.geojson new file mode 100644 index 00000000..8cb3cc42 --- /dev/null +++ b/test/examples/booleans/touches/false/Point/LineString/PointOnMidLinestring.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 2] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Point/MultiLineString/MpNotTouchMidLineString.geojson b/test/examples/booleans/touches/false/Point/MultiLineString/MpNotTouchMidLineString.geojson new file mode 100644 index 00000000..9fbb963a --- /dev/null +++ b/test/examples/booleans/touches/false/Point/MultiLineString/MpNotTouchMidLineString.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [10, 4] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Point/MultiLineString/MpOnMidLineString.geojson b/test/examples/booleans/touches/false/Point/MultiLineString/MpOnMidLineString.geojson new file mode 100644 index 00000000..95061da0 --- /dev/null +++ b/test/examples/booleans/touches/false/Point/MultiLineString/MpOnMidLineString.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 3] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Point/MultiPolygon/PointNotTouchMultipolygon.geojson b/test/examples/booleans/touches/false/Point/MultiPolygon/PointNotTouchMultipolygon.geojson new file mode 100644 index 00000000..30c016b8 --- /dev/null +++ b/test/examples/booleans/touches/false/Point/MultiPolygon/PointNotTouchMultipolygon.geojson @@ -0,0 +1,40 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [14, 14] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Point/Polygon/PointDoesNotTouchPolygon.geojson b/test/examples/booleans/touches/false/Point/Polygon/PointDoesNotTouchPolygon.geojson new file mode 100644 index 00000000..3bc20282 --- /dev/null +++ b/test/examples/booleans/touches/false/Point/Polygon/PointDoesNotTouchPolygon.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [14, 14] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Point/Polygon/PointInsidePolygon.geojson b/test/examples/booleans/touches/false/Point/Polygon/PointInsidePolygon.geojson new file mode 100644 index 00000000..0c44d959 --- /dev/null +++ b/test/examples/booleans/touches/false/Point/Polygon/PointInsidePolygon.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2, 2] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Polygon/LineString/PolyDoesNotTouchLine.geojson b/test/examples/booleans/touches/false/Polygon/LineString/PolyDoesNotTouchLine.geojson new file mode 100644 index 00000000..61f427a4 --- /dev/null +++ b/test/examples/booleans/touches/false/Polygon/LineString/PolyDoesNotTouchLine.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-1, -2], + [-1, -3] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Polygon/MultiLineString/PolyNotTouchMultiLine.geojson b/test/examples/booleans/touches/false/Polygon/MultiLineString/PolyNotTouchMultiLine.geojson new file mode 100644 index 00000000..0b8f2663 --- /dev/null +++ b/test/examples/booleans/touches/false/Polygon/MultiLineString/PolyNotTouchMultiLine.geojson @@ -0,0 +1,42 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [10, 10], + [10, 100], + [100, 100], + [100, 10], + [10, 10] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Polygon/MultiLineString/PolyOverlapMultiLine.geojson b/test/examples/booleans/touches/false/Polygon/MultiLineString/PolyOverlapMultiLine.geojson new file mode 100644 index 00000000..ff74557d --- /dev/null +++ b/test/examples/booleans/touches/false/Polygon/MultiLineString/PolyOverlapMultiLine.geojson @@ -0,0 +1,42 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Polygon/MultiPoint/PolygonNoTouchMultiPoint.geojson b/test/examples/booleans/touches/false/Polygon/MultiPoint/PolygonNoTouchMultiPoint.geojson new file mode 100644 index 00000000..e379ce6d --- /dev/null +++ b/test/examples/booleans/touches/false/Polygon/MultiPoint/PolygonNoTouchMultiPoint.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [0, 0], + [0, 10] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Polygon/MultiPoint/PolygonOverlapsMultiPoint.geojson b/test/examples/booleans/touches/false/Polygon/MultiPoint/PolygonOverlapsMultiPoint.geojson new file mode 100644 index 00000000..5b7479c1 --- /dev/null +++ b/test/examples/booleans/touches/false/Polygon/MultiPoint/PolygonOverlapsMultiPoint.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [2, 2], + [12, 12], + [15, 15] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Polygon/MultiPolygon/PolyNotTouchMultipoly.geojson b/test/examples/booleans/touches/false/Polygon/MultiPolygon/PolyNotTouchMultipoly.geojson new file mode 100644 index 00000000..4ed0783e --- /dev/null +++ b/test/examples/booleans/touches/false/Polygon/MultiPolygon/PolyNotTouchMultipoly.geojson @@ -0,0 +1,48 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [9, 9], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [10, 10], + [10, 11], + [11, 11], + [11, 10], + [10, 10] + ] + ], + [ + [ + [30, 30], + [30, 40], + [40, 40], + [40, 30], + [30, 30] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Polygon/Point/PolygonDoesNotTouchPoint.geojson b/test/examples/booleans/touches/false/Polygon/Point/PolygonDoesNotTouchPoint.geojson new file mode 100644 index 00000000..09bb41c7 --- /dev/null +++ b/test/examples/booleans/touches/false/Polygon/Point/PolygonDoesNotTouchPoint.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [14, 14] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Polygon/Point/PolygonOverlapsPoint.geojson b/test/examples/booleans/touches/false/Polygon/Point/PolygonOverlapsPoint.geojson new file mode 100644 index 00000000..b945b8e0 --- /dev/null +++ b/test/examples/booleans/touches/false/Polygon/Point/PolygonOverlapsPoint.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2, 2] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Polygon/Polygon/PolygonsDontTouch.geojson b/test/examples/booleans/touches/false/Polygon/Polygon/PolygonsDontTouch.geojson new file mode 100644 index 00000000..87fbbcaa --- /dev/null +++ b/test/examples/booleans/touches/false/Polygon/Polygon/PolygonsDontTouch.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [10, 10], + [10, 11], + [11, 11], + [11, 10], + [10, 10] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [9, 9], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/false/Polygon/Polygon/PolygonsOverlap.geojson b/test/examples/booleans/touches/false/Polygon/Polygon/PolygonsOverlap.geojson new file mode 100644 index 00000000..8dc49f37 --- /dev/null +++ b/test/examples/booleans/touches/false/Polygon/Polygon/PolygonsOverlap.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [10, 10], + [10, 11], + [11, 11], + [11, 10], + [10, 10] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [11, 11], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/LineString/LineString/LineTouchesEndpoint.geojson b/test/examples/booleans/touches/true/LineString/LineString/LineTouchesEndpoint.geojson new file mode 100644 index 00000000..45927008 --- /dev/null +++ b/test/examples/booleans/touches/true/LineString/LineString/LineTouchesEndpoint.geojson @@ -0,0 +1,28 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 2], + [1, 3] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 3], + [1, 4], + [1, 5] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/LineString/MultiLineString/LineStringTouchesEnd.geojson b/test/examples/booleans/touches/true/LineString/MultiLineString/LineStringTouchesEnd.geojson new file mode 100644 index 00000000..78fcf8fa --- /dev/null +++ b/test/examples/booleans/touches/true/LineString/MultiLineString/LineStringTouchesEnd.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [2, 5], + [2, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/LineString/MultiLineString/LineStringTouchesStart.geojson b/test/examples/booleans/touches/true/LineString/MultiLineString/LineStringTouchesStart.geojson new file mode 100644 index 00000000..8ef6dd51 --- /dev/null +++ b/test/examples/booleans/touches/true/LineString/MultiLineString/LineStringTouchesStart.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 1], + [1, 1] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/LineString/MultiPoint/MultipointTouchesLine.geojson b/test/examples/booleans/touches/true/LineString/MultiPoint/MultipointTouchesLine.geojson new file mode 100644 index 00000000..496c3bf6 --- /dev/null +++ b/test/examples/booleans/touches/true/LineString/MultiPoint/MultipointTouchesLine.geojson @@ -0,0 +1,30 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12], + [15, 15] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/LineString/MultiPolygon/LineTouchesMultiPoly.geojson b/test/examples/booleans/touches/true/LineString/MultiPolygon/LineTouchesMultiPoly.geojson new file mode 100644 index 00000000..046fcafe --- /dev/null +++ b/test/examples/booleans/touches/true/LineString/MultiPolygon/LineTouchesMultiPoly.geojson @@ -0,0 +1,43 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 1], + [1, 1] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/LineString/MultiPolygon/LineTouchesSecondMultiPoly.geojson b/test/examples/booleans/touches/true/LineString/MultiPolygon/LineTouchesSecondMultiPoly.geojson new file mode 100644 index 00000000..77d19417 --- /dev/null +++ b/test/examples/booleans/touches/true/LineString/MultiPolygon/LineTouchesSecondMultiPoly.geojson @@ -0,0 +1,43 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-1, 1], + [-1, -1] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/LineString/Polygon/LineTouchesPolygon.geojson b/test/examples/booleans/touches/true/LineString/Polygon/LineTouchesPolygon.geojson new file mode 100644 index 00000000..8d3a846f --- /dev/null +++ b/test/examples/booleans/touches/true/LineString/Polygon/LineTouchesPolygon.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [1, 1], + [1, 5] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/MultiLineString/LineString/MultiLineTouchesLine.geojson b/test/examples/booleans/touches/true/MultiLineString/LineString/MultiLineTouchesLine.geojson new file mode 100644 index 00000000..1f9b3972 --- /dev/null +++ b/test/examples/booleans/touches/true/MultiLineString/LineString/MultiLineTouchesLine.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [2, 0], + [2, 1] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/MultiLineString/MultiLineString/MultiLineTouchesMultiLine.geojson b/test/examples/booleans/touches/true/MultiLineString/MultiLineString/MultiLineTouchesMultiLine.geojson new file mode 100644 index 00000000..a7c9aef8 --- /dev/null +++ b/test/examples/booleans/touches/true/MultiLineString/MultiLineString/MultiLineTouchesMultiLine.geojson @@ -0,0 +1,43 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [12, 10], + [12, 11] + ], + [ + [2, 0], + [2, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/MultiLineString/MultiPoint/MultiLineTouchesMultiPoint.geojson b/test/examples/booleans/touches/true/MultiLineString/MultiPoint/MultiLineTouchesMultiPoint.geojson new file mode 100644 index 00000000..8ad24fa8 --- /dev/null +++ b/test/examples/booleans/touches/true/MultiLineString/MultiPoint/MultiLineTouchesMultiPoint.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [10, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/MultiLineString/Point/MultiLineTouchesPoint.geojson b/test/examples/booleans/touches/true/MultiLineString/Point/MultiLineTouchesPoint.geojson new file mode 100644 index 00000000..2be13eb2 --- /dev/null +++ b/test/examples/booleans/touches/true/MultiLineString/Point/MultiLineTouchesPoint.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2, 4] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/MultiLineString/Polygon/MultiLineTouchesPolygon.geojson b/test/examples/booleans/touches/true/MultiLineString/Polygon/MultiLineTouchesPolygon.geojson new file mode 100644 index 00000000..58348118 --- /dev/null +++ b/test/examples/booleans/touches/true/MultiLineString/Polygon/MultiLineTouchesPolygon.geojson @@ -0,0 +1,42 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, -1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, -1], + [1, -10], + [10, -10], + [10, -1], + [1, -1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/MultiPoint/LineString/MultipointTouchesLine.geojson b/test/examples/booleans/touches/true/MultiPoint/LineString/MultipointTouchesLine.geojson new file mode 100644 index 00000000..83c5eccf --- /dev/null +++ b/test/examples/booleans/touches/true/MultiPoint/LineString/MultipointTouchesLine.geojson @@ -0,0 +1,30 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12], + [15, 15] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/MultiPoint/MultiLineString/MpTouchesEndMultiLine.geojson b/test/examples/booleans/touches/true/MultiPoint/MultiLineString/MpTouchesEndMultiLine.geojson new file mode 100644 index 00000000..faca8c6f --- /dev/null +++ b/test/examples/booleans/touches/true/MultiPoint/MultiLineString/MpTouchesEndMultiLine.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 4], + [10, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/MultiPoint/MultiLineString/MpTouchesSecondMultiLine.geojson b/test/examples/booleans/touches/true/MultiPoint/MultiLineString/MpTouchesSecondMultiLine.geojson new file mode 100644 index 00000000..6e07deb3 --- /dev/null +++ b/test/examples/booleans/touches/true/MultiPoint/MultiLineString/MpTouchesSecondMultiLine.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [2, 4], + [10, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/MultiPoint/MultiPolygon/multipoint-touches-multipolygon.geojson b/test/examples/booleans/touches/true/MultiPoint/MultiPolygon/multipoint-touches-multipolygon.geojson new file mode 100644 index 00000000..5192bd0f --- /dev/null +++ b/test/examples/booleans/touches/true/MultiPoint/MultiPolygon/multipoint-touches-multipolygon.geojson @@ -0,0 +1,43 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [-1, -1] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/MultiPoint/Polygon/MultiPointIsWithinPolygon.geojson b/test/examples/booleans/touches/true/MultiPoint/Polygon/MultiPointIsWithinPolygon.geojson new file mode 100644 index 00000000..b45ca953 --- /dev/null +++ b/test/examples/booleans/touches/true/MultiPoint/Polygon/MultiPointIsWithinPolygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [14, 14] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/MultiPolygon/MultiLineString/MultiLineTouchesMultiPoly.geojson b/test/examples/booleans/touches/true/MultiPolygon/MultiLineString/MultiLineTouchesMultiPoly.geojson new file mode 100644 index 00000000..b6864333 --- /dev/null +++ b/test/examples/booleans/touches/true/MultiPolygon/MultiLineString/MultiLineTouchesMultiPoly.geojson @@ -0,0 +1,53 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [20, -2], + [20, -20], + [40, -20], + [40, -2], + [20, -2] + ] + ], + [ + [ + [1, -1], + [1, -10], + [10, -10], + [10, -1], + [1, -1] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, -1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/MultiPolygon/MultiPoint/MultiPolyTouchesMultiPoint.geojson b/test/examples/booleans/touches/true/MultiPolygon/MultiPoint/MultiPolyTouchesMultiPoint.geojson new file mode 100644 index 00000000..d89beb30 --- /dev/null +++ b/test/examples/booleans/touches/true/MultiPolygon/MultiPoint/MultiPolyTouchesMultiPoint.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [14, 14] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/MultiPolygon/MultiPolygon/MultiPolyTouchesMultiPoly.geojson b/test/examples/booleans/touches/true/MultiPolygon/MultiPolygon/MultiPolyTouchesMultiPoly.geojson new file mode 100644 index 00000000..c6b54130 --- /dev/null +++ b/test/examples/booleans/touches/true/MultiPolygon/MultiPolygon/MultiPolyTouchesMultiPoly.geojson @@ -0,0 +1,50 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [10, 10], + [10, 11], + [11, 11], + [11, 10], + [10, 10] + ] + ], + [ + [ + [30, 30], + [30, 40], + [40, 40], + [40, 30], + [30, 30] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 11], + [10, 1], + [1, 1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/MultiPolygon/Point/MpTouchesPoint.geojson b/test/examples/booleans/touches/true/MultiPolygon/Point/MpTouchesPoint.geojson new file mode 100644 index 00000000..90c6f586 --- /dev/null +++ b/test/examples/booleans/touches/true/MultiPolygon/Point/MpTouchesPoint.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 5] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/MultiPolygon/Polygon/MultiPolyTouchesPoly.geojson b/test/examples/booleans/touches/true/MultiPolygon/Polygon/MultiPolyTouchesPoly.geojson new file mode 100644 index 00000000..3a18ef22 --- /dev/null +++ b/test/examples/booleans/touches/true/MultiPolygon/Polygon/MultiPolyTouchesPoly.geojson @@ -0,0 +1,48 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [10, 10], + [10, 11], + [11, 11], + [11, 10], + [10, 10] + ] + ], + [ + [ + [30, 30], + [30, 40], + [40, 40], + [40, 30], + [30, 30] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 11], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Point/LineString/PointOnEndLine.geojson b/test/examples/booleans/touches/true/Point/LineString/PointOnEndLine.geojson new file mode 100644 index 00000000..b30df470 --- /dev/null +++ b/test/examples/booleans/touches/true/Point/LineString/PointOnEndLine.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 4] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Point/LineString/PointOnStartLine.geojson b/test/examples/booleans/touches/true/Point/LineString/PointOnStartLine.geojson new file mode 100644 index 00000000..b84728a8 --- /dev/null +++ b/test/examples/booleans/touches/true/Point/LineString/PointOnStartLine.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Point/MultiLineString/MpOnEndLine.geojson b/test/examples/booleans/touches/true/Point/MultiLineString/MpOnEndLine.geojson new file mode 100644 index 00000000..58dbf02b --- /dev/null +++ b/test/examples/booleans/touches/true/Point/MultiLineString/MpOnEndLine.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 4] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Point/MultiLineString/MpOnStartLine.geojson b/test/examples/booleans/touches/true/Point/MultiLineString/MpOnStartLine.geojson new file mode 100644 index 00000000..34c52729 --- /dev/null +++ b/test/examples/booleans/touches/true/Point/MultiLineString/MpOnStartLine.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, 1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Point/MultiPolygon/PointTouchesMultipolygon.geojson b/test/examples/booleans/touches/true/Point/MultiPolygon/PointTouchesMultipolygon.geojson new file mode 100644 index 00000000..40153b61 --- /dev/null +++ b/test/examples/booleans/touches/true/Point/MultiPolygon/PointTouchesMultipolygon.geojson @@ -0,0 +1,40 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 2] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Point/MultiPolygon/PointTouchesMultipolygonHole.geojson b/test/examples/booleans/touches/true/Point/MultiPolygon/PointTouchesMultipolygonHole.geojson new file mode 100644 index 00000000..f60d3a63 --- /dev/null +++ b/test/examples/booleans/touches/true/Point/MultiPolygon/PointTouchesMultipolygonHole.geojson @@ -0,0 +1,46 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2, 2] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ], + [ + [2, 2], + [2, 4], + [4, 4], + [2, 2] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Point/Polygon/PointOnEdgePolygon.geojson b/test/examples/booleans/touches/true/Point/Polygon/PointOnEdgePolygon.geojson new file mode 100644 index 00000000..aacac561 --- /dev/null +++ b/test/examples/booleans/touches/true/Point/Polygon/PointOnEdgePolygon.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 5] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Point/Polygon/PointOnHole.geojson b/test/examples/booleans/touches/true/Point/Polygon/PointOnHole.geojson new file mode 100644 index 00000000..4c6d4107 --- /dev/null +++ b/test/examples/booleans/touches/true/Point/Polygon/PointOnHole.geojson @@ -0,0 +1,35 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2, 2] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ], + [ + [2, 2], + [2, 4], + [4, 4], + [2, 2] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Point/Polygon/PointOnVerticePolygon.geojson b/test/examples/booleans/touches/true/Point/Polygon/PointOnVerticePolygon.geojson new file mode 100644 index 00000000..d24f78bd --- /dev/null +++ b/test/examples/booleans/touches/true/Point/Polygon/PointOnVerticePolygon.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Polygon/LineString/PolygonTouchesLines.geojson b/test/examples/booleans/touches/true/Polygon/LineString/PolygonTouchesLines.geojson new file mode 100644 index 00000000..6d176969 --- /dev/null +++ b/test/examples/booleans/touches/true/Polygon/LineString/PolygonTouchesLines.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [1, 1], + [1, 5] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Polygon/MultiLineString/PolygonTouchesMultiline.geojson b/test/examples/booleans/touches/true/Polygon/MultiLineString/PolygonTouchesMultiline.geojson new file mode 100644 index 00000000..a63d41f4 --- /dev/null +++ b/test/examples/booleans/touches/true/Polygon/MultiLineString/PolygonTouchesMultiline.geojson @@ -0,0 +1,42 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, -1], + [1, -10], + [10, -10], + [10, -1], + [1, -1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + [ + [2, -1], + [2, 2], + [2, 3], + [2, 4] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Polygon/MultiPoint/PolygonTouchesMultiPoint.geojson b/test/examples/booleans/touches/true/Polygon/MultiPoint/PolygonTouchesMultiPoint.geojson new file mode 100644 index 00000000..1a7e7091 --- /dev/null +++ b/test/examples/booleans/touches/true/Polygon/MultiPoint/PolygonTouchesMultiPoint.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [14, 14] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Polygon/MultiPolygon/PolyTouchMultiPolys.geojson b/test/examples/booleans/touches/true/Polygon/MultiPolygon/PolyTouchMultiPolys.geojson new file mode 100644 index 00000000..2ea4111b --- /dev/null +++ b/test/examples/booleans/touches/true/Polygon/MultiPolygon/PolyTouchMultiPolys.geojson @@ -0,0 +1,48 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 11], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [10, 10], + [10, 11], + [11, 11], + [11, 10], + [10, 10] + ] + ], + [ + [ + [30, 30], + [30, 40], + [40, 40], + [40, 30], + [30, 30] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Polygon/Point/PolygonTouchesPoint.geojson b/test/examples/booleans/touches/true/Polygon/Point/PolygonTouchesPoint.geojson new file mode 100644 index 00000000..8cba1bf9 --- /dev/null +++ b/test/examples/booleans/touches/true/Polygon/Point/PolygonTouchesPoint.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 5] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Polygon/Point/PolygonTouchesPointVertice.geojson b/test/examples/booleans/touches/true/Polygon/Point/PolygonTouchesPointVertice.geojson new file mode 100644 index 00000000..685a46d3 --- /dev/null +++ b/test/examples/booleans/touches/true/Polygon/Point/PolygonTouchesPointVertice.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Polygon/Polygon/PolygonTouchesEdges.geojson b/test/examples/booleans/touches/true/Polygon/Polygon/PolygonTouchesEdges.geojson new file mode 100644 index 00000000..ac9b8b79 --- /dev/null +++ b/test/examples/booleans/touches/true/Polygon/Polygon/PolygonTouchesEdges.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [10, 10], + [10, 11], + [11, 11], + [11, 10], + [10, 10] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 11], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/touches/true/Polygon/Polygon/PolygonsTouchVertices.geojson b/test/examples/booleans/touches/true/Polygon/Polygon/PolygonsTouchVertices.geojson new file mode 100644 index 00000000..e66806a7 --- /dev/null +++ b/test/examples/booleans/touches/true/Polygon/Polygon/PolygonsTouchVertices.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [10, 10], + [10, 11], + [11, 11], + [11, 10], + [10, 10] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/assertion/MultiPoint/multipoint.geojson b/test/examples/booleans/valid/assertion/MultiPoint/multipoint.geojson new file mode 100644 index 00000000..ed827478 --- /dev/null +++ b/test/examples/booleans/valid/assertion/MultiPoint/multipoint.geojson @@ -0,0 +1,16 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [2.7575683593749996], + [2.5575683593749996, 2.8113711933311403] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/assertion/Point/point.geojson b/test/examples/booleans/valid/assertion/Point/point.geojson new file mode 100644 index 00000000..7e46c4f8 --- /dev/null +++ b/test/examples/booleans/valid/assertion/Point/point.geojson @@ -0,0 +1,13 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2.7575683593749996] + } + } + ] +} diff --git a/test/examples/booleans/valid/false/MultiPolygon/multipoly-with-2-vertices-touching.geojson b/test/examples/booleans/valid/false/MultiPolygon/multipoly-with-2-vertices-touching.geojson new file mode 100644 index 00000000..ad3cb34d --- /dev/null +++ b/test/examples/booleans/valid/false/MultiPolygon/multipoly-with-2-vertices-touching.geojson @@ -0,0 +1,30 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [-0.703125, 24.84656534821976], + [11.25, 24.84656534821976], + [11.25, 31.353636941500987], + [-0.703125, 31.353636941500987], + [-0.703125, 24.84656534821976] + ], + [ + [3.076171875, 27.254629577800063], + [6.8115234375, 27.254629577800063], + [6.8115234375, 31.353636941500987], + [-0.703125, 29.916852233070173], + [3.076171875, 27.254629577800063] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/false/MultiPolygon/multipolygons-overlap.geojson b/test/examples/booleans/valid/false/MultiPolygon/multipolygons-overlap.geojson new file mode 100644 index 00000000..196b1f9a --- /dev/null +++ b/test/examples/booleans/valid/false/MultiPolygon/multipolygons-overlap.geojson @@ -0,0 +1,39 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [-0.703125, 24.84656534821976], + [11.25, 24.84656534821976], + [11.25, 31.353636941500987], + [-0.703125, 31.353636941500987], + [-0.703125, 24.84656534821976] + ], + [ + [3.076171875, 27.254629577800063], + [6.8115234375, 27.254629577800063], + [6.8115234375, 29.916852233070173], + [3.076171875, 29.916852233070173], + [3.076171875, 27.254629577800063] + ] + ], + [ + [ + [5.80078125, 33.100745405144245], + [8.4814453125, 30.100745405144245], + [8.4814453125, 34.397844946449865], + [5.80078125, 34.397844946449865], + [5.80078125, 33.100745405144245] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/false/MultiPolygon/not-enough-coords.geojson b/test/examples/booleans/valid/false/MultiPolygon/not-enough-coords.geojson new file mode 100644 index 00000000..e2e15631 --- /dev/null +++ b/test/examples/booleans/valid/false/MultiPolygon/not-enough-coords.geojson @@ -0,0 +1,21 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [-0.703125, 24.84656534821976], + [11.25, 24.84656534821976], + [-0.703125, 24.84656534821976] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/false/Polygon/not-enough-coords.geojson b/test/examples/booleans/valid/false/Polygon/not-enough-coords.geojson new file mode 100644 index 00000000..ba0568d2 --- /dev/null +++ b/test/examples/booleans/valid/false/Polygon/not-enough-coords.geojson @@ -0,0 +1,19 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-0.703125, 24.84656534821976], + [11.25, 24.84656534821976], + [-0.703125, 24.84656534821976] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/false/Polygon/polygon-with-hole-2-vertices-touching.geojson b/test/examples/booleans/valid/false/Polygon/polygon-with-hole-2-vertices-touching.geojson new file mode 100644 index 00000000..38eff311 --- /dev/null +++ b/test/examples/booleans/valid/false/Polygon/polygon-with-hole-2-vertices-touching.geojson @@ -0,0 +1,28 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-0.703125, 24.84656534821976], + [11.25, 24.84656534821976], + [11.25, 31.353636941500987], + [-0.703125, 31.353636941500987], + [-0.703125, 24.84656534821976] + ], + [ + [3.076171875, 27.254629577800063], + [6.8115234375, 27.254629577800063], + [6.8115234375, 31.353636941500987], + [-0.703125, 29.916852233070173], + [3.076171875, 27.254629577800063] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/false/Polygon/polygon-with-puncture.geojson b/test/examples/booleans/valid/false/Polygon/polygon-with-puncture.geojson new file mode 100644 index 00000000..9266a1fb --- /dev/null +++ b/test/examples/booleans/valid/false/Polygon/polygon-with-puncture.geojson @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-0.703125, 24.84656534821976], + [10, 24.84656534821976], + [10, 26.84656534821976], + [10, 24.84656534821976], + [11.25, 24.84656534821976], + [11.25, 31.353636941500987], + [-0.703125, 31.353636941500987], + [-0.703125, 24.84656534821976] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/false/Polygon/polygon-with-spike.geojson b/test/examples/booleans/valid/false/Polygon/polygon-with-spike.geojson new file mode 100644 index 00000000..101fac28 --- /dev/null +++ b/test/examples/booleans/valid/false/Polygon/polygon-with-spike.geojson @@ -0,0 +1,22 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-0.703125, 24.84656534821976], + [11.25, 24.84656534821976], + [11.25, 22], + [11.25, 31.353636941500987], + [-0.703125, 31.353636941500987], + [-0.703125, 24.84656534821976] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/true/LineString/linestring.geojson b/test/examples/booleans/valid/true/LineString/linestring.geojson new file mode 100644 index 00000000..75a1b7a1 --- /dev/null +++ b/test/examples/booleans/valid/true/LineString/linestring.geojson @@ -0,0 +1,17 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1.285400390625, 4.214943141390651], + [0.472412109375, 2.9649843693339677], + [1.900634765625, 2.1857489471296665] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/true/MultiLineString/multilinestring.geojson b/test/examples/booleans/valid/true/MultiLineString/multilinestring.geojson new file mode 100644 index 00000000..4af98e8e --- /dev/null +++ b/test/examples/booleans/valid/true/MultiLineString/multilinestring.geojson @@ -0,0 +1,23 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [1.285400390625, 4.214943141390651], + [0.472412109375, 2.9649843693339677], + [1.900634765625, 2.1857489471296665] + ], + [ + [2.076416015625, 4.07249425916745], + [3.2080078125, 2.5370123584000273] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/true/MultiPoint/multipoint-with-z.geojson b/test/examples/booleans/valid/true/MultiPoint/multipoint-with-z.geojson new file mode 100644 index 00000000..12c5a939 --- /dev/null +++ b/test/examples/booleans/valid/true/MultiPoint/multipoint-with-z.geojson @@ -0,0 +1,16 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [2.7575683593749996, 2.8113711933311403, 1], + [2.5575683593749996, 2.8113711933311403] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/true/MultiPoint/multipoint.geojson b/test/examples/booleans/valid/true/MultiPoint/multipoint.geojson new file mode 100644 index 00000000..785542e0 --- /dev/null +++ b/test/examples/booleans/valid/true/MultiPoint/multipoint.geojson @@ -0,0 +1,16 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [2.7575683593749996, 2.8113711933311403], + [2.5575683593749996, 2.8113711933311403] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/true/MultiPolygon/multipolygon-touch.geojson b/test/examples/booleans/valid/true/MultiPolygon/multipolygon-touch.geojson new file mode 100644 index 00000000..ff290c16 --- /dev/null +++ b/test/examples/booleans/valid/true/MultiPolygon/multipolygon-touch.geojson @@ -0,0 +1,39 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [-0.703, 24.846], + [11.25, 24.846], + [11.25, 31.353], + [-0.703, 31.353], + [-0.703, 24.846] + ], + [ + [3.076, 27.254], + [6.811, 27.254], + [6.811, 29.916], + [3.076, 29.916], + [3.076, 27.254] + ] + ], + [ + [ + [5.8, 33.1], + [8.481, 31.353], + [8.481, 34.397], + [5.8, 34.397], + [5.8, 33.1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/true/MultiPolygon/multipolygon-with-hole.geojson b/test/examples/booleans/valid/true/MultiPolygon/multipolygon-with-hole.geojson new file mode 100644 index 00000000..72f4ce17 --- /dev/null +++ b/test/examples/booleans/valid/true/MultiPolygon/multipolygon-with-hole.geojson @@ -0,0 +1,39 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [-0.703125, 24.84656534821976], + [11.25, 24.84656534821976], + [11.25, 31.353636941500987], + [-0.703125, 31.353636941500987], + [-0.703125, 24.84656534821976] + ], + [ + [3.076171875, 27.254629577800063], + [6.8115234375, 27.254629577800063], + [6.8115234375, 29.916852233070173], + [3.076171875, 29.916852233070173], + [3.076171875, 27.254629577800063] + ] + ], + [ + [ + [5.80078125, 33.100745405144245], + [8.4814453125, 33.100745405144245], + [8.4814453125, 34.397844946449865], + [5.80078125, 34.397844946449865], + [5.80078125, 33.100745405144245] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/true/MultiPolygon/multipolygon.geojson b/test/examples/booleans/valid/true/MultiPolygon/multipolygon.geojson new file mode 100644 index 00000000..e4ce0e33 --- /dev/null +++ b/test/examples/booleans/valid/true/MultiPolygon/multipolygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [-0.703125, 24.84656534821976], + [11.25, 24.84656534821976], + [11.25, 31.353636941500987], + [-0.703125, 31.353636941500987], + [-0.703125, 24.84656534821976] + ] + ], + [ + [ + [5.80078125, 33.100745405144245], + [8.4814453125, 33.100745405144245], + [8.4814453125, 34.397844946449865], + [5.80078125, 34.397844946449865], + [5.80078125, 33.100745405144245] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/true/Point/point-with-z.geojson b/test/examples/booleans/valid/true/Point/point-with-z.geojson new file mode 100644 index 00000000..3082c2e9 --- /dev/null +++ b/test/examples/booleans/valid/true/Point/point-with-z.geojson @@ -0,0 +1,13 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2.7575683593749996, 2.8113711933311403, 1] + } + } + ] +} diff --git a/test/examples/booleans/valid/true/Point/point.geojson b/test/examples/booleans/valid/true/Point/point.geojson new file mode 100644 index 00000000..430ab19c --- /dev/null +++ b/test/examples/booleans/valid/true/Point/point.geojson @@ -0,0 +1,13 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2.7575683593749996, 2.8113711933311403] + } + } + ] +} diff --git a/test/examples/booleans/valid/true/Polygon/polygon-internal-hole.geojson b/test/examples/booleans/valid/true/Polygon/polygon-internal-hole.geojson new file mode 100644 index 00000000..788c54a3 --- /dev/null +++ b/test/examples/booleans/valid/true/Polygon/polygon-internal-hole.geojson @@ -0,0 +1,28 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-0.703125, 24.84656534821976], + [11.25, 24.84656534821976], + [11.25, 31.353636941500987], + [-0.703125, 31.353636941500987], + [-0.703125, 24.84656534821976] + ], + [ + [3.076171875, 27.254629577800063], + [6.8115234375, 27.254629577800063], + [6.8115234375, 29.916852233070173], + [3.076171875, 29.916852233070173], + [3.076171875, 27.254629577800063] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/true/Polygon/polygon-with-hole-1-vertice-touching.geojson b/test/examples/booleans/valid/true/Polygon/polygon-with-hole-1-vertice-touching.geojson new file mode 100644 index 00000000..6bf8b239 --- /dev/null +++ b/test/examples/booleans/valid/true/Polygon/polygon-with-hole-1-vertice-touching.geojson @@ -0,0 +1,28 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-0.703125, 24.84656534821976], + [11.25, 24.84656534821976], + [11.25, 31.353636941500987], + [-0.703125, 31.353636941500987], + [-0.703125, 24.84656534821976] + ], + [ + [3.076171875, 27.254629577800063], + [6.8115234375, 27.254629577800063], + [6.8115234375, 29.916852233070173], + [-0.703125, 29.916852233070173], + [3.076171875, 27.254629577800063] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/valid/true/Polygon/polygon.geojson b/test/examples/booleans/valid/true/Polygon/polygon.geojson new file mode 100644 index 00000000..ea06e0a0 --- /dev/null +++ b/test/examples/booleans/valid/true/Polygon/polygon.geojson @@ -0,0 +1,21 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-0.703125, 24.84656534821976], + [11.25, 24.84656534821976], + [11.25, 31.353636941500987], + [-0.703125, 31.353636941500987], + [-0.703125, 24.84656534821976] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/LineString/LineString/LineIsNotWithinLine.geojson b/test/examples/booleans/within/false/LineString/LineString/LineIsNotWithinLine.geojson new file mode 100644 index 00000000..28c41a8c --- /dev/null +++ b/test/examples/booleans/within/false/LineString/LineString/LineIsNotWithinLine.geojson @@ -0,0 +1,30 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 2], + [1, 3], + [1, 15.5] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/LineString/Polygon/LineIsNotWIthinPolygon.geojson b/test/examples/booleans/within/false/LineString/Polygon/LineIsNotWIthinPolygon.geojson new file mode 100644 index 00000000..c70523db --- /dev/null +++ b/test/examples/booleans/within/false/LineString/Polygon/LineIsNotWIthinPolygon.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 2], + [1, 3], + [1, 15.5] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/LineString/Polygon/LineIsNotWIthinPolygonBoundary.geojson b/test/examples/booleans/within/false/LineString/Polygon/LineIsNotWIthinPolygonBoundary.geojson new file mode 100644 index 00000000..d0125aa9 --- /dev/null +++ b/test/examples/booleans/within/false/LineString/Polygon/LineIsNotWIthinPolygonBoundary.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 2], + [1, 3], + [1, 3.5] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/MultiLineString/MultiPolygon/skip-multilinestring-not-within-multipolygon.geojson b/test/examples/booleans/within/false/MultiLineString/MultiPolygon/skip-multilinestring-not-within-multipolygon.geojson new file mode 100644 index 00000000..f2aca1a0 --- /dev/null +++ b/test/examples/booleans/within/false/MultiLineString/MultiPolygon/skip-multilinestring-not-within-multipolygon.geojson @@ -0,0 +1,49 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [4, 4], + [1, 1] + ], + [ + [-14, -14], + [-11, -11] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/MultiPoint/LineString/MultiPointsIsNotWIthinLine.geojson b/test/examples/booleans/within/false/MultiPoint/LineString/MultiPointsIsNotWIthinLine.geojson new file mode 100644 index 00000000..83c5eccf --- /dev/null +++ b/test/examples/booleans/within/false/MultiPoint/LineString/MultiPointsIsNotWIthinLine.geojson @@ -0,0 +1,30 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12], + [15, 15] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/MultiPoint/LineString/MultiPointsOnLineEndsIsNotWIthinLine.geojson b/test/examples/booleans/within/false/MultiPoint/LineString/MultiPointsOnLineEndsIsNotWIthinLine.geojson new file mode 100644 index 00000000..a99fcbc1 --- /dev/null +++ b/test/examples/booleans/within/false/MultiPoint/LineString/MultiPointsOnLineEndsIsNotWIthinLine.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/MultiPoint/MultiPoint/MultiPointIsNotWithinMultiPoint.geojson b/test/examples/booleans/within/false/MultiPoint/MultiPoint/MultiPointIsNotWithinMultiPoint.geojson new file mode 100644 index 00000000..d00c24ab --- /dev/null +++ b/test/examples/booleans/within/false/MultiPoint/MultiPoint/MultiPointIsNotWithinMultiPoint.geojson @@ -0,0 +1,28 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [1, 1.5] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12], + [15, 15] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/MultiPoint/MultiPolygon/multipoint-not-within-multipolygon.geojson b/test/examples/booleans/within/false/MultiPoint/MultiPolygon/multipoint-not-within-multipolygon.geojson new file mode 100644 index 00000000..7cd0e752 --- /dev/null +++ b/test/examples/booleans/within/false/MultiPoint/MultiPolygon/multipoint-not-within-multipolygon.geojson @@ -0,0 +1,43 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [4, 4], + [-14, -14] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/MultiPoint/Polygon/MultiPointAllOnBoundaryIsNotWithinPolygon.geojson b/test/examples/booleans/within/false/MultiPoint/Polygon/MultiPointAllOnBoundaryIsNotWithinPolygon.geojson new file mode 100644 index 00000000..d69eb204 --- /dev/null +++ b/test/examples/booleans/within/false/MultiPoint/Polygon/MultiPointAllOnBoundaryIsNotWithinPolygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [1, 10] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/MultiPoint/Polygon/MultiPointIsNotWithinPolygon.geojson b/test/examples/booleans/within/false/MultiPoint/Polygon/MultiPointIsNotWithinPolygon.geojson new file mode 100644 index 00000000..81743c73 --- /dev/null +++ b/test/examples/booleans/within/false/MultiPoint/Polygon/MultiPointIsNotWithinPolygon.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12], + [15, 15] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/Point/LineString/PointIsNotWithinLine.geojson b/test/examples/booleans/within/false/Point/LineString/PointIsNotWithinLine.geojson new file mode 100644 index 00000000..e7595525 --- /dev/null +++ b/test/examples/booleans/within/false/Point/LineString/PointIsNotWithinLine.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [2, 2] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/Point/LineString/PointIsNotWithinLineBecauseOnEnd.geojson b/test/examples/booleans/within/false/Point/LineString/PointIsNotWithinLineBecauseOnEnd.geojson new file mode 100644 index 00000000..b30df470 --- /dev/null +++ b/test/examples/booleans/within/false/Point/LineString/PointIsNotWithinLineBecauseOnEnd.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 4] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/Point/LineString/PointOnEndIsWithinLinestring.geojson b/test/examples/booleans/within/false/Point/LineString/PointOnEndIsWithinLinestring.geojson new file mode 100644 index 00000000..b84728a8 --- /dev/null +++ b/test/examples/booleans/within/false/Point/LineString/PointOnEndIsWithinLinestring.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/Point/MultiPoint/PointIsNotWithinMultiPoint.geojson b/test/examples/booleans/within/false/Point/MultiPoint/PointIsNotWithinMultiPoint.geojson new file mode 100644 index 00000000..ad262c65 --- /dev/null +++ b/test/examples/booleans/within/false/Point/MultiPoint/PointIsNotWithinMultiPoint.geojson @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 4] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/Point/MultiPolygon/point-not-within-multipolygon.geojson b/test/examples/booleans/within/false/Point/MultiPolygon/point-not-within-multipolygon.geojson new file mode 100644 index 00000000..30c016b8 --- /dev/null +++ b/test/examples/booleans/within/false/Point/MultiPolygon/point-not-within-multipolygon.geojson @@ -0,0 +1,40 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [14, 14] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/Point/Polygon/PointIsNotWithinPolygon.geojson b/test/examples/booleans/within/false/Point/Polygon/PointIsNotWithinPolygon.geojson new file mode 100644 index 00000000..3bc20282 --- /dev/null +++ b/test/examples/booleans/within/false/Point/Polygon/PointIsNotWithinPolygon.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [14, 14] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/Point/Polygon/PointOnPolygonBoundary.geojson b/test/examples/booleans/within/false/Point/Polygon/PointOnPolygonBoundary.geojson new file mode 100644 index 00000000..d24f78bd --- /dev/null +++ b/test/examples/booleans/within/false/Point/Polygon/PointOnPolygonBoundary.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/Polygon/MultiPolygon/polygon-not-within-multipolygon.geojson b/test/examples/booleans/within/false/Polygon/MultiPolygon/polygon-not-within-multipolygon.geojson new file mode 100644 index 00000000..fb07e048 --- /dev/null +++ b/test/examples/booleans/within/false/Polygon/MultiPolygon/polygon-not-within-multipolygon.geojson @@ -0,0 +1,48 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-12, -12], + [-12, -19], + [-19, -19], + [-19, -12], + [-12, -12] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/false/Polygon/Polygon/Polygon-Polygon.geojson b/test/examples/booleans/within/false/Polygon/Polygon/Polygon-Polygon.geojson new file mode 100644 index 00000000..5a1b4256 --- /dev/null +++ b/test/examples/booleans/within/false/Polygon/Polygon/Polygon-Polygon.geojson @@ -0,0 +1,37 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 20], + [1, 3], + [1, 4], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/LineString/LineString/LineIsWithinLine.geojson b/test/examples/booleans/within/true/LineString/LineString/LineIsWithinLine.geojson new file mode 100644 index 00000000..dcf5cb15 --- /dev/null +++ b/test/examples/booleans/within/true/LineString/LineString/LineIsWithinLine.geojson @@ -0,0 +1,30 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 2], + [1, 3], + [1, 3.5] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/LineString/LineString/LinesExactSame.geojson b/test/examples/booleans/within/true/LineString/LineString/LinesExactSame.geojson new file mode 100644 index 00000000..034737ba --- /dev/null +++ b/test/examples/booleans/within/true/LineString/LineString/LinesExactSame.geojson @@ -0,0 +1,31 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/LineString/Polygon/LineIsContainedByPolygon.geojson b/test/examples/booleans/within/true/LineString/Polygon/LineIsContainedByPolygon.geojson new file mode 100644 index 00000000..eba012ac --- /dev/null +++ b/test/examples/booleans/within/true/LineString/Polygon/LineIsContainedByPolygon.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [2, 3], + [2, 3.5] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/LineString/Polygon/LineIsContainedByPolygonWithNoInternalVertices.geojson b/test/examples/booleans/within/true/LineString/Polygon/LineIsContainedByPolygonWithNoInternalVertices.geojson new file mode 100644 index 00000000..4d4f566f --- /dev/null +++ b/test/examples/booleans/within/true/LineString/Polygon/LineIsContainedByPolygonWithNoInternalVertices.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [10, 10] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/MultiLineString/MultiPolygon/skip-multilinestring-within-multipolygon.geojson b/test/examples/booleans/within/true/MultiLineString/MultiPolygon/skip-multilinestring-within-multipolygon.geojson new file mode 100644 index 00000000..1def29af --- /dev/null +++ b/test/examples/booleans/within/true/MultiLineString/MultiPolygon/skip-multilinestring-within-multipolygon.geojson @@ -0,0 +1,49 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [4, 4], + [1, 1] + ], + [ + [-4, -4], + [-1, -1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/MultiPoint/LineString/MultipointsIsWithinLine.geojson b/test/examples/booleans/within/true/MultiPoint/LineString/MultipointsIsWithinLine.geojson new file mode 100644 index 00000000..cdf0856c --- /dev/null +++ b/test/examples/booleans/within/true/MultiPoint/LineString/MultipointsIsWithinLine.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [1, 1.5] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/MultiPoint/MultiPoint/MultiPointsWithinMultiPoints.geojson b/test/examples/booleans/within/true/MultiPoint/MultiPoint/MultiPointsWithinMultiPoints.geojson new file mode 100644 index 00000000..8a0585fe --- /dev/null +++ b/test/examples/booleans/within/true/MultiPoint/MultiPoint/MultiPointsWithinMultiPoints.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12], + [15, 15] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12], + [15, 15] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/MultiPoint/MultiPolygon/multipoint-within-multipolygon.geojson b/test/examples/booleans/within/true/MultiPoint/MultiPolygon/multipoint-within-multipolygon.geojson new file mode 100644 index 00000000..9d78da41 --- /dev/null +++ b/test/examples/booleans/within/true/MultiPoint/MultiPolygon/multipoint-within-multipolygon.geojson @@ -0,0 +1,43 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [4, 4], + [-4, -4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/MultiPoint/Polygon/MultiPointIsWithinPolygon.geojson b/test/examples/booleans/within/true/MultiPoint/Polygon/MultiPointIsWithinPolygon.geojson new file mode 100644 index 00000000..81f544da --- /dev/null +++ b/test/examples/booleans/within/true/MultiPoint/Polygon/MultiPointIsWithinPolygon.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [4, 4] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/MultiPoint/Polygon/MultiPointSingleIsWithinPolygon.geojson b/test/examples/booleans/within/true/MultiPoint/Polygon/MultiPointSingleIsWithinPolygon.geojson new file mode 100644 index 00000000..f4645c5f --- /dev/null +++ b/test/examples/booleans/within/true/MultiPoint/Polygon/MultiPointSingleIsWithinPolygon.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [[2, 2]] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/MultiPolygon/MultiPolygon/skip-multipolygon-within-multipolygon.geojson b/test/examples/booleans/within/true/MultiPolygon/MultiPolygon/skip-multipolygon-within-multipolygon.geojson new file mode 100644 index 00000000..85aa17cf --- /dev/null +++ b/test/examples/booleans/within/true/MultiPolygon/MultiPolygon/skip-multipolygon-within-multipolygon.geojson @@ -0,0 +1,59 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [2, 2], + [2, 9], + [9, 9], + [9, 2], + [2, 2] + ] + ], + [ + [ + [-2, -2], + [-2, -9], + [-9, -9], + [-9, -2], + [-2, -2] + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/Point/LineString/PointIsWithinLine.geojson b/test/examples/booleans/within/true/Point/LineString/PointIsWithinLine.geojson new file mode 100644 index 00000000..8cb3cc42 --- /dev/null +++ b/test/examples/booleans/within/true/Point/LineString/PointIsWithinLine.geojson @@ -0,0 +1,26 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 2] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/Point/MultiPoint/PointIsWithinMultiPoint.geojson b/test/examples/booleans/within/true/Point/MultiPoint/PointIsWithinMultiPoint.geojson new file mode 100644 index 00000000..f958a470 --- /dev/null +++ b/test/examples/booleans/within/true/Point/MultiPoint/PointIsWithinMultiPoint.geojson @@ -0,0 +1,24 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [1, 1] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [1, 1], + [12, 12] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/Point/MultiPolygon/point-within-multipolygon.geojson b/test/examples/booleans/within/true/Point/MultiPolygon/point-within-multipolygon.geojson new file mode 100644 index 00000000..84d378bc --- /dev/null +++ b/test/examples/booleans/within/true/Point/MultiPolygon/point-within-multipolygon.geojson @@ -0,0 +1,40 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-4, -4] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/Point/Polygon/PointIsWithinPolygon.geojson b/test/examples/booleans/within/true/Point/Polygon/PointIsWithinPolygon.geojson new file mode 100644 index 00000000..8e3ea36f --- /dev/null +++ b/test/examples/booleans/within/true/Point/Polygon/PointIsWithinPolygon.geojson @@ -0,0 +1,29 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [4, 4] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/Polygon/MultiPolygon/polygon-within-multipolygon.geojson b/test/examples/booleans/within/true/Polygon/MultiPolygon/polygon-within-multipolygon.geojson new file mode 100644 index 00000000..2819e2ba --- /dev/null +++ b/test/examples/booleans/within/true/Polygon/MultiPolygon/polygon-within-multipolygon.geojson @@ -0,0 +1,48 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-2, -2], + [-2, -9], + [-9, -9], + [-9, -2], + [-2, -2] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ], + [ + [ + [-1, -1], + [-1, -10], + [-10, -10], + [-10, -1], + [-1, -1] + ] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/Polygon/Polygon/PolygonIsWIthinPolygon.geojson b/test/examples/booleans/within/true/Polygon/Polygon/PolygonIsWIthinPolygon.geojson new file mode 100644 index 00000000..65d65259 --- /dev/null +++ b/test/examples/booleans/within/true/Polygon/Polygon/PolygonIsWIthinPolygon.geojson @@ -0,0 +1,36 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [2, 2], + [3, 2], + [1, 1] + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [1, 1], + [1, 10], + [10, 10], + [10, 1], + [1, 1] + ] + ] + } + } + ] +} diff --git a/test/examples/booleans/within/true/Polygon/Polygon/PolygonsExactSameShape.geojson b/test/examples/booleans/within/true/Polygon/Polygon/PolygonsExactSameShape.geojson new file mode 100644 index 00000000..8bfd83da --- /dev/null +++ b/test/examples/booleans/within/true/Polygon/Polygon/PolygonsExactSameShape.geojson @@ -0,0 +1,41 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "fill": "#F00" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-12.65625, 36.87962060502676], + [35.419921875, 36.38591277287651], + [37.79296875, 56.897003921272606], + [-12.12890625, 57.040729838360875], + [-12.65625, 36.87962060502676] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "fill": "#F00" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-12.65625, 36.87962060502676], + [35.419921875, 36.38591277287651], + [37.79296875, 56.897003921272606], + [-12.12890625, 57.040729838360875], + [-12.65625, 36.87962060502676] + ] + ] + } + } + ] +} diff --git a/test/examples/line_intersect/in/2-vertex-segment.geojson b/test/examples/line_intersect/in/2-vertex-segment.geojson new file mode 100644 index 00000000..f4ed4718 --- /dev/null +++ b/test/examples/line_intersect/in/2-vertex-segment.geojson @@ -0,0 +1,33 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [124.584961, -12.768946], + [126.738281, -17.224758] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [123.354492, -15.961329], + [127.22168, -14.008696] + ] + } + } + ] +} diff --git a/test/examples/line_intersect/in/double-intersect.geojson b/test/examples/line_intersect/in/double-intersect.geojson new file mode 100644 index 00000000..f699b49e --- /dev/null +++ b/test/examples/line_intersect/in/double-intersect.geojson @@ -0,0 +1,44 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [142.03125, -11.695273], + [138.691406, -16.804541], + [136.40625, -14.604847], + [135.966797, -12.039321], + [131.308594, -11.436955], + [128.232422, -15.36895], + [125.947266, -13.581921], + [121.816406, -18.729502], + [117.421875, -20.632784], + [113.378906, -23.402765], + [114.169922, -26.667096] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [117.861328, -15.029686], + [122.124023, -24.886436], + [132.583008, -22.309426], + [132.890625, -7.754537] + ] + } + } + ] +} diff --git a/test/examples/line_intersect/in/multi-linestring.geojson b/test/examples/line_intersect/in/multi-linestring.geojson new file mode 100644 index 00000000..4474df85 --- /dev/null +++ b/test/examples/line_intersect/in/multi-linestring.geojson @@ -0,0 +1,74 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 6 + }, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [142.03125, -11.695273], + [138.691406, -16.804541], + [136.40625, -14.604847], + [135.966797, -12.039321], + [131.308594, -11.436955], + [128.232422, -15.36895], + [125.947266, -13.581921], + [121.816406, -18.729502], + [117.421875, -20.632784], + [113.378906, -23.402765], + [114.169922, -26.667096] + ], + [ + [117.290039, -27.994401], + [118.87207, -25.165173], + [121.508789, -24.407138], + [122.783203, -19.228177], + [125.683594, -18.771115], + [130.78125, -21.534847], + [133.417969, -17.602139], + [137.768555, -19.55979], + [139.658203, -18.39623] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 6 + }, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [117.861328, -15.029686], + [122.124023, -24.886436], + [132.583008, -22.309426], + [132.890625, -7.754537] + ], + [ + [115.751953, -17.014768], + [118.652344, -26.037042], + [118.344727, -28.343065], + [125.068359, -28.652031], + [125.771484, -26.627818], + [131.572266, -26.509905], + [136.40625, -24.886436], + [136.186523, -22.105999], + [134.956055, -20.591652], + [135.439453, -16.214675], + [136.713867, -15.114553], + [134.912109, -11.738302], + [135, -10.141932] + ] + ] + } + } + ] +} diff --git a/test/examples/line_intersect/in/polygons-with-holes.geojson b/test/examples/line_intersect/in/polygons-with-holes.geojson new file mode 100644 index 00000000..8b6163c8 --- /dev/null +++ b/test/examples/line_intersect/in/polygons-with-holes.geojson @@ -0,0 +1,107 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 6 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [127.397461, -14.221789], + [119.399414, -18.729502], + [114.741211, -21.289374], + [113.554688, -24.487149], + [114.213867, -28.304381], + [116.235352, -30.977609], + [115.532227, -33.468108], + [116.191406, -34.633208], + [120.629883, -33.541395], + [124.541016, -33.247876], + [128.62793, -32.10119], + [129.726563, -31.765537], + [129.726563, -28.806174], + [128.276367, -28.497661], + [125.727539, -28.459033], + [122.695313, -30.372875], + [120.410156, -30.562261], + [118.476562, -28.998532], + [118.608398, -27.527758], + [123.925781, -27.019984], + [126.5625, -26.549223], + [130.166016, -25.76032], + [130.166016, -23.644524], + [127.617187, -22.917923], + [123.837891, -24.567108], + [119.267578, -24.567108], + [118.564453, -23.281719], + [119.838867, -21.330315], + [123.706055, -21.493964], + [127.089844, -21.0845], + [128.232422, -19.103648], + [127.749023, -17.895114], + [130.297852, -17.182779], + [129.858398, -15.538376], + [129.023438, -14.179186], + [127.397461, -14.221789] + ], + [ + [122.958984, -19.890723], + [125.068359, -19.890723], + [125.068359, -18.187607], + [122.958984, -18.187607], + [122.958984, -19.890723] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 6 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [120.849609, -14.85985], + [117.070313, -15.496032], + [117.026367, -17.769612], + [119.663086, -20.468189], + [121.157227, -23.039298], + [120.058594, -24.647017], + [118.344727, -26.076521], + [120.410156, -28.343065], + [120.146484, -30.939924], + [118.256836, -33.027088], + [123.925781, -34.885931], + [126.123047, -33.687782], + [125.947266, -31.840233], + [124.057617, -28.536275], + [122.080078, -26.273714], + [123.442383, -23.885838], + [125.200195, -22.796439], + [124.277344, -19.47695], + [120.849609, -14.85985] + ], + [ + [121.157227, -27.371767], + [121.157227, -29.42046], + [121.025391, -31.952162], + [120.893555, -33.027088], + [123.662109, -33.870416], + [124.584961, -33.431441], + [124.541016, -31.128199], + [122.827148, -29.382175], + [122.124023, -27.916767], + [121.157227, -27.371767] + ] + ] + } + } + ] +} diff --git a/test/examples/line_intersect/in/same-coordinates.geojson b/test/examples/line_intersect/in/same-coordinates.geojson new file mode 100644 index 00000000..efb0b995 --- /dev/null +++ b/test/examples/line_intersect/in/same-coordinates.geojson @@ -0,0 +1,39 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [120, -20], + [122.5, -16], + [125, -15], + [127.5, -16], + [130, -20] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [120, -20], + [122.5, -24], + [125, -25], + [127.5, -24], + [130, -20] + ] + } + } + ] +} diff --git a/test/examples/line_intersect/out/2-vertex-segment.geojson b/test/examples/line_intersect/out/2-vertex-segment.geojson new file mode 100644 index 00000000..33f7eedf --- /dev/null +++ b/test/examples/line_intersect/out/2-vertex-segment.geojson @@ -0,0 +1,41 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [125.583754, -14.835723] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [124.584961, -12.768946], + [126.738281, -17.224758] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [123.354492, -15.961329], + [127.22168, -14.008696] + ] + } + } + ] +} diff --git a/test/examples/line_intersect/out/double-intersect.geojson b/test/examples/line_intersect/out/double-intersect.geojson new file mode 100644 index 00000000..52acde8e --- /dev/null +++ b/test/examples/line_intersect/out/double-intersect.geojson @@ -0,0 +1,60 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [119.832884, -19.58857] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [132.808697, -11.630938] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [142.03125, -11.695273], + [138.691406, -16.804541], + [136.40625, -14.604847], + [135.966797, -12.039321], + [131.308594, -11.436955], + [128.232422, -15.36895], + [125.947266, -13.581921], + [121.816406, -18.729502], + [117.421875, -20.632784], + [113.378906, -23.402765], + [114.169922, -26.667096] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [117.861328, -15.029686], + [122.124023, -24.886436], + [132.583008, -22.309426], + [132.890625, -7.754537] + ] + } + } + ] +} diff --git a/test/examples/line_intersect/out/multi-linestring.geojson b/test/examples/line_intersect/out/multi-linestring.geojson new file mode 100644 index 00000000..5a52196c --- /dev/null +++ b/test/examples/line_intersect/out/multi-linestring.geojson @@ -0,0 +1,154 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [117.006519, -20.917359] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [118.554586, -25.732946] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [119.832884, -19.58857] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [121.656735, -23.805914] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [132.658557, -18.734814] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [132.808697, -11.630938] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [135.006479, -11.91514] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [135.197772, -18.403004] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [136.389417, -14.506578] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [136.479474, -14.675333] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 6 + }, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [142.03125, -11.695273], + [138.691406, -16.804541], + [136.40625, -14.604847], + [135.966797, -12.039321], + [131.308594, -11.436955], + [128.232422, -15.36895], + [125.947266, -13.581921], + [121.816406, -18.729502], + [117.421875, -20.632784], + [113.378906, -23.402765], + [114.169922, -26.667096] + ], + [ + [117.290039, -27.994401], + [118.87207, -25.165173], + [121.508789, -24.407138], + [122.783203, -19.228177], + [125.683594, -18.771115], + [130.78125, -21.534847], + [133.417969, -17.602139], + [137.768555, -19.55979], + [139.658203, -18.39623] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 6 + }, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [117.861328, -15.029686], + [122.124023, -24.886436], + [132.583008, -22.309426], + [132.890625, -7.754537] + ], + [ + [115.751953, -17.014768], + [118.652344, -26.037042], + [118.344727, -28.343065], + [125.068359, -28.652031], + [125.771484, -26.627818], + [131.572266, -26.509905], + [136.40625, -24.886436], + [136.186523, -22.105999], + [134.956055, -20.591652], + [135.439453, -16.214675], + [136.713867, -15.114553], + [134.912109, -11.738302], + [135, -10.141932] + ] + ] + } + } + ] +} diff --git a/test/examples/line_intersect/out/polygons-with-holes.geojson b/test/examples/line_intersect/out/polygons-with-holes.geojson new file mode 100644 index 00000000..a39d1b36 --- /dev/null +++ b/test/examples/line_intersect/out/polygons-with-holes.geojson @@ -0,0 +1,251 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [118.465639, -19.242649] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [120.170188, -33.654475] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [119.582432, -27.434744] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [120.17229, -21.344425] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [120.1132, -24.567108] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [120.201928, -30.393864] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [122.447193, -17.011768] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [122.196098, -33.423855] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [121.100749, -30.505027] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [122.824274, -27.12517] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [123.053712, -24.567108] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [123.377165, -29.942512] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [123.320136, -18.187607] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [124.468085, -29.253959] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [124.392377, -19.890723] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [124.80125, -21.361437] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [124.581243, -33.236589] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [126.041148, -32.826977] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 6 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [127.397461, -14.221789], + [119.399414, -18.729502], + [114.741211, -21.289374], + [113.554688, -24.487149], + [114.213867, -28.304381], + [116.235352, -30.977609], + [115.532227, -33.468108], + [116.191406, -34.633208], + [120.629883, -33.541395], + [124.541016, -33.247876], + [128.62793, -32.10119], + [129.726563, -31.765537], + [129.726563, -28.806174], + [128.276367, -28.497661], + [125.727539, -28.459033], + [122.695313, -30.372875], + [120.410156, -30.562261], + [118.476562, -28.998532], + [118.608398, -27.527758], + [123.925781, -27.019984], + [126.5625, -26.549223], + [130.166016, -25.76032], + [130.166016, -23.644524], + [127.617187, -22.917923], + [123.837891, -24.567108], + [119.267578, -24.567108], + [118.564453, -23.281719], + [119.838867, -21.330315], + [123.706055, -21.493964], + [127.089844, -21.0845], + [128.232422, -19.103648], + [127.749023, -17.895114], + [130.297852, -17.182779], + [129.858398, -15.538376], + [129.023438, -14.179186], + [127.397461, -14.221789] + ], + [ + [122.958984, -19.890723], + [125.068359, -19.890723], + [125.068359, -18.187607], + [122.958984, -18.187607], + [122.958984, -19.890723] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 6 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [120.849609, -14.85985], + [117.070313, -15.496032], + [117.026367, -17.769612], + [119.663086, -20.468189], + [121.157227, -23.039298], + [120.058594, -24.647017], + [118.344727, -26.076521], + [120.410156, -28.343065], + [120.146484, -30.939924], + [118.256836, -33.027088], + [123.925781, -34.885931], + [126.123047, -33.687782], + [125.947266, -31.840233], + [124.057617, -28.536275], + [122.080078, -26.273714], + [123.442383, -23.885838], + [125.200195, -22.796439], + [124.277344, -19.47695], + [120.849609, -14.85985] + ], + [ + [121.157227, -27.371767], + [121.157227, -29.42046], + [121.025391, -31.952162], + [120.893555, -33.027088], + [123.662109, -33.870416], + [124.584961, -33.431441], + [124.541016, -31.128199], + [122.827148, -29.382175], + [122.124023, -27.916767], + [121.157227, -27.371767] + ] + ] + } + } + ] +} diff --git a/test/examples/line_intersect/out/same-coordinates.geojson b/test/examples/line_intersect/out/same-coordinates.geojson new file mode 100644 index 00000000..1b69013f --- /dev/null +++ b/test/examples/line_intersect/out/same-coordinates.geojson @@ -0,0 +1,55 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [120, -20] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [130, -20] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [120, -20], + [122.5, -16], + [125, -15], + [127.5, -16], + [130, -20] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [120, -20], + [122.5, -24], + [125, -25], + [127.5, -24], + [130, -20] + ] + } + } + ] +} diff --git a/test/examples/line_overlap/in/boolean-line-overlap.geojson b/test/examples/line_overlap/in/boolean-line-overlap.geojson new file mode 100644 index 00000000..c3414c3c --- /dev/null +++ b/test/examples/line_overlap/in/boolean-line-overlap.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-22.564544677734375, 46.25917013377904], + [-22.559051513671875, 46.32369743336783], + [-22.446441650390625, 46.352141192009334], + [-22.361297607421875, 46.32891323009468], + [-22.361297607421875, 46.30472670751783] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-22.570724487304688, 46.36398839132818], + [-22.444381713867188, 46.357354276167015], + [-22.391510009765625, 46.3291502999477], + [-22.29263305664062, 46.382464893261165] + ] + } + } + ] +} diff --git a/test/examples/line_overlap/in/issue-#901-simplified.geojson b/test/examples/line_overlap/in/issue-#901-simplified.geojson new file mode 100644 index 00000000..435be36e --- /dev/null +++ b/test/examples/line_overlap/in/issue-#901-simplified.geojson @@ -0,0 +1,35 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 10, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [2, 2], + [4, 4] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 3, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [6, 6] + ] + } + } + ] +} diff --git a/test/examples/line_overlap/in/issue-#901.geojson b/test/examples/line_overlap/in/issue-#901.geojson new file mode 100644 index 00000000..b897d69b --- /dev/null +++ b/test/examples/line_overlap/in/issue-#901.geojson @@ -0,0 +1,77 @@ +{ + "type": "FeatureCollection", + "properties": { + "tolerance": 0.05 + }, + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "fill": "#F00", + "stroke-width": 10, + "stroke-opacity": 1, + "fill-opacity": 0.1, + "description": "output of an intersect call with a longer pipe and the other feature in this file" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-113.33847575084239, 53.52244416392682], + [-113.33847394, 53.52299533509864], + [-113.338470971, 53.52389165109878], + [-113.338468309, 53.52469456909876], + [-113.338467951, 53.5248023990988], + [-113.338462214, 53.52653346709882], + [-113.3384620759999, 53.52657586409872], + [-113.3384619429999, 53.52661770709869], + [-113.3384532659999, 53.52935323209886], + [-113.338452983, 53.52944258409877], + [-113.338452982, 53.52944333909876], + [-113.3384522719999, 53.52962258909884], + [-113.338449392, 53.53035074809878], + [-113.33704111881613, 53.53215959791441], + [-113.33698987543352, 53.53214475018778], + [-113.33690471442213, 53.53212132654082], + [-113.3382987129999, 53.53033083009888], + [-113.3383022259999, 53.52944312809881], + [-113.3383113299999, 53.52657569409888], + [-113.3383232079999, 53.52299515809875], + [-113.33832502043951, 53.52244398828247], + [-113.3384152645109, 53.52244409344282], + [-113.33847575084239, 53.52244416392682] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "fill": "#00F", + "stroke-width": 3, + "stroke-opacity": 1, + "fill-opacity": 0.1, + "description": "shape which was intersected with a longer pipe to produce the pipe shown" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-113.34145274487872, 53.53230853007057], + [-113.33797676517321, 53.53243070065233], + [-113.33698987543352, 53.53214475018778], + [-113.33287043896553, 53.53101169382826], + [-113.33387712516304, 53.522438805202505], + [-113.3384152645109, 53.52244409344282], + [-113.3429534044069, 53.522449381683145], + [-113.34145274487872, 53.53230853007057], + [-113.34145274487872, 53.53230853007057], + [-113.34145274487872, 53.53230853007057] + ] + ] + } + } + ] +} diff --git a/test/examples/line_overlap/in/polygons.geojson b/test/examples/line_overlap/in/polygons.geojson new file mode 100644 index 00000000..fc443e3d --- /dev/null +++ b/test/examples/line_overlap/in/polygons.geojson @@ -0,0 +1,65 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "fill": "#F00", + "stroke-width": 10, + "stroke-opacity": 1, + "fill-opacity": 0.1 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [120.14179343574, -17.48153498141], + [120.1456007834, -30.96997373479], + [130.34864729879, -30.96772909058], + [131.64065935144, -29.20137372199], + [129.5926694017, -28.04905296815], + [130.34739288016, -26.68605235913], + [125.76890918238, -26.68710193815], + [125.76762773192, -22.1408865296], + [130.52038135971, -22.13975701932], + [131.37809653737, -20.30857774535], + [129.67954157692, -18.92360398694], + [130.51910988115, -17.47899540098], + [120.14179343574, -17.48153498141] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "fill": "#00F", + "stroke-width": 3, + "stroke-opacity": 1, + "fill-opacity": 0.1 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [139.69468150776, -17.47674988707], + [130.51910988115, -17.47899540098], + [129.67954157692, -18.92360398694], + [131.37809653737, -20.30857774535], + [130.52038135971, -22.13975701932], + [135.29428724786, -22.138622473], + [135.29556869831, -26.68491802042], + [130.34739288016, -26.68605235913], + [129.5926694017, -28.04905296815], + [131.64065935144, -29.20137372199], + [130.34864729879, -30.96772909058], + [139.69848885541, -30.96567210295], + [139.69468150776, -17.47674988707] + ] + ] + } + } + ] +} diff --git a/test/examples/line_overlap/in/simple1.geojson b/test/examples/line_overlap/in/simple1.geojson new file mode 100644 index 00000000..77f9e48a --- /dev/null +++ b/test/examples/line_overlap/in/simple1.geojson @@ -0,0 +1,40 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 10, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [115, -35], + [125, -30], + [135, -30], + [145, -35] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 3, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [115, -25], + [125, -30], + [135, -30], + [145, -35], + [145, -25] + ] + } + } + ] +} diff --git a/test/examples/line_overlap/in/simple2.geojson b/test/examples/line_overlap/in/simple2.geojson new file mode 100644 index 00000000..a283beac --- /dev/null +++ b/test/examples/line_overlap/in/simple2.geojson @@ -0,0 +1,39 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 10, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [115, -35], + [125, -30], + [135, -30], + [145, -35] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 3, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [115, -25], + [125, -30], + [135, -30], + [145, -35] + ] + } + } + ] +} diff --git a/test/examples/line_overlap/in/simple3.geojson b/test/examples/line_overlap/in/simple3.geojson new file mode 100644 index 00000000..aa813d2b --- /dev/null +++ b/test/examples/line_overlap/in/simple3.geojson @@ -0,0 +1,38 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#ff0000", + "stroke-width": 10, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [125, -30], + [135, -30], + [145, -35] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 3, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [125, -30], + [135, -30], + [145, -35], + [145, -25] + ] + } + } + ] +} diff --git a/test/examples/line_overlap/out/boolean-line-overlap.geojson b/test/examples/line_overlap/out/boolean-line-overlap.geojson new file mode 100644 index 00000000..c3414c3c --- /dev/null +++ b/test/examples/line_overlap/out/boolean-line-overlap.geojson @@ -0,0 +1,32 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-22.564544677734375, 46.25917013377904], + [-22.559051513671875, 46.32369743336783], + [-22.446441650390625, 46.352141192009334], + [-22.361297607421875, 46.32891323009468], + [-22.361297607421875, 46.30472670751783] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-22.570724487304688, 46.36398839132818], + [-22.444381713867188, 46.357354276167015], + [-22.391510009765625, 46.3291502999477], + [-22.29263305664062, 46.382464893261165] + ] + } + } + ] +} diff --git a/test/examples/line_overlap/out/issue-#901-simplified.geojson b/test/examples/line_overlap/out/issue-#901-simplified.geojson new file mode 100644 index 00000000..988780fd --- /dev/null +++ b/test/examples/line_overlap/out/issue-#901-simplified.geojson @@ -0,0 +1,52 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#0F0", + "fill": "#0F0", + "stroke-width": 25 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [2, 2], + [4, 4] + ] + }, + "bbox": [2, 2, 4, 4], + "id": 0 + }, + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 10, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [2, 2], + [4, 4] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 3, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [0, 0], + [6, 6] + ] + } + } + ] +} diff --git a/test/examples/line_overlap/out/issue-#901.geojson b/test/examples/line_overlap/out/issue-#901.geojson new file mode 100644 index 00000000..09d13e5e --- /dev/null +++ b/test/examples/line_overlap/out/issue-#901.geojson @@ -0,0 +1,170 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#0F0", + "fill": "#0F0", + "stroke-width": 25 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [-113.33698987543352, 53.53214475018778], + [-113.33690471442213, 53.53212132654082], + [-113.33698987543352, 53.53214475018778], + [-113.33704111881613, 53.53215959791441] + ] + }, + "bbox": [ + -113.33704111881613, + 53.53214475018778, + -113.33698987543352, + 53.53215959791441 + ], + "id": 13 + }, + { + "type": "Feature", + "properties": { + "stroke": "#0F0", + "fill": "#0F0", + "stroke-width": 25 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [-113.33698987543352, 53.53214475018778], + [-113.33690471442213, 53.53212132654082], + [-113.33698987543352, 53.53214475018778], + [-113.33704111881613, 53.53215959791441] + ] + }, + "bbox": [ + -113.33704111881613, + 53.53214475018778, + -113.33698987543352, + 53.53215959791441 + ], + "id": 13 + }, + { + "type": "Feature", + "properties": { + "stroke": "#0F0", + "fill": "#0F0", + "stroke-width": 25 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [-113.33832502043951, 53.52244398828247], + [-113.3384152645109, 53.52244409344282], + [-113.33847575084239, 53.52244416392682], + [-113.3384152645109, 53.52244409344282] + ] + }, + "bbox": [ + -113.3384152645109, + 53.52244398828247, + -113.33832502043951, + 53.52244409344282 + ], + "id": 20 + }, + { + "type": "Feature", + "properties": { + "stroke": "#0F0", + "fill": "#0F0", + "stroke-width": 25 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [-113.33832502043951, 53.52244398828247], + [-113.3384152645109, 53.52244409344282], + [-113.33847575084239, 53.52244416392682], + [-113.3384152645109, 53.52244409344282] + ] + }, + "bbox": [ + -113.3384152645109, + 53.52244398828247, + -113.33832502043951, + 53.52244409344282 + ], + "id": 20 + }, + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "fill": "#F00", + "stroke-width": 10, + "stroke-opacity": 1, + "fill-opacity": 0.1, + "description": "output of an intersect call with a longer pipe and the other feature in this file" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-113.33847575084239, 53.52244416392682], + [-113.33847394, 53.52299533509864], + [-113.338470971, 53.52389165109878], + [-113.338468309, 53.52469456909876], + [-113.338467951, 53.5248023990988], + [-113.338462214, 53.52653346709882], + [-113.3384620759999, 53.52657586409872], + [-113.3384619429999, 53.52661770709869], + [-113.3384532659999, 53.52935323209886], + [-113.338452983, 53.52944258409877], + [-113.338452982, 53.52944333909876], + [-113.3384522719999, 53.52962258909884], + [-113.338449392, 53.53035074809878], + [-113.33704111881613, 53.53215959791441], + [-113.33698987543352, 53.53214475018778], + [-113.33690471442213, 53.53212132654082], + [-113.3382987129999, 53.53033083009888], + [-113.3383022259999, 53.52944312809881], + [-113.3383113299999, 53.52657569409888], + [-113.3383232079999, 53.52299515809875], + [-113.33832502043951, 53.52244398828247], + [-113.3384152645109, 53.52244409344282], + [-113.33847575084239, 53.52244416392682] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "fill": "#00F", + "stroke-width": 3, + "stroke-opacity": 1, + "fill-opacity": 0.1, + "description": "shape which was intersected with a longer pipe to produce the pipe shown" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [-113.34145274487872, 53.53230853007057], + [-113.33797676517321, 53.53243070065233], + [-113.33698987543352, 53.53214475018778], + [-113.33287043896553, 53.53101169382826], + [-113.33387712516304, 53.522438805202505], + [-113.3384152645109, 53.52244409344282], + [-113.3429534044069, 53.522449381683145], + [-113.34145274487872, 53.53230853007057], + [-113.34145274487872, 53.53230853007057], + [-113.34145274487872, 53.53230853007057] + ] + ] + } + } + ] +} diff --git a/test/examples/line_overlap/out/polygons.geojson b/test/examples/line_overlap/out/polygons.geojson new file mode 100644 index 00000000..d2ab42eb --- /dev/null +++ b/test/examples/line_overlap/out/polygons.geojson @@ -0,0 +1,99 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#0F0", + "fill": "#0F0", + "stroke-width": 25 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [130.52038135971, -22.13975701932], + [131.37809653737, -20.30857774535], + [129.67954157692, -18.92360398694], + [130.51910988115, -17.47899540098] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#0F0", + "fill": "#0F0", + "stroke-width": 25 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [130.34864729879, -30.96772909058], + [131.64065935144, -29.20137372199], + [129.5926694017, -28.04905296815], + [130.34739288016, -26.68605235913] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "fill": "#F00", + "stroke-width": 10, + "stroke-opacity": 1, + "fill-opacity": 0.1 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [120.14179343574, -17.48153498141], + [120.1456007834, -30.96997373479], + [130.34864729879, -30.96772909058], + [131.64065935144, -29.20137372199], + [129.5926694017, -28.04905296815], + [130.34739288016, -26.68605235913], + [125.76890918238, -26.68710193815], + [125.76762773192, -22.1408865296], + [130.52038135971, -22.13975701932], + [131.37809653737, -20.30857774535], + [129.67954157692, -18.92360398694], + [130.51910988115, -17.47899540098], + [120.14179343574, -17.48153498141] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "fill": "#00F", + "stroke-width": 3, + "stroke-opacity": 1, + "fill-opacity": 0.1 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [139.69468150776, -17.47674988707], + [130.51910988115, -17.47899540098], + [129.67954157692, -18.92360398694], + [131.37809653737, -20.30857774535], + [130.52038135971, -22.13975701932], + [135.29428724786, -22.138622473], + [135.29556869831, -26.68491802042], + [130.34739288016, -26.68605235913], + [129.5926694017, -28.04905296815], + [131.64065935144, -29.20137372199], + [130.34864729879, -30.96772909058], + [139.69848885541, -30.96567210295], + [139.69468150776, -17.47674988707] + ] + ] + } + } + ] +} diff --git a/test/examples/line_overlap/out/simple1.geojson b/test/examples/line_overlap/out/simple1.geojson new file mode 100644 index 00000000..b7da65c7 --- /dev/null +++ b/test/examples/line_overlap/out/simple1.geojson @@ -0,0 +1,56 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#0F0", + "fill": "#0F0", + "stroke-width": 25 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [125, -30], + [135, -30], + [145, -35] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 10, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [115, -35], + [125, -30], + [135, -30], + [145, -35] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 3, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [115, -25], + [125, -30], + [135, -30], + [145, -35], + [145, -25] + ] + } + } + ] +} diff --git a/test/examples/line_overlap/out/simple2.geojson b/test/examples/line_overlap/out/simple2.geojson new file mode 100644 index 00000000..c9d5f41b --- /dev/null +++ b/test/examples/line_overlap/out/simple2.geojson @@ -0,0 +1,55 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#0F0", + "fill": "#0F0", + "stroke-width": 25 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [125, -30], + [135, -30], + [145, -35] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 10, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [115, -35], + [125, -30], + [135, -30], + [145, -35] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 3, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [115, -25], + [125, -30], + [135, -30], + [145, -35] + ] + } + } + ] +} diff --git a/test/examples/line_overlap/out/simple3.geojson b/test/examples/line_overlap/out/simple3.geojson new file mode 100644 index 00000000..dc0d6737 --- /dev/null +++ b/test/examples/line_overlap/out/simple3.geojson @@ -0,0 +1,54 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "stroke": "#0F0", + "fill": "#0F0", + "stroke-width": 25 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [125, -30], + [135, -30], + [145, -35] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#ff0000", + "stroke-width": 10, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [125, -30], + [135, -30], + [145, -35] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 3, + "stroke-opacity": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [125, -30], + [135, -30], + [145, -35], + [145, -25] + ] + } + } + ] +} diff --git a/test/examples/rhumb_bearing/in/pair1.geojson b/test/examples/rhumb_bearing/in/pair1.geojson index b48344e8..d755b93a 100644 --- a/test/examples/rhumb_bearing/in/pair1.geojson +++ b/test/examples/rhumb_bearing/in/pair1.geojson @@ -1,31 +1,31 @@ { - "type": "FeatureCollection", - "features": [ - { - "type": "Feature", - "properties": { - "marker-color": "#F00" - }, - "geometry": { - "type": "Point", - "coordinates": [ - -75, - 45 - ] - } - }, - { - "type": "Feature", - "properties": { - "marker-color": "#00F" - }, - "geometry": { - "type": "Point", - "coordinates": [ - 20, - 60 - ] - } - } - ] + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "marker-color": "#F00" + }, + "geometry": { + "type": "Point", + "coordinates": [ + -75, + 45 + ] + } + }, + { + "type": "Feature", + "properties": { + "marker-color": "#00F" + }, + "geometry": { + "type": "Point", + "coordinates": [ + 20, + 60 + ] + } + } + ] } \ No newline at end of file diff --git a/test/examples/rhumb_bearing/out/pair1.geojson b/test/examples/rhumb_bearing/out/pair1.geojson index b5ab5e26..97c68508 100644 --- a/test/examples/rhumb_bearing/out/pair1.geojson +++ b/test/examples/rhumb_bearing/out/pair1.geojson @@ -1,71 +1,71 @@ { - "type": "FeatureCollection", - "features": [ - { - "type": "Feature", - "properties": { - "marker-color": "#F00" - }, - "geometry": { - "type": "Point", - "coordinates": [ - -75, - 45 - ] - } - }, - { - "type": "Feature", - "properties": { - "marker-color": "#00F" - }, - "geometry": { - "type": "Point", - "coordinates": [ - 20, - 60 - ] - } - }, - { - "type": "Feature", - "properties": { - "stroke": "#F00", - "stroke-width": 6 - }, - "geometry": { - "type": "LineString", - "coordinates": [ - [ - -75, - 45 - ], - [ - -66.10068737769872, - 51.79325008492101 - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "stroke": "#00F", - "stroke-width": 6 - }, - "geometry": { - "type": "LineString", - "coordinates": [ - [ - 20, - 60 - ], - [ - 2.3844816279733956, - 63.440396381483744 - ] - ] - } - } - ] + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "marker-color": "#F00" + }, + "geometry": { + "type": "Point", + "coordinates": [ + -75, + 45 + ] + } + }, + { + "type": "Feature", + "properties": { + "marker-color": "#00F" + }, + "geometry": { + "type": "Point", + "coordinates": [ + 20, + 60 + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#F00", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -75, + 45 + ], + [ + -66.10068737769872, + 51.79325008492101 + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "stroke": "#00F", + "stroke-width": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + 20, + 60 + ], + [ + 2.3844816279733956, + 63.440396381483744 + ] + ] + } + } + ] } \ No newline at end of file diff --git a/test/examples/rhumb_bearing/out/pair1.json b/test/examples/rhumb_bearing/out/pair1.json index 171e525a..800f3dd1 100644 --- a/test/examples/rhumb_bearing/out/pair1.json +++ b/test/examples/rhumb_bearing/out/pair1.json @@ -1,4 +1,4 @@ { - "initialBearing": 75.28061364784332, - "finalBearing": -104.7193863521567 + "initialBearing": 75.28061364784332, + "finalBearing": -104.7193863521567 } \ No newline at end of file