iGN5117 commented on code in PR #873:
URL: https://github.com/apache/sedona/pull/873#discussion_r1243129071
##########
common/src/test/java/org/apache/sedona/common/FunctionsTest.java:
##########
@@ -1078,6 +1078,34 @@ public void affine2DHybridGeomCollection() {
assertEquals(expectedPolygon2.toText(),
actualGeomCollection.getGeometryN(0).getGeometryN(1).getGeometryN(1).toText());
}
+ @Test
+ public void geometryTypeWithMeasured() {
+ String expected = "POINT";
+ String actual =
Functions.geometryTypeWithMeasured(GEOMETRY_FACTORY.createPoint(new
Coordinate(10, 5)));
+ assertEquals(expected, actual);
+
+ // Create a point with measure value
+ CoordinateXYM coords = new CoordinateXYM(2, 3, 4);
+ Point measuredPoint = new GeometryFactory().createPoint(coords);
+ String expected2 = "POINTM";
+ String actual2 = Functions.geometryTypeWithMeasured(measuredPoint);
+ assertEquals(expected2, actual2);
+
+ // Create a linestring with measure value
+ CoordinateXYM[] coordsLineString = new CoordinateXYM[] {new
CoordinateXYM(1, 2, 3), new CoordinateXYM(4, 5, 6)};
+ LineString measuredLineString = new
GeometryFactory().createLineString(coordsLineString);
+ String expected3 = "LINESTRINGM";
+ String actual3 =
Functions.geometryTypeWithMeasured(measuredLineString);
+ assertEquals(expected3, actual3);
+
Review Comment:
Try POINT (0 0 1 0) or POINT ZM (0 0 1 0) on PostGIS, they dont throw error,
but return POINT.
In our case, yes please add test cases testing XYZM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]