Skip to content

Getting error while finding difference between a multipolygon and a polygon #721

@amishas157

Description

@amishas157

I am getting following error while finding the difference betweeen a polygon and a multipolygon.

/Users/AmishaSingla/Documents/osm-adiff-compare/node_modules/@mapbox/osm-compare/node_modules/@turf/difference/node_modules/jsts/dist/jsts.min.js:14
ln.checkValid(this.edgeList.getEdges()),this.graph.addEdges(this.edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Sn(this.geomFact);n.add(this.graph),this.resultPolyList=n.getPolygons();var i=new wn(this,this.geomFact,this.ptLocator);this.resultLineList=i.build(t);var r=new Ln(this,this.geomFact,this.ptLocator);this.resultPointList=r.build(t),this.resultGeom=this.computeGeometry(this.resultPointList,this.resultLineList,this.resultPolyList,t)},labelIncompleteNode:function(t,e){var n=this.ptLocator.locate(t.getCoordinate(),this.arg[e].getGeometry());t.getLabel().setLocation(e,n)},copyPoints:function(t){for(var e=this.arg[t].getNodeIterator();e.hasNext();){var n=e.next(),i=this.graph.addNode(n.getCoordinate());i.setLabel(t,n.getLabel().getLocation(t))}},findResultAreaEd

The polygon and multipolygon are following:

Source Code:
https://jsfiddle.net/tboq1cv5/

Not sure if the input to difference method is right or not.

cc @rowanwins @DenisCarriere

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions