Skip to content

Commit

Permalink
Fix Geometry WKB parsing issue For MultiPoint ZM geometry (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
satish-csi committed Aug 31, 2020
1 parent d5a9a3f commit 222c0e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ else if (wkbBuffer.capacity() < (int) size)
if ((exportFlags & WkbExportFlags.wkbExportPoint) == 0) {
wkbBuffer.put(offset, byteOrder);
offset += 1;
wkbBuffer.putInt(offset, WkbGeometryType.wkbMultiPolygonZM);
wkbBuffer.putInt(offset, WkbGeometryType.wkbMultiPointZM);
offset += 4;
wkbBuffer.putInt(offset, point_count);
offset += 4;
Expand Down
9 changes: 9 additions & 0 deletions src/test/java/com/esri/core/geometry/TestWKBSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

package com.esri.core.geometry;

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

}

@Test
public void testWKB3() throws Exception {
String multiPointWKT = "MULTIPOINT ZM(10 40 1 23, 40 30 2 45)";
OGCGeometry geometry = OGCGeometry.fromText(multiPointWKT);
ByteBuffer byteBuffer = geometry.asBinary();
OGCGeometry geomFromBinary = OGCGeometry.fromBinary(byteBuffer);
assertTrue(geometry.Equals(geomFromBinary));
}
}

0 comments on commit 222c0e0

Please sign in to comment.