Skip to content

Commit 222c0e0

Browse files
authored
Fix Geometry WKB parsing issue For MultiPoint ZM geometry (#268)
1 parent d5a9a3f commit 222c0e0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/main/java/com/esri/core/geometry/OperatorExportToWkbLocal.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ else if (wkbBuffer.capacity() < (int) size)
750750
if ((exportFlags & WkbExportFlags.wkbExportPoint) == 0) {
751751
wkbBuffer.put(offset, byteOrder);
752752
offset += 1;
753-
wkbBuffer.putInt(offset, WkbGeometryType.wkbMultiPolygonZM);
753+
wkbBuffer.putInt(offset, WkbGeometryType.wkbMultiPointZM);
754754
offset += 4;
755755
wkbBuffer.putInt(offset, point_count);
756756
offset += 4;

src/test/java/com/esri/core/geometry/TestWKBSupport.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
package com.esri.core.geometry;
2626

27+
import com.esri.core.geometry.ogc.OGCGeometry;
2728
import java.io.IOException;
2829
import java.nio.ByteBuffer;
2930
import junit.framework.TestCase;
@@ -107,4 +108,12 @@ public void testWKB2() throws Exception {
107108

108109
}
109110

111+
@Test
112+
public void testWKB3() throws Exception {
113+
String multiPointWKT = "MULTIPOINT ZM(10 40 1 23, 40 30 2 45)";
114+
OGCGeometry geometry = OGCGeometry.fromText(multiPointWKT);
115+
ByteBuffer byteBuffer = geometry.asBinary();
116+
OGCGeometry geomFromBinary = OGCGeometry.fromBinary(byteBuffer);
117+
assertTrue(geometry.Equals(geomFromBinary));
118+
}
110119
}

0 commit comments

Comments
 (0)