Skip to content

Commit

Permalink
v0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
w8r committed Aug 13, 2018
1 parent e4ad6d2 commit 5960097
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 14 deletions.
15 changes: 12 additions & 3 deletions demo/js/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -1447,11 +1447,14 @@
* @return {Number}
*/
function nextPos(pos, resultEvents, processed, origIndex) {
var p, p1;
var newPos = pos + 1;
var length = resultEvents.length;
if (newPos > length - 1) { return pos - 1; }
var p = resultEvents[pos].point;
var p1 = resultEvents[newPos].point;

p = resultEvents[pos].point;

if (newPos < length)
{ p1 = resultEvents[newPos].point; }


// while in range and not the current one by value
Expand Down Expand Up @@ -1857,6 +1860,12 @@
case 'fatal2':
file = 'fatal2.geojson';
break;
case 'fatal3':
file = 'fatal3.geojson';
break;
case 'fatal4':
file = 'fatal4.geojson';
break;
case 'rectangles':
file = 'rectangles.geojson';
break;
Expand Down
6 changes: 6 additions & 0 deletions demo/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ switch (mode) {
case 'fatal2':
file = 'fatal2.geojson';
break;
case 'fatal3':
file = 'fatal3.geojson';
break;
case 'fatal4':
file = 'fatal4.geojson';
break;
case 'rectangles':
file = 'rectangles.geojson';
break;
Expand Down
4 changes: 2 additions & 2 deletions dist/martinez.min.js

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions dist/martinez.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/martinez.umd.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "martinez-polygon-clipping",
"version": "0.4.3",
"version": "0.5.0",
"description": "Martinez polygon clipping algorithm, does boolean operation on polygons (multipolygons, polygons with holes etc): intersection, union, difference, xor",
"main": "dist/martinez.umd.js",
"browser": "dist/martinez.umd.js",
Expand Down
7 changes: 7 additions & 0 deletions test/fixtures/fatal3.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [[[180.60987101280907, 22.943242898435663], [280.6098710128091, 22.943242898435663], [280.6098710128091, 62.94324289843566], [180.60987101280907, 62.94324289843566], [180.60987101280907, 22.943242898435663]]] } },
{ "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [[[-5.65625, 110.828125], [-7.53125, 202.234375], [366.0625, 202.234375], [356.6875, 65.828125], [260.125, 59.265625], [253.09375, 40.984375], [189.34375, 19.890625], [141.0625, 36.765625], [111.53125, 6.765625], [73.5625, 36.765625], [67.46875, 10.984375], [41.21875, 10.515625], [36.0625, 42.390625], [65.59375, 53.171875], [-5.65625, 110.828125]]] } }
]
}
6 changes: 6 additions & 0 deletions test/fixtures/fatal4.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{"type":"FeatureCollection",
"features":[
{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[3.846028904999335,7.51285572161238],[13.846028904999335,7.51285572161238],[13.846028904999335,11.512855721612379],[3.846028904999335,11.512855721612379],[3.846028904999335,7.51285572161238]]]}},
{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-0.565625,11.0828125],[-0.753125,20.2234375],[36.60625,20.2234375],[35.66875,6.5828125],[26.0125,5.9265625],[25.309375,4.0984375],[18.934375,1.9890625],[14.10625,3.6765625],[11.153125,0.6765625],[7.35625,3.6765625],[6.746875,1.0984375],[4.121875,1.0515625],[3.60625,4.2390625],[6.559375,5.3171875],[-0.565625,11.0828125]]]}}
]
}

0 comments on commit 5960097

Please sign in to comment.