| Chunk |
|---|
| Conflicting content |
|---|
* @inheritDoc
*/
@Override
<<<<<<< HEAD
public GeometryOperation |
| Solution content |
|---|
* @inheritDoc
*/
@Override
public |
| File |
|---|
| DefaultMeasureGeometryOperations.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method declaration |
| Chunk |
|---|
| Conflicting content |
|---|
final boolean testTolerance;
double mValue = Double.NaN;
double distToSearchPoint = Double.MAX_VALUE;
<<<<<<< HEAD
InterpolatingVisitor(Point pnt, double tolerance, boolean testTolerance){
=======
InterpolatingVisitor(P pnt, double tolerance) {
>>>>>>> 7047d89c82c56d9e813f182d749f04fbbfa2de3e
if (pnt == null) throw new IllegalArgumentException("Null point is not allowed.");
searchPosition = pnt;
this.tolerance = Math.abs(tolerance); |
| Solution content |
|---|
double mValue = Double.NaN;
double distToSearchPoint = Double.MAX_VALUE;
InterpolatingVisitor(P pnt, double tolerance) {
if (pnt == null) throw new IllegalArgumentException("Null point is not allowed.");
searchPosition = pnt;
this.tolerance = Math.abs(tolerance); |
| File |
|---|
| DefaultMeasureGeometryOperations.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method signature |
| Chunk |
|---|
| Conflicting content |
|---|
this.testTolerance = testTolerance;
}
<<<<<<< HEAD
double m(){
if (!testTolerance || (testTolerance && distToSearchPoint <= tolerance)) {
=======
double m() {
if (distToSearchPoint <= tolerance) {
>>>>>>> 7047d89c82c56d9e813f182d749f04fbbfa2de3e
return mValue;
}
throw new IllegalArgumentException(String.format(OUTSIDE_TOL_MSG, distToSearchPoint, tolerance)); |
| Solution content |
|---|
}
double m() {
if (distToSearchPoint <= tolerance) {
return mValue;
}
throw new IllegalArgumentException(String.format(OUTSIDE_TOL_MSG, distToSearchPoint, tolerance)); |
| File |
|---|
| DefaultMeasureGeometryOperations.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| If statement |
| Method signature |
| Chunk |
|---|
| Conflicting content |
|---|
}
@Override
<<<<<<< HEAD
public void visit(Point point) {
// Note that this is also used when visiting MultiPoints
double dts = searchPoint.distance(point);
if (dts <= distToSearchPoint) {
mValue = point.getM();
=======
public void visit(Point |
| Solution content |
|---|
}
@Override
public void visit(Point |
| File |
|---|
| DefaultMeasureGeometryOperations.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Comment |
| If statement |
| Method invocation |
| Method signature |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
}
@Override
<<<<<<< HEAD
public void visit(LineString lineString) {
LineSegments lineSegments = new LineSegments(lineString.getPoints());
for (LineSegment segment : lineSegments) {
Point p0 = segment.getStartPoint();
Point p1 = segment.getEndPoint();
double[] dAndR = Vector.pointToSegment2D(p0, p1, searchPoint);
double d = Math.sqrt(Math.abs(dAndR[0])); //TODO -- Math.abs() should not be necessary. Check pointToSegment2D()
=======
public void visit(LineString |
| Solution content |
|---|
}
@Override
public void visit(LineString |
| File |
|---|
| DefaultMeasureGeometryOperations.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Comment |
| For statement |
| Method invocation |
| Method signature |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
}
@Override
<<<<<<< HEAD
public void visit(GeometryCollection collection) {
=======
public |
| Solution content |
|---|
}
@Override
public |
| File |
|---|
| DefaultMeasureGeometryOperations.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Class signature |
| Method declaration |
| Method signature |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
/**
* Creates a |
| Solution content |
|---|
/**
* Creates a |
| File |
|---|
| MeasureGeometryOperations.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Comment |
| Chunk |
|---|
| Conflicting content |
|---|
//data structures for the result
<<<<<<< HEAD
private final List |
| Solution content |
|---|
//data structures for the result
private final List |
| File |
|---|
| MeasureInterpolatingVisitor.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
}
private void startNewPointSequenceIfNotEmpty() {
<<<<<<< HEAD
if (currentBuilder.getNumAdded() > 0) {
pointSequences.add(currentBuilder.toPointSequence());
currentBuilder = PointSequenceBuilders.variableSized(dimFlag, crsId);
}
}
//Adds newPnt to current Builder, unless the newPnt is equal to latPoint
private Point addIfNotEqualLast(Point lastPoint, Point newPnt) {
=======
if (!sequenceIsEmpty) {
positionSequences.add(currentBuilder.toPositionSequence());
currentBuilder = PositionSequenceBuilders.variableSized(this.geometry.getPositionClass());
sequenceIsEmpty = true;
}
}
private P addIfNotEqualLast(P lastPoint, P newPnt) {
>>>>>>> 7047d89c82c56d9e813f182d749f04fbbfa2de3e
assert (newPnt != null);
if (!newPnt.equals(lastPoint)) {
currentBuilder.add(newPnt); |
| Solution content |
|---|
}
private void startNewPointSequenceIfNotEmpty() {
if (!sequenceIsEmpty) {
positionSequences.add(currentBuilder.toPositionSequence());
currentBuilder = PositionSequenceBuilders.variableSized(this.geometry.getPositionClass());
sequenceIsEmpty = true;
}
}
private P addIfNotEqualLast(P lastPoint, P newPnt) {
assert (newPnt != null);
if (!newPnt.equals(lastPoint)) {
currentBuilder.add(newPnt); |
| File |
|---|
| MeasureInterpolatingVisitor.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Comment |
| If statement |
| Method signature |
| Chunk |
|---|
| Conflicting content |
|---|
target.setSRID(srid);
}
<<<<<<< HEAD
/*
* Helpermethod that transforms a coordinatesequence into a pointsequence.
*/
private static PointSequence toPointSequence(CoordinateSequence cs, CrsId crsId) {
if (cs instanceof PointSequence &&
((PointSequence) cs).getCrsId().equals(crsId)) {
return (PointSequence) cs;
}
if (cs.size() == 0) {
return EmptyPointSequence.INSTANCE;
}
boolean hasM = hasM(cs.getCoordinate(0));
boolean hasZ = hasZ(cs.getCoordinate(0));
DimensionalFlag df = DimensionalFlag.valueOf(hasZ,hasM);
double[] coord = new double[df.getCoordinateDimension()];
PointSequenceBuilder builder = PointSequenceBuilders.fixedSized(cs.size(), df, crsId);
for (int i = 0; i < cs.size(); i++) {
// don't use cs.getOrdinate(i, ordinateIndex) because JTS 1.13 CoordinateArraySequence doesn't properly delegate to the Coordinate
Coordinate coordinate = cs.getCoordinate(i);
coord[0] = cs.getX(i);
coord[1] = cs.getY(i);
if(hasZ && hasM) {
coord[2] = coordinate.getOrdinate(CoordinateSequence.Z);
coord[3] = coordinate.getOrdinate(CoordinateSequence.M);
} else if (hasZ) {
coord[2] = coordinate.getOrdinate(CoordinateSequence.Z);
} else if(hasM) {
coord[2] = coordinate.getOrdinate(CoordinateSequence.M);
}
builder.add(coord);
}
return builder.toPointSequence();
}
/**
* Checks if this Coordinate implementation supports M values (the default one doesn't, but some do, eg HibernateSpatial MCoordinates)
*/
private static boolean hasM(Coordinate coordinate) {
try {
// M value is present and an actual number
return ! Double.isNaN(coordinate.getOrdinate(CoordinateSequence.M));
} catch (IllegalArgumentException e) {
// there is no M whatsoever
return false;
}
}
private static boolean hasZ(Coordinate coordinate) {
return ! Double.isNaN(coordinate.z);
}
=======
>>>>>>> 7047d89c82c56d9e813f182d749f04fbbfa2de3e
private static CoordinateSequence sequenceOf(org.geolatte.geom.Geometry geometry) {
if (geometry == null) {
throw new JTSConversionException("Can't convert null geometries."); |
| Solution content |
|---|
target.setSRID(srid);
}
private static CoordinateSequence sequenceOf(org.geolatte.geom.Geometry geometry) {
if (geometry == null) {
throw new JTSConversionException("Can't convert null geometries."); |
| File |
|---|
| JTS.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Comment |
| Method declaration |
| Chunk |
|---|
| Conflicting content |
|---|
}
<<<<<<< HEAD:src/test/java/org/geolatte/geom/PointSequenceBuilderTest.java
@Test
public void testNumAddedInvariants() {
PointSequenceBuilder builder = PointSequenceBuilders.fixedSized(2, DimensionalFlag.d2D, CrsId.UNDEFINED);
assertEquals(0, builder.getNumAdded());
builder.add(1,2);
assertEquals(1, builder.getNumAdded());
builder.add(3,4);
assertEquals(2, builder.getNumAdded());
}
=======
@Test(expected=IllegalStateException.class)
public void testFixedSizePSBuilderThrowsIllegalStateExceptionIfNotCompletelyFilled() {
PositionSequenceBuilder builder = PositionSequenceBuilders.fixedSized(10, C2D.class);
builder.add(2, 3);
builder.add(1, 2);
builder.toPositionSequence();
}
@Test(expected = IndexOutOfBoundsException.class)
public void testFixedSizePSBuilderThrowsIndexOutOfBoundsExcpIfFilledBeyondCapacity() {
PositionSequenceBuilder builder = PositionSequenceBuilders.fixedSized(2, C2D.class);
builder.add(2, 3);
builder.add(1, 2);
builder.add(4, 4);
builder.toPositionSequence();
}
>>>>>>> 7047d89c82c56d9e813f182d749f04fbbfa2de3e:src/test/java/org/geolatte/geom/PositionSequenceBuilderTest.java
} |
| Solution content |
|---|
}
@Test(expected = IndexOutOfBoundsException.class)
public void testFixedSizePSBuilderThrowsIndexOutOfBoundsExcpIfFilledBeyondCapacity() {
PositionSequenceBuilder builder = PositionSequenceBuilders.fixedSized(2, C2D.class);
builder.add(2, 3);
builder.add(1, 2);
builder.add(4, 4);
builder.toPositionSequence();
}
} |
| File |
|---|
| PositionSequenceBuilderTest.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Annotation |
| Method declaration |
| Chunk |
|---|
| Conflicting content |
|---|
package org.geolatte.geom; <<<<<<< HEAD import org.geolatte.geom.codec.Wkt; import org.geolatte.geom.crs.CrsId; ======= import org.geolatte.geom.builder.DSL; >>>>>>> 7047d89c82c56d9e813f182d749f04fbbfa2de3e import org.junit.Test; import static org.geolatte.geom.builder.DSL.linestring; |
| Solution content |
|---|
package org.geolatte.geom; import org.geolatte.geom.builder.DSL; import org.junit.Test; import static org.geolatte.geom.builder.DSL.linestring; |
| File |
|---|
| TestDefaultMeasureGeometryOperations.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
assertTrue(Double.isNaN(m));
}
<<<<<<< HEAD
@Test(expected=IllegalArgumentException.class)
public void testGetMeasureOpThrowsIllegalArgumentExceptionNWhenPointNotOnMeasuredGeometry() {
double m = measureOps.createGetMeasureOp(tc.measuredLineString2D, Points.create2D(5, 5), 0.0000001).execute();
assertTrue(Double.isNaN(m));
=======
@Test(expected = IllegalArgumentException.class)
public void testGetMeasureThrowsExceptionWhenPointNotOnMeasuredGeometry() {
double m = measureOps.measureAt(tc.measuredLineString2D, new C2DM(5, 5, 0), 0.001);
>>>>>>> 7047d89c82c56d9e813f182d749f04fbbfa2de3e
}
@Test |
| Solution content |
|---|
assertTrue(Double.isNaN(m));
}
@Test(expected = IllegalArgumentException.class)
public void testGetMeasureThrowsExceptionWhenPointNotOnMeasuredGeometry() {
double m = measureOps.measureAt(tc.measuredLineString2D, new C2DM(5, 5, 0), 0.001);
}
@Test |
| File |
|---|
| TestDefaultMeasureGeometryOperations.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Annotation |
| Method invocation |
| Method signature |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
assertEquals(4.5, m, Math.ulp(10));
try {
<<<<<<< HEAD
m = measureOps.createGetMeasureOp(tc.measuredMultiLineString2D, Points.create2D(2.5, 1), Math.ulp(100)).execute();
fail();
}catch(IllegalArgumentException e){
// OK
}
=======
m = measureOps.measureAt(tc.measuredMultiLineString2D, new C2DM(2.5, 1, 0), 0.001);
fail();
} catch(IllegalArgumentException e) {}
>>>>>>> 7047d89c82c56d9e813f182d749f04fbbfa2de3e
}
@Test |
| Solution content |
|---|
assertEquals(4.5, m, Math.ulp(10));
try {
m = measureOps.measureAt(tc.measuredMultiLineString2D, new C2DM(2.5, 1, 0), 0.001);
fail();
} catch(IllegalArgumentException e) {}
}
@Test |
| File |
|---|
| TestDefaultMeasureGeometryOperations.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Catch clause |
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
assertEquals(2d, m, Math.ulp(10));
}
<<<<<<< HEAD
@Test(expected=IllegalArgumentException.class)
public void bugPointsOutsideTolerance() {
Point searchPnt = (Point)Wkt.fromWkt("SRID=31370;POINT(206157.430115 194008.55010999998)");
Geometry weg = Wkt.fromWkt("SRID=31370;MULTILINESTRINGM((205522.61387500167 194764.36987499893 54.015,206238.09399999678 193925.8597499989 55.117))");
double m = measureOps.createGetMeasureOp(weg, searchPnt, Math.ulp(100)).execute();
assertFalse(Double.isNaN(m));
=======
@Test
public void testGetMinimumMeasureOpOnRegularMultiLineString() {
double m = measureOps.minimumMeasure(tc.lineString3DM);
assertEquals(5d, m, Math.ulp(10));
m = measureOps.minimumMeasure(tc.caseD1A);
assertEquals(0d, m, Math.ulp(10));
m = measureOps.minimumMeasure(tc.emptyMeasuredLineString);
assertTrue(Double.isNaN(m));
>>>>>>> 7047d89c82c56d9e813f182d749f04fbbfa2de3e
}
|
| Solution content |
|---|
assertEquals(2d, m, Math.ulp(10));
}
@Test
public void testGetMinimumMeasureOpOnRegularMultiLineString() {
double m = measureOps.minimumMeasure(tc.lineString3DM);
assertEquals(5d, m, Math.ulp(10));
m = measureOps.minimumMeasure(tc.caseD1A);
assertEquals(0d, m, Math.ulp(10));
m = measureOps.minimumMeasure(tc.emptyMeasuredLineString);
assertTrue(Double.isNaN(m));
}
|
| File |
|---|
| TestDefaultMeasureGeometryOperations.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Annotation |
| Cast expression |
| Method invocation |
| Method signature |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
}
@Test
<<<<<<< HEAD
public void bugPointsWithinTolerance() {
Point searchPnt = (Point)Wkt.fromWkt("SRID=31370;POINT(206157.430115 194008.55010999998)");
Geometry weg = Wkt.fromWkt("SRID=31370;MULTILINESTRINGM((205522.61387500167 194764.36987499893 54.015,206238.09399999678 193925.8597499989 55.117))");
double m = measureOps.createGetMeasureOp(weg, searchPnt, 25).execute();
assertFalse(Double.isNaN(m));
}
=======
public void testGetMaximumMeasureOpOnRegularMultiLineString() {
double m = measureOps.maximumMeasure(tc.lineString3DM);
assertEquals(30d, m, Math.ulp(10));
m = measureOps.maximumMeasure(tc.caseD1A);
assertEquals(4d, m, Math.ulp(10));
>>>>>>> 7047d89c82c56d9e813f182d749f04fbbfa2de3e
m = measureOps.maximumMeasure(tc.emptyMeasuredLineString);
assertTrue(Double.isNaN(m)); |
| Solution content |
|---|
}
@Test
public void testGetMaximumMeasureOpOnRegularMultiLineString() {
double m = measureOps.maximumMeasure(tc.lineString3DM);
assertEquals(30d, m, Math.ulp(10));
m = measureOps.maximumMeasure(tc.caseD1A);
assertEquals(4d, m, Math.ulp(10));
m = measureOps.maximumMeasure(tc.emptyMeasuredLineString);
assertTrue(Double.isNaN(m)); |
| File |
|---|
| TestDefaultMeasureGeometryOperations.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method declaration |
| Method invocation |
| Method signature |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
};
for (String s : strings) {
<<<<<<< HEAD
tokens = new WktTokenizer(s, words, CrsId.UNDEFINED);
=======
tokens = new WktTokenizer(s, words, crs);
>>>>>>> 7047d89c82c56d9e813f182d749f04fbbfa2de3e
assertTrue(Double.valueOf(s) == tokens.fastReadNumber());
}
|
| Solution content |
|---|
};
for (String s : strings) {
tokens = new WktTokenizer(s, words, crs);
assertTrue(Double.valueOf(s) == tokens.fastReadNumber());
}
|
| File |
|---|
| TestWktTokenizer.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
String testValue = Double.valueOf(m) + "E" + e;
String wkt = testValue + " ";
<<<<<<< HEAD
tokens = new WktTokenizer(wkt, words, CrsId.UNDEFINED);
=======
tokens = new WktTokenizer(wkt, words, crs);
>>>>>>> 7047d89c82c56d9e813f182d749f04fbbfa2de3e
double rec = tokens.fastReadNumber();
assertTrue("Expected == " + testValue + ", received == " + Double.toString(rec), Double.valueOf(testValue) == rec); |
| Solution content |
|---|
String testValue = Double.valueOf(m) + "E" + e;
String wkt = testValue + " ";
tokens = new WktTokenizer(wkt, words, crs);
double rec = tokens.fastReadNumber();
assertTrue("Expected == " + testValue + ", received == " + Double.toString(rec), Double.valueOf(testValue) == rec); |
| File |
|---|
| TestWktTokenizer.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
public void testWktTokenizerToDoubleOnValueLargerThanMaxValue(){
WktTokenizer tokens = null;
String wkt = "1.7976931348623157E309 ";
<<<<<<< HEAD
tokens = new WktTokenizer(wkt, words, CrsId.UNDEFINED);
=======
tokens = new WktTokenizer(wkt, words, crs);
>>>>>>> 7047d89c82c56d9e813f182d749f04fbbfa2de3e
double v = tokens.fastReadNumber();
assertTrue(Double.isInfinite(v)); |
| Solution content |
|---|
public void testWktTokenizerToDoubleOnValueLargerThanMaxValue(){
WktTokenizer tokens = null;
String wkt = "1.7976931348623157E309 ";
tokens = new WktTokenizer(wkt, words, crs);
double v = tokens.fastReadNumber();
assertTrue(Double.isInfinite(v)); |
| File |
|---|
| TestWktTokenizer.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
public void testWktTokenizerToDoubleOnValueLargerThanMinValue(){
WktTokenizer tokens = null;
String wkt = "4.8E-326 ";
<<<<<<< HEAD
tokens = new WktTokenizer(wkt, words, CrsId.UNDEFINED);
=======
tokens = new WktTokenizer(wkt, words, crs);
>>>>>>> 7047d89c82c56d9e813f182d749f04fbbfa2de3e
double v = tokens.fastReadNumber();
assertTrue(v == Double.valueOf(wkt)); |
| Solution content |
|---|
public void testWktTokenizerToDoubleOnValueLargerThanMinValue(){
WktTokenizer tokens = null;
String wkt = "4.8E-326 ";
tokens = new WktTokenizer(wkt, words, crs);
double v = tokens.fastReadNumber();
assertTrue(v == Double.valueOf(wkt)); |
| File |
|---|
| TestWktTokenizer.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
public void testWktTokenizerOnVeryLongDigitalExpansion(){
WktTokenizer tokens = null;
String wkt = "489823441.12345678912334432212345543211345654332211133455068345928456727 ";
<<<<<<< HEAD
tokens = new WktTokenizer(wkt, words, CrsId.UNDEFINED);
=======
tokens = new WktTokenizer(wkt, words, crs);
>>>>>>> 7047d89c82c56d9e813f182d749f04fbbfa2de3e
double v = tokens.fastReadNumber();
assertTrue(v == Double.valueOf(wkt)); |
| Solution content |
|---|
public void testWktTokenizerOnVeryLongDigitalExpansion(){
WktTokenizer tokens = null;
String wkt = "489823441.12345678912334432212345543211345654332211133455068345928456727 ";
tokens = new WktTokenizer(wkt, words, crs);
double v = tokens.fastReadNumber();
assertTrue(v == Double.valueOf(wkt)); |
| File |
|---|
| TestWktTokenizer.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Variable |