@@ -81,10 +81,6 @@ static Geometry difference(Geometry geometry_a, Geometry geometry_b,
8181 if (!env_a_inflated .isIntersecting (env_b ))
8282 return geometry_a ;
8383
84- /*if (dimension_a == 1 && dimension_b == 2)
85- return polylineMinusArea_(geometry_a, geometry_b, type_b,
86- spatial_reference, progress_tracker);*/
87-
8884 if (type_a == Geometry .GeometryType .Point ) {
8985 Geometry geometry_b_ ;
9086 if (MultiPath .isSegment (type_b )) {
@@ -357,38 +353,5 @@ static Geometry multiPointMinusPoint_(MultiPoint multi_point, Point point,
357353
358354 return new_multipoint ;
359355 }
360-
361- /*
362- This optimization causes a bug when polyline segments are on the boundary.
363- static Geometry polylineMinusArea_(Geometry geometry, Geometry area,
364- int area_type, SpatialReference sr, ProgressTracker progress_tracker) {
365- // construct the complement of the Polygon (or Envelope)
366- Envelope envelope = new Envelope();
367- geometry.queryEnvelope(envelope);
368- Envelope2D env_2D = new Envelope2D();
369- area.queryEnvelope2D(env_2D);
370- envelope.merge(env_2D);
371- double dw = 0.1 * envelope.getWidth();
372- double dh = 0.1 * envelope.getHeight();
373- envelope.inflate(dw, dh);
374-
375- Polygon complement = new Polygon();
376- complement.addEnvelope(envelope, false);
377-
378- MultiPathImpl complementImpl = (MultiPathImpl) (complement._getImpl());
379-
380- if (area_type == Geometry.GeometryType.Polygon) {
381- MultiPathImpl polygonImpl = (MultiPathImpl) (area._getImpl());
382- complementImpl.add(polygonImpl, true);
383- } else
384- complementImpl.addEnvelope((Envelope) (area), true);
385-
386- OperatorFactoryLocal projEnv = OperatorFactoryLocal.getInstance();
387- OperatorIntersection operatorIntersection = (OperatorIntersection) projEnv
388- .getOperator(Operator.Type.Intersection);
389- Geometry difference = operatorIntersection.execute(geometry,
390- complement, sr, progress_tracker);
391- return difference;
392- }*/
393-
394356}
357+
0 commit comments